SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By jeff_vs
#188821
Hello SparkFun engineers! It seems there is a problem with the battery charging circuit on the Purpletooth Jamboree. It was driving me nuts. All versions of firmware failed to provide any feedback over SPI of charging status. Most notably, the error with firmware 6.0.33 was "BATTERY_STATUS CHARGER DISABLED_ERROR". I had the "BATT_CONFIG" setting enabled as well.

So, I took a look at the schematic and compared it to the BC127 datasheet from Blue Creation. After much head scratching I found one critical mistake.

The Purpletooth Jamboree has V_USB, V_FTDI and V_BAT all feeding V_IN through diodes. Then, you have V_IN feeding the VCHG pin on the BC127. According to the Blue Creation spec, the VCHG pin is supposed to connect directly to the external power supply (ie. V_USB or V_FTDI).

The problem this creates is that the VCHG pin is always seeing a voltage. When the BC127 sees a voltage on the VCHG pin it thinks the charger is connected. When no charger is connected the VCHG pin is supposed to see 0V.

So, I cut the trace between V_IN and the VCHG pin (leaving VCHG connected to the emitter of the PNP transistor) then soldered a jumper from the VCHG/E trace to the V_USB (to the anode of the diode).

Now it works! When I connect the USB power the "BATTERY_STATUS" shows "BATTERY_STATUS CHARGER IN_PROGRESS" and when it's disconnected it shows "BATTERY_STATUS CHARGER DISCONNECTED". It also shows the battery voltage in both cases.

Do I get a finder's reward? Do I get a free Purpletooth Jamboree 2.0? LOL!

Thanks,
Jeff
User avatar
By Ross Robotics
#188831
Yep, you're right. The only thing I see is the schematic in the datasheet has a 2R resistor on VBUS before VCHG. But, it is optional and I also agree it wouldn't drop the voltage like a diode would. Nice catch.

BC127 Datasheet: https://www.bluecreation.com/fdownload. ... 535522.pdf
You do not have the required permissions to view the files attached to this post.
By jeff_vs
#188856
Thanks. The sad part is, it still doesn't help my project.

I'm trying to manage a proper disconnect sequence prior to power removal, to avoid having the phone just time out to disconnect the bluetooth connection. According to the "Melody" manual, the only way to do that with the BC127 is to raise VREGEN high for 3 seconds, then it will "turn off". I was hoping that lowering the battery voltage below the "critical" threshold would trigger the shutoff (as it states in the melody spec), but the averaging on the battery voltage A-D input is way too long (10 seconds or more before it would actually shut off).

FWIW, In that spec you show, it states "Application of a voltage greater than 3.1V correctly boots the module, the module can be powered down by removing the fixed supply voltage or by pulling VREGEN low." What I have tried, and appears to work great is to have a pull up permanently on the VREGEN pin. Then, pulling it low turns it on or off without delay! Pairing is still achievable if the BC127 boots without finding a previously paired device.
By jeff_vs
#188940
jeff_vs wrote:What I have tried, and appears to work great is to have a pull up permanently on the VREGEN pin. Then, pulling it low turns it on or off without delay! Pairing is still achievable if the BC127 boots without finding a previously paired device.
Scratch that. It only works if there's no active stream. If there is an active stream it takes two successive pulls to ground to get it to disconnect. I can't understand why, but the first pull down doesn't stop the stream or anything.

Also, this only "worked" for firmware 6.0.33. Firmware 5.8.rc3 just acted haywire.

So, I ended up running a P-FET to pull VREGEN high (to 3.3V) when IGN_ACC is removed (i.e. vehicle ignition off). Then, I have a 5+ second capacitor drain down on the 3.3V power supply's EN pin to allow enough of a delay in the power supply's turn off to allow the 3-second VREGEN high pulse to trigger and complete the BC127 disconnect and power off sequence. It's definitely more complicated than I would prefer, but so far it's working consistently.

Jeff
User avatar
By Ross Robotics
#188943
Do you mind throwing up your schematic?
By jeff_vs
#189284
I modified the purpletooth to have the BC127 pins VCHG, VBAT_SENSE, VBAT and VDD_PADS to be tied directly to the 3.3V part of the board. Then, I have an LM2594 feeding the 3.3V directly to the 3.3V on the purpletooth. The attached schematic is how I connect the Vbatt and Vacc voltages.

When the +12V ACC power is lost, the 4.7µF and 470kΩ afford me about 3 - 5 seconds of power before the voltage on the gate of the N-FET drops below 2.5 V and the LM2594 shuts off.

Also, when the +12V ACC power is lost, the P-FET immediately pulls VREGEN high. Again, ONLY for firmware 5.8 rc3 will the BC127 turn off after the VREGEN is held high. Firmware 6.0.33 needs to see 3 seconds of high (3.3V) followed by a transition to low (0V) to turn the BC127 off.
You do not have the required permissions to view the files attached to this post.