STAR Firmware by JonnyC - Source Code and Explanation

I haven’t actually gotten started writing and flashing attiny firmware yet. I just figured, as long as the chip has dedicated hardware for offloading wait loops, it might be worth using. However, that would only work if that interrupt and counter aren’t already being used for something else, and it doesn’t guarantee the CPU won’t be awakened early by some other interrupt.

I’ll know more after I really have a chance to dive in and start mucking with things. I’m planning to do some stuff with variable-speed slow strobes and underclocking and clock dividers, so timing will get a bit tricky.

I agree, but it appears that the _delay_ms() routine that comes with the package doesn’t use the it, so by replacing it with my loop I will not make anything worse.

It could perhaps get better with what you suggest but re-writing the existing _ms_delay() function to incorporate interrupts is way over my head. I just needed a few more bytes and, as it appears to me, I didn’t cause any increased CPU load.

Edit: If you have a look at the delay.h (which I assume comes along with AVR Studio) I think you’ll see what I mean. I’m doing the same thing as that routine, just less byte intensive, that’s all.

Thanks for testing this. I’ll probably be hurting for spare bytes when I start making changes, so every little bit helps.

Anyone know what cap value/size to use for off time memory? I've been post hunting, but just can't find it - not on Jonny's web site, not mentioned in the source code for STAR_off_time, not on Richard's website, can't find it here, can't find a thread for it, just can't find it, period... Help? I know it must be somewhere?? Is Jonny's STAR_off_time the only driver source code that uses it?

I believe it goes between an IO pin and ground, from a comfy pic somewhere...

1uF works well and is the specified value. It’s in the OP waaaay at the bottom. Other values work too though, HarleyQuin investigates this on page 5 of this thread.

In terms of other firmwares that use a cap, Tido’s firmware (BLF-VLD) supports offtime but I don’t remember if it worked with just a cap or a cap and a resistor or what.

If my memory is correct, the cap is 1uF X7R 0805 size and is connected between pin2 (PB3) and ground.

I got the ones recommended by comfychair:

http://www.ebay.com/itm/181283883536

The easiest would be to solder it to the 4th star and grounding ring, but there are other options. Others should be able to help with that...

Thanks all! I ordered those caps off of the eBay link. I missed mentioning of the cap value in the OP. My links to posts don't see to work - very frustrating... The comfychair link I could not find

I put the cap between star 4 and the ground ring on the 105c. For the AK-47A I want to keep the bottom free of components so I put the cap on two pads marked R4. It connects pin 2 and ground just like using the 4th star.

The 101-AK-A1 is a little more difficult, there is no straight forward location for the cap. I haven’t done one yet, I just stack 7135s on an AK-47 if I want more than 1 amp with a flat bottom driver.

You are not the only one - it seems different people are using a different number of posts per page, so a link to a specific post that works for one person is broken for somebody else. Site really shouldn't require the page number in links to specific posts, or something. Links in notification emails don't work either for the same reason I think.

I can only get to the post in that link by changing the '?page=7' to '?page=4' - https://budgetlightforum.com/t/-/25032?page=4#comment-573278

Oh -- found out more... I had my setting at 150/page while locusto03 must be using 30/page (experimented til I found one that worked). I set mine to 50/page, thinking that's the default?? Not sure...

Mine is set to 50/page. Don’t know if that is default or if I made the change.

150 here.

I’ve been wondering about the specific post links too. I don’t have a solution, but I try to reduce the issue by using links compatible with the default page size. The default is 30, which I checked by viewing BLF in a browser with no login and no cookies.

I add the post number so people can find it despite a broken link.
Post #352

Post #122 has the link to Digi-Key for the capacitors I use.

Is it possible that driver intended for P60 module (so simple on/off as UI) has hidden modes?

I built one that has a pseudo-hidden strobe... modes are 255, 255, 255, 255, STROBE, with no memory. Turning on/off or accidentally bumping the switch it pretends to not change modes, but you can get to the strobe if you need it.

Thanks comfychair. Yes, it is logical to make approach that way, I will probably end up with something like that. But here is a new idea:

If the modes in one setup are called a group of modes, how hard is to implement two groups? So group 1 would be low-medium-high but if we click (not click but tap or momentarily activate light without click) certain number of times it would change the whole group. Maybe fast clicks and it’s not low-medium-high any more but group 2 which is strobe-high, for example. Fast clicking 10 times goes back to low-medium-high.

Check out some of the other programs out there, including BLF-VLD and luxdrv. I can't remember but I think one of those has mode groups.