STAR Firmware by JonnyC - Source Code and Explanation

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.

Are you using a light with an e-switch?

If so, you might find ToyKeeper/Baton.c useful as a starting point, since it already implements a lock mode toggled by a long long press from off. However, it uses long press while on to advance modes, and short press turns the light on or off in whatever mode was last used. But it might at least be useful as a base for making what you want.

The code is in the firmware repo link in my signature.

Thanks ToyKeeper, I’m using Garrybunk.c from here Index of /torches/garrybunk and made some mods and get all what i want less locking mode and duplicate imputs and outputs.

This is the modified code. Dropbox - JAIMELITO.c - Simplify your life

The extended turbo timer and gradual ramp down you guys helped write for me have served me very well especially when used with the off time memory version.

I’m looking to take it one step further and implement STAR in some higher capacity lights I’ve been using. These lights are typically used at lower outputs for several hours at a time.

What I’m after is a global timer that would turn the light off after 5 hours.

Global in the sense that it would apply to all of the settings on the light. If low, medium, or high was left on for five hours, it would automatically turn itself off.

Is something like this feasible within STAR off time memory?

Now i’m noticied that have some flickering in direct FULL MODE with long press from off, but not for normal 255 output…
How i could fix it?

In video the first light it’s when flickering and the second full is normal cycle full.

Yes, but the timing won’t be very precise.

You should be able to count the WDT ticks in a 16-bit unsigned int. I think the default is 500ms per tick, so 36000 ticks would be about 5 hours. If the code sees the timer has gotten that high, it can turn off the light using the same method the low-voltage protection uses.

I’m talking to myself. Fixed it. I’ve remove FULL MODE and put the last mode when a LONG PRESS.

My next step is control 2 leds and 2 momentary switch with only one ATTINY13A. It’s possible with attiny13A or i need to change it?

It’s possible. The 13A has six in/out ports. However, only five of them are practical as the last one is the reset pin (PB5). Setting the reset pin to be an IO means that you will have to resort to high voltage programming in order to be able to flash the driver again. Other than that, you can do what you want with the five IOs. I think only two of them can do PWM, so these should be your LED outputs. Use two more for the E-switches, and the last you could use as a voltage monitoring input if you want.

Ok. i think to use PB0 as second led output and PB4 as second switch but my question is. Can work attiny13A with two different pwm frecuencys at the same time?

Yes, the attiny13a can do two PWM channels at once, but they share a loop counter. See the “dual PWM” section of the repository index file for a list of projects which support this, as examples of how to do it. The shared loop counter goes from 0 to 255 and each PWM channel has its own ceiling so you can control the output of each independently.

100Hz & 8kHz at the same time?