Babka firmware development

Also, I think I’ve settled on name: Babka. It’s a Polish bread, in keeping a tie back to the Biscotti name (types of bread, starts with a B).

And I’m think of creating a second version that drops Biking Strobe (to make space, and it’s something I’d never use) and add a memory toggle, batt check toggle, etc.

Normally 4 modes is about my max on a clicky, but 10% is too bright for me following moon. I'd prefer 5%, 7% at most.

I also prefer memory, but with the reset back to mode #1 so I don't have to nav thru the hi modes to get to the lo mode. This is what I do in my clicky firmware. This feature is also known as "short cycle" memory, maybe first defined or termed by Dr Jones. It has pros and cons, though. Might go to 5 modes with this setup.

The short cycle memory functon was invented by sixty545 in feb.2011:

https://budgetlightforum.com/t/-/744/250

The name “Short Cycle Memory” was later used/proposed by DrJones.

I think what I’ve always thought of as “memory” is Short Cycle Memory. Essentially saying that from Hi, you reset back to Low, right? As opposed to going L - M - H - M - L ?

No, you go from any mode, not just hi, to low. Changing modes always starts from the first mode.

Big update, and source code is now included. See the OP.

My NC P20 is a clicky and it has this function. I’m a noob at this firmware stuff so no idea how they do it

The P20 has a dual-switch setup. And based on reading the manual, it sounds like that MODE button may be an e-switch. If LEDs in the tailcap can blink without the light being turned on, there’s juice flowing even with the light turned off. Such is not the case in your run-of-the-mill clicky.

Cool light though! Nitecore, while expensive, does make some nice lights. My P12GT was my first intro into the li-ion world, had me a bit spoiled :slight_smile:

A couple minor updates, see the changlog in OP

A couple minor updates, see OP for details

Can you do a setting so that it always get on at 100% another tap gets you to strobe then reversed mode toggle
Tactical configuration for self defense

I’ve never used a tactical setup. So basically just 100% and Strobe, no memory?

I’m right at the max size of the code as it is, but I’ll see if I can trim something down for some new options like that.

Yeah for tactical no memory and starting at 100% is ok group can stay as it is just reversed with hidden modes

For defence just turn light on and get max output is important

perfect firmware,thanks gchart for helping me out perfecting git even more! Quite helpull BLF fella

I tried your FW the first time today and it works fine for me. Thank you very much gchart!

It is the only one I found for Attiny13 with LVP, Batt Check, Turbo timer and without hardware modification (is there another one…?). And it can be further customized for my needs :+1:

Hello Gchart,

I hate to keep bothering you. Your version of babka based off biscotti is perfect for me. I finally got biscotti to work however, when I try to compile your babka I get several errors in reference to delay in ms:

Do you have any suggestions?

Thank you,

Frank

Hi Frank, no bother at all! It looks like the compiler isn’t finding the “_delay_ms” function. It should be in the “tk-delay.h” include file. Do you have that file in the same directory as your C file? (or nearby with the C file pointing to appropriate directory)

Also, there’s a new version that I just thought to upload, you can find it here. Highlights:

  1. Simplified Turbo Timer options to just Off / On (instead of Off / 3 min / 5 min)
  2. Lots of optimizations (smarter about INLINE functions, register variables, global vars, etc)
  3. Flexible-length mode groups
  4. Increase from 4 mode group options to 14 (can have up to 16)
  5. Fast Presses redundancy
  6. Option for turbo ramp-down instead of abrupt stepdown (set at compile time)
  7. Room for even more, currently compiles to ~956 bytes

Thank you gchart! I will double check when I get home from work today, and will be trying the new version!

Frank

Got the tk-delay.h issue resolved however now when I run it as copied from your page it states it is 1132 bytes and 110.5% full. Do I need to disable features or am I doing something wrong in atmelstudio? I have optimization set for –0s.

Thank you,

Frank

Wow, that’s a considerable size difference. You shouldn’t need to disable anything. I’m guessing it’s a compile option in Atmel. You say you have “–0s” selected… how about language standard C99? Make sure to use both of those.