Topic: Testing the battery board
I have made a separate post for the testing I'm doing to my board since it seems that I'm hijacking mclien's post which is more about getting togheter the people who whants to buy a battery PCB
Anyone who whants to see the first steps of my build, they can see them here:
http://www.kosagi.com/forums/viewtopic.php?pid=17#p17
http://www.kosagi.com/forums/viewtopic.php?pid=98#p98
http://www.kosagi.com/forums/viewtopic.php?pid=121#p121
http://www.kosagi.com/forums/viewtopic.php?pid=137#p137
Once the board was complete, I build an adapter board and I did put standard pins so I can access all the SATA connector signals. I hooked up a Bus Pirate to be able to communicate with the board and it worked!! This was the output:
~Resetting (Ver 11, git version bf392dd930ecb7b83cb639cdde6000560b3e6759)~
ChibiOS/RT Shell
ch> help
Commands: help exit info systime i2c mode dac stats leds gg chg setchem setmanuf
ch> info
Kernel: 2.6.0
Compiler: GCC 4.8.4 20140526 (release) [ARM/embedded-4_8-branch revision 211358]
Architecture: ARMv7-M
Core Variant: Cortex-M3
Port Info: Advanced kernel mode
Platform: STM32F10x Performance Line Medium Density
Board: Senoko STM32F1
Build time: 12 2014 - 17:39:46
ch> chg 1000 12600 1000
Setting charger: 1000mA @ 12600mV (input: 1000mA)... Ok
ch> gg setup 3 1000
Setting cell count... Unable to set 3 cells: 0xFFFFFFFF
Setting capacity... Unable to set capacity: 0xFFFFFFFE
ch> stats
Manufacturer: error 0x80000004
Part name: error 0x80000004
Firmware ver: error 0x80000004
State: error 0x80000004
Time until full: error 0x80000004
Time until empty: error 0x80000004
Chemistry: error 0x80000004
Serial number: erx80000004
Capacity: error 0x80000004
Full capacity: error 0x80000004
Design capacity: error 0x80000004
Temperature: error 0x80000004
Cell count: error 0xFFFFFFFF
Voltage: error 0x80000004
Current: error 0x80000004
Charging current: erx80000004
Charging voltage: error 0x80000004
Avg current: error 0x80000004
Cell 1 voltage: error 0x80000004
Cell 2 voltage: error 0x80000004
Cell 3 voltage: error 0x80000004
Cell 4 voltage: error 0x80000004
Alarms:
TERMINATE CHARGE ALARM
OVER TEMP ALARM
TERMINATE DISCHARGE ALARarge state:
Battery discharging/relaxing
STATUS ERROR CODE: 0x4
So, it's great to be able to use the Battery board shell, but it seems that the STM32 isn't able to talk to the gas gauge.
I know this is something that few people besides xobs or bunnie will be able to help with, but in any case it may be interesting to anyone who wants to know how the battery board works...
So, trying to isolate the problem this is what I checked (both charger and battery are connected):
P3.3V_UC: 3.3V regulator (U102) wich powers the microcontroller: OK
CHG_VREF: 3.3V internal regulator of the charging circuit (U200): OK
GG_3.3V: 3.3V internal regulator of the gas gauge (U301): NOT OK! measures 1.000V
Removed the LED diodes to be sure they aren't causing a short, all remains the same.
GG_2.5V: 2.5V internal regulator of the gas gauge (U301): NOT OK! measures 1.490V
PACK (pin 2): 0.02V
Vcc (pin 3): 11.03V
BAT_PROTECTED: 0.02V
Another thing that I have noticed is that when I type "chg" in the chibios shell, when plugged to the charger it doesn't display any voltage or current:
Charger state: 0mA @ 0mV (input: 0mA)
But, when I do the same plugged to the battery while pressing the "prime" button it displays a current and voltage, but it changes a lot each time and it's wrong:
Charger state: 0mA @ 6780mV (input: 16384mA)
Charger state: 8192mA @ 18996mV (input: 4096mA)
Charger state: 0mA @ 0mV (input: 0mA)
Charger state: 2048mA @ 0mV (input: 0mA)
Charger state: 2048mA @ 0mV (input: 0mA)
Charger state: 16386mA @ 10285mV (input: 4096mA)
Charger state: 16386mA @ 10285mV (input: 4096mA)
Charger state: 16386mA @ 10285mV (input: 4096mA)
Charger state: 2048mA @ 20480mV (input: 49664mA)
Charger state: 0mA @ 6777mV (input: 16384mA)
Charger state: 2048mA @ 6777mV (input: 16384mA)
Charger state: 2048mA @ 103mV (input: 0mA)
It would be great if xobs or bunnie could point me in the right direction
Anyway, I know this can be an obscure matter and difficult to diagnose so I will keep searching for any mistake I could have made while populating the PCB and I will update when I find the problem
And just because such a long post would be too boring without a picture, here is my current setup: