STAR Firmware by JonnyC - Source Code and Explanation

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!!!

Do you guys believe 5.6v & 8.4v is the low voltage limit for 2 & 3s cells?

You need to be careful here, because you aren't monitoring each cell individually. You need to account for the very real possibility of one cell dying before the other. If you assume that the typical cell voltage to be 3.7V and the lowest you want a cell to go is 2.8V then perhaps 6.5V might be the cutoff for two cells and 10.2V for three. Of course you can always plug in different numbers and recalculate. I can't say those are good values or not, and certainly not in all situations. I just think it is best to error on the high side; leave a little juice in the cells rather than risk damaging them, or worse, damaging yourself (or the trusting soul that is holding the light for you).

As was stated, always use identical cells in series and/or parallel arrangements.

So let’s say I want my cut-off voltage to be 6.2v. If I use a 22kohm resistor for R1, a 2.2kohm for R2 should get me in the right vicinity, correct? Close enough that I can then use TK’s battcheck to get the exact ADC values I need?

(Using the calculator that wight linked in a different thread)

Is there 1 mode-100% ( or star choosable 1 mode) 105c firmware awailable guys? Currently i am bypassing the atttiny13 in order to achieve this :~

For 2S cell configuration I’ve been using 47.7K and as R1 with 4.7K as R2, but I would have no issues with trying your values, they should work.

Not to my knowledge. Star would have to be re-written a little, as with 1 mode there is no mode to step down to on low voltage. Ask here, it’s a more general firmware thread: Flashlight Firmware Repository

FWIW, I added a STAR_1mode firmware to my repository since the changes needed to do this turned out to be non-trivial.

I’m not sure it should really be called STAR though (even though it’s 95% the same code), since it doesn’t use the stars any more. With only one mode there’s no point checking the stars.

I’d rather order from Fasttech but they don’t seem to stock the clip but from what I understand this stuff from dx.com should do the trick?

Clip: http://www.dx.com/p/sop8-abs-test-clip-black-343981
Programmer: http://www.dx.com/p/usbasp-usbisp-downloader-programmer-for-51-avr-blue-black-265121
Wires: http://www.dx.com/p/diy-10cm-20-pack-female-to-female-dupont-line-wire-multicolored-358927

And I’m rather using Linux but Avrdude seems to be working fine there. Compiling binaries should work in Linux too with some manual work, needing the avr-gcc toolchain. I’m mostly looking for a three mode driver, Lo-Hi-Strobe, so it’s probably already available in one of JonnyC’ or DrJones’ firmwares. I’d rather get rid of PWM completely, just run on 8x7135 for Hi and 1x7135 for Lo, but dunno if that’s possible without hardware tweaks?

I haven’t tried any of the flashing tools from DX; not totally sure if it works or not. Could you let us know your results?

All the tools work fine in Linux, and pre-built packages are available at least in Debian and Ubuntu.

For 1x7135 and 8x7135, you’ll need a driver with dual PWM, such as one of wight’s designs or the “moonlight special” from RMM. The only free firmwares which support both dual PWM and strobe are “starry-offtime” and “blf-a6”, found in my code repo linked below. However, almost nobody can see the difference between fast PWM and actual current control, so the dual PWM requirement is probably not really necessary.

Do you think those three items above will work? If so I’ll order them. And yes I promise that I’ll let you know if they work, or not :slight_smile:

That sounds great. Will just have to look up a good tutorial then.

That was my hope too. Just a stock 105c/105d with custom firmware with fast pwm will be good enough for most people. Also I think the mtn dd+7135 should be able to run without pwm with custom firmware, running Lo on the 7135.