User guide for Mark's charger code

Forum for announcements and discussion of beta firmware.
Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Thu Apr 02, 2015 11:12 am

All samples are taken in single shot mode. The sampling frequency is determined by the resolution selected. The firmware currently uses 18 bit for voltage which gives 3.75 samples per second. Current readings are done in 16 bit mode and that gives about 15 samples per second.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Fri Apr 03, 2015 6:07 pm

Good to know, thank you Mark!

I am now also wondering about the serial clocking frequency f(SCL) on the I²C bus line. That's given by the MCU (master), not the chip (slave), as far as i understood. From the installed pull-up resistors on the serial lines in Paul's schematics, it cannot be Highspeed (3.45MHz) but has to be either Fast Mode (400kHz) or Standard Mode (100kHz).

With a sampling frequency of 3.75SPS (or 15SPS), 18-bit, say 4 battery slots and 2 chips, and 1 MCU, i am guessing that 100kHz serial clocking speed would still be much more than sufficient?

My shot in the dark. :lol:

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Wed Apr 08, 2015 4:28 am

I'd have to look into it to find that out. We're not doing anything unusual with the I2C bus, so it should be just whatever Arduino defaults to.

As you say 100 kHz would be plenty for the job that we're doing.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Tue Apr 14, 2015 10:20 am

hey Mark, greetings from somewhere special i maybe getting some insight into internals ;)
Are you too into analyzing and critiquing schematics?
Well i am, but i am not the best at it :geek:

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Tue Apr 14, 2015 10:38 am

I do have some interest in looking at schematics, but I wouldn't claim to be an expert on them either!

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Tue Apr 21, 2015 3:28 am

I cannot discover any battery reverse polarity protection in the schematics. For example for BAT1_V, the signal (=absolute voltage, the potential with respect to GND) at the ADC pin would get negative if someone inserts a 1.2V battery in reverse direction, wouldn`t it :?:

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Wed Apr 29, 2015 2:05 am

Sorry I missed replying!

I wouldn't recommend inserting batteries around the wrong way myself, but I don't think that it would be a problem on any of the chargers except for the original non LCD charger - all the latest versions have 10k resistors on the inputs to the ADC which should limit any current to a safe level.

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Thu Apr 30, 2015 6:34 am

Hello Mark, the datasheet mentions that the absolute voltage, (or potential to GND), at the input pins should not become negative. With a 10k resistor in series the resulting current would be minimal but the pin voltage would imo still be negative, i am not sure though. I do know that the pins have internal input protection so maybe a reversely inserted battery is harmless after all. Let`s find out by RL testing :lol:

Btw, electronic reverse polarity protection in low voltage circuitries is afaik an engineering challenge, since they cannot accept a simple blocking diode with a 0.7V voltage drop. Even modern expensive top quality premium brand flashlights don`t have it. With flashlights the easiest is the best solution: a thin plastic washer/spacer glued to the plus(+) pole contacts of the battery holder ensures that flat-bottom (and flat-top) batteries can`t make mechanical contact for closing the circuit. Open circuit, no light. Very effective.

Mark
Site Admin
Posts: 411
Joined: Sun Jul 28, 2013 6:47 am
Location: Brisbane, Australia

Re: User guide for Mark's charger code

Postby Mark » Thu Apr 30, 2015 12:35 pm

I agree that a design that ensures that the negative end of the cell can't make physical contact with the positive terminal is often the best, it's unfortunately not always feasible.

I'm not going to claim to be an expert on this, but my understanding is that the issue with taking the input terminals to a negative voltage is due to the limited current capability of the ESD diodes. The ESD diodes on the inputs clip the input voltage to no more than about 0.6V below ground - thereby protecting the rest of the IC. Without the input resistors though, enough current would flow through the ESD diodes to burn them out. With the 10k resistors in place, the current is limited to about 0.08mA even with a fully charged NiMH cell - I'd be very surprised if the ESD diodes couldn't handle that level of current for at least a while...

dino
Posts: 24
Joined: Tue Nov 04, 2014 12:54 pm

Re: User guide for Mark's charger code

Postby dino » Thu Apr 30, 2015 2:13 pm

i'll agree,you're right with the esd diodes and clipping. however the absolute max rating in the specs is surpassed by your quoted 0.6v by 0.2v.
anyway i am right,ain't i,that the schematics don't have any explicit measure for rev pol protection?


Return to “Beta Testers”

Who is online

Users browsing this forum: No registered users and 1 guest