Lawmate / BQ4050

Library for basic interfacing with BQ4050 battery fuel gauge from TI
Other
14 stars 6 forks source link

readFuel.ino #10

Open kkolding opened 1 year ago

kkolding commented 1 year ago

Using a DOIT ESP32 DEVKIT V1

I can get values from cell 1-2-3-4, pack value, state of charge.

the current reading on the other hand does not work past -99mA something weird happens and it bugs up and reads -1mA

RWBRWB commented 1 year ago

Did you ever get this figured out?

I'm using the same ESP32 DEVKIT V1 with the BQ4050 and the code reads all the data 2-3 times then the data does not change after that until I take a load off the battery and then the current changes to -1ma and never changes after this.

If I reset the ESP32 the readings are good again for 2-3 reads then the same thing happens.

I was able to write the DataFlash register with the write code so that works also.

The BQ4050 works perfectly with the same chip setup.

Looked at the Scope of the I2C data and it looks good waveform wise.

Just trying to figure out what would cause the code to freeze up like it does.

How much testing has been done with this library and the BQ4050 chips?

The library is awesome so I would love to see this working if possible.

Lawmate commented 1 year ago

Hi, glad you're getting some use from the library.

I haven't played with it for quite a few years I'm afraid.

I only really worked with the registers that I needed for that project, not all that are there.

When I was developing it, I had a logic analyser which helped a lot. Doing it on a scope could work, but it speeds things up a lot with an analyser.

The checksum calculation was a bit of a sticking point to write the dataflash.

Sorry I can't be more help, but I did find the TI E2E forum helpful.

Thanks

RWBRWB commented 1 year ago

It's weird, my own library works fine but yours will read or write for about 2 to 3 cycles then sticks.

Must be something off somewhere.

My library does not have any data flash register writing options so I'll look to your library as a way to emplement that as it does work to write a few registers before freezing up.

Thanks for replying.

On Wed, Apr 26, 2023, 8:35 AM Lorro @.***> wrote:

Hi, glad you're getting some use from the library.

I haven't played with it for quite a few years I'm afraid.

I only really worked with the registers that I needed for that project, not all that are there.

When I was developing it, I had a logic analyser which helped a lot. Doing it on a scope could work, but it speeds things up a lot with an analyser.

The checksum calculation was a bit of a sticking point to write the dataflash.

Sorry I can't be more help, but I did find the TI E2E forum helpful.

Thanks

— Reply to this email directly, view it on GitHub https://github.com/Lawmate/BQ4050/issues/10#issuecomment-1523344957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREKLUN7NNKXMSEXOSKGILLXDEJALANCNFSM6AAAAAARQ3GJHE . You are receiving this because you commented.Message ID: @.***>

RWBRWB commented 1 year ago

You mentioned that you did all your coding & testing on the Teensy 3.1 in the Github notes if I remember correctly.

Just wanted to verify that your code was working fine with that MCU + your library.

I'll think I have a Teensy 3.1 here to test vs the ESP32 that wasn't working after a few reads.

At a minimum I want to use your code for programming the Data Flash with PEC.

Thanks, Ryan Brown

On Wed, Apr 26, 2023 at 1:24 PM Ryan Brown @.***> wrote:

It's weird, my own library works fine but yours will read or write for about 2 to 3 cycles then sticks.

Must be something off somewhere.

My library does not have any data flash register writing options so I'll look to your library as a way to emplement that as it does work to write a few registers before freezing up.

Thanks for replying.

On Wed, Apr 26, 2023, 8:35 AM Lorro @.***> wrote:

Hi, glad you're getting some use from the library.

I haven't played with it for quite a few years I'm afraid.

I only really worked with the registers that I needed for that project, not all that are there.

When I was developing it, I had a logic analyser which helped a lot. Doing it on a scope could work, but it speeds things up a lot with an analyser.

The checksum calculation was a bit of a sticking point to write the dataflash.

Sorry I can't be more help, but I did find the TI E2E forum helpful.

Thanks

— Reply to this email directly, view it on GitHub https://github.com/Lawmate/BQ4050/issues/10#issuecomment-1523344957, or unsubscribe https://github.com/notifications/unsubscribe-auth/AREKLUN7NNKXMSEXOSKGILLXDEJALANCNFSM6AAAAAARQ3GJHE . You are receiving this because you commented.Message ID: @.***>