STAR Firmware by JonnyC - Source Code and Explanation

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.

I think so, but I’m not sure about the clip size. Usually it’s called a SOIC8 clip.

The README in my firmware repo has information about installing/using tools in Ubuntu or Windows, links to the hardware I use, plus links to other guides including other hardware people have used:
http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/view/head:/README

Yes, the DD+7135 drivers will work too, but I thought you wanted to stick with 7135s. :slight_smile:

However, a single 7135 running at 100% is not what I would call a “low” mode. It should do about 100 to 150 lumens in that mode.

In any case, a regular nanjg works fine as long as you don’t mind being limited to 2.8A. It also has no offtime capacitor, but that’s not really an issue if you use memory decay to distinguish short vs long taps, add a capacitor yourself, or use an ontime-based firmware.

Yeah I wasn’t sure about the clip either. But I managed to find this: List of integrated circuit packaging types - Wikipedia

So hopefully sop8 and soic8 are the same thing. :slight_smile: I’ll order and see what happens.

I’m only using P60 hosts right now so yes I do want to stay away from DD. One 7135 would be a perfect Lo mode for me. Also this driver from Fasttech seems pretty good but it doesn’t got a flashable ic, at least not that you can connect to within reason.
https://www.fasttech.com/products/1612/10001997/1143103-1-lithium-2-group-3-5-mode-2-6a-led-flashlight

It could possibly be hidden like a friggin hamburger. :slight_smile: I think I’ll better stick to 105c/d for now.

Edit: And thanks for helping a newbie out. :slight_smile:

Hey all,

I was just wandering if anyone happens to have a version of this or some other OS firmware that is a just a traditional L, M, H, Strobe, SOS, with memory?

I think you could probably configure the’s TheStar firmware to do L/M/H/Strobe/SOS with memory, in such a way that the blinkies are hidden. It’s more complicated than that by default though.

Easy. Just replace the mode definitions in TheStar code with the following:


[quote=Three modes with hidden Strobe and SOS]

// Basic modes

#define N_BASIC_MODES 3

#define MODE_LOW, MODE_MED, MODE_TURBO

// Hidden modes

#define N_HIDDEN_MODES 2

#define HIDDEN_MODES MODE_STROBE, MODE_SOS

[/quote]


[quote=Three modes, Strobe and SOS in same sequence]

// Basic modes

#define N_BASIC_MODES 5

#define MODE_LOW, MODE_MED, MODE_TURBO, MODE_STROBE, MODE_SOS

// Hidden modes

#define N_HIDDEN_MODES 0

#define HIDDEN_MODES

[/quote]




Thanks _the_ I appreciate it. Would you possibly be willing to do me one more favor? I have tried and tried to get these files to work and so far had no luck generating any working code, and have not even succeeded at converting a working file to a hex.

Could you possible send me a hex with the second option where its low, med, high, strobe, SOS, with memory in one sequence? No hidden stuff.

If its is something that take much time I would compensate you.

Thanks either way.


No problem. Please PM me your email address and I'll compile the hex and send it to you.

What kind of mode percentages do you want for L->M->H? Do you want a full 100% high without turbo timer? Any other "annoying" features you would like me to strip away before compiling it?

On- or off-time memory?

..and please try also the one with hidden goodies.. Who knows, you might even like it. :)

Yeah, I kind of assumed the blinkies would need to be hidden. I don’t think I’ve ever heard anyone request non-hidden blinkies before. TheStar has a nice way of keeping those out of the main sequence without disabling memory.

That is fantastic, thank you so much!!! I will PM my info. This driver is not for me it was a request I had from someone else. I will message him and ask if he would like the blinkies to be hidden.


If the strobe and SOS were hidden how would they be accessed?

By looping through the basic modes twice (in a row, without pauses).

Hi, i’m a regular reader but is my first post in BLF.

I’m trying to make a variant of your firmware but with a lock mode.

From off: 1 extra long press of switch (i.e.10 seg) locked, and only with another 10 seg can unlock

Anybody can help me with the code. I don’t know C but try and error can modify the original code like this:

From off:

  • 1 long press 100%
  • 1 short press cycle L to H (without 0%)

From on:

  • 1 long press 0%
  • 1 short press cycle L to H (without 0%)

Thanks in advance.

Jaime.