STAR Firmware by JonnyC - Source Code and Explanation

The voltage check routine is written with a 19.1K for R1 in mind. With a 22K resistor the input pin is reading a different voltage level. You will have to adjust the battery check values if you want to use a 22K resistor.

Do you mean the battcheck.c firmware is written for 19.1K R1 and i have to edit it so that it can read correct voltage if i use 22k R1? Or do you mean i have to adjust the ADC value of the blf-a6 firmware because it is written for 19.1K R1?
From my understanding, the battcheck.c firmware will read the voltage, then interpret it as 3 groups of blinks so that we can adjust the ADC value. Example on my qlite driver i got 1-3-4 blinks at 3.0v. Then i have to adjust the ADC for 3.0v to 134. But with the driver i built i always get 255 value from 3.0v to 4.2v. How do i edit the battcheck.c firmware so that it will read correct voltage for 22k R1?

I don’t use either of these firmwares so I haven’t tested, just took a quick look at them. The A6 firmware assumes R1 us 19.1K. The battcheck has no notes on what R1 should be, but I assume that it’s also based on R1 being 19.1K as it, together with the 4K7 R2, appears to be the standard. I use these resistors in all my single cell drivers because they work, no need for me to change.

I just did a check and the voltage difference is however not so big between 22K and 19.1K (just under 0.1V), so I guess this is not the problem. Have you checked with a DMM that the PB2 pin on the MCU is receiving correct voltage after the divider? EDIT: If you read 3.2V on the MCU’s PB2 pin with those resistors you have probably swapped R1 and R2.

Something isn't right here, those values should work just fine. There must be another problem you have yet to discover, are R1 and R2 swapped? (R1 goes to batt+, R2 goes to GND) Is R2 open? Measure the voltage at pin7 (ADC input), it should be in the 0.5V to 0.75V range, if not, find out why. If the resistors were removed from another board, they may have been damaged. If they are new, double check their value to be sure they are correct.

Oops, your right. I got mine mixed up… edited my post a little.

The resistors are in the right place and they are new, resistance value is correct. The voltage at pin7 is 0.56v.
Maybe i have a bad MCU? I flashed it with the blf-a6 firmware and modes are working fine.

Did you load BattCheck.hex or did you compile your own version?

I can't believe there is a problem with the MCU, but I've never heard of this problem you're having. I guess its possible an ESD hit took out the ADC and left all else intact...

I got nothin'

If you do replace the MCU, and that works, I'd be pleased but puzzled.

Is there am maximum number of modes that can be put into STAR Momentray? Momentary

It appears to be limited only by available RAM and ROM. With alt PWM enabled, you’re probably limited to about 15 modes, and without that you might be able to get 20 or 25 modes.

If you want enough modes to make a smooth ramp though, you might want to look into Ferrero_Rocher/Ramping_UI_table.c instead.

Thanks! I really only need 7-8 for a driver I’m giving away, so it looks like I’m golden.

Just FYI - It hasn't been announced "officially", but the TheStar FW has been available in TK's repository for some days already (both on- and off-time versions are there).

Feel free to try it and report your findings to me. Thanks in advance.

If this is too much OT for this thread, the discussion can continue in the old TheStar thread.

I just replaced the mcu and everything works fine .now. Thanks

That was a weird one, but I'm glad you fixed it. Enjoy!

Do I still use the 200 resistor (after replacing diode) along with R1 & R2?

Dear zeremefico,

I should better to edit VCC to B+. Don’t be confused with the VCC of the MCU. The VCC of the MCU ( Pin 8 ) must not higher than 5.5V.

The voltage divider R1 and R2 are employed to lower the B+ voltage into the ADC reading range of 1.1V reference. I was confused what 200 resistor and which driver you are talking about.

Would you please post the schematic of your driver.


This is my design:-)

Oh, I see. The solder pads of the diode was replaced by a 20K ( 2002 ) resistor. Then the resistance of the voltage divider R1 is 20K + 19.1K ( 1912 ) = 39.1K and the R2 is 4.7K ( 4701 ). When the battery is 6.1V, the ADC value is 152.

ADC=(6.1*4700*255)/((39100+4700)*1.1)
ADC=152

May I ask how to supply power to the MCU of your driver?

.

Would someone be kind enough to tell me what is being written to EECR when it says 32+4+2.
.
Is it binary or hex or something
.
I’m used to doing EECR |= (1<<EEMPE); etc
.
Just can’t figure out how the numbers relate to the register
.
.
EDIT: ok, got it, ignore me. It’s binary

With 8.4v using ZY-T13 driver as contact board.
Thank you for your help with the voltage!!!