STAR Firmware by JonnyC - Source Code and Explanation

Except, of course, breaking the core design concept of STAR. It’s designed to be configurable at run-time (via soldered stars) instead of compile-time. This costs a lot of space, but makes drivers end-user configurable.

However, I’ve found two things which definitely can be reduced in STAR off-time. It doesn’t actually need to set up or use the WDT interrupt. That part of the code can be removed and replaced with a small bit of logic in the main loop. It also can be made smaller by replacing the stock _delay_ms() with a custom one. These are the first two things I figured I’d try before attempting to add medium-press and battery check to it.

It will be interesting to see if 105c supplies dry up, or if they will be kept in production.

Several people, including myself, have been sent the 105d’s, which don’t have the stars.

Because I can flash drivers now, the stars don’t matter as much to me, but for the average person buying a 105C with standard or custom firmware on it they are kind of nice to have. Of course, programmable drivers, programmed via the input switch would eliminate the need for stars and allow for even more changes on the fly.

Yeah, your right about that. I’m just the kind of guy that programs in a moon mode if I want it, and leave it out if I don’t. I don’t use stars for any kind of mode configurations, only use them for off time caps, inputs and outputs.

Also true, but you’d have to re-program the turbo timeout because it’s currently counting WDT ticks.

Yep, I suggested that quite a lot of pages ago in this thread. I’ve found that the stock _delay_ms() is not so bad, but gets bad if you pass values above 255 into it, forcing it to deal with doubles. My delay routine has a lower resolution so all my delaying needs are under 255 and therefor only needs integers. That keeps memory usage down a bit.

It doesn’t really matter right now, but a “double” in C is a float with twice the default resolution. Integers above 255 are still integers, they’re just 16 bits instead of 8. Technically, it would be called a dword, or double-word, since the word size on the attiny13a is 8 bits.

For portability, people usually avoid using “words” because the size varies per architecture, choosing explicit bit sizes instead. But words are handy for speed optimization, since they typically are the fastest for most operations.

Interesting… from that last post all you comment with is an in depth explanation of my incorrect terminology. Oh well, I guess it’s good that everyone is different, the world would be a boring place otherwise :beer:

Did they stumble with the offtime timeout, or the fact that it’s a forward clicky with an offtime firmware?

Both! It was mildly depressing.

I’ve seen both problems when demonstrating flashlights to various people so that’s no surprise. The one-button interface thing is a whole new world. There are some great aspects to FWD clickies, being a good introduction to multi-mode lights is not on the list IMO.

As far as the rest (the whole timing issue with half presses), I’m really curious how much better / worse a momentary firmware would be.

EDIT: to clarify, I meant to say… don’t let it get you down. As I mentioned above, it’s a whole new world for many people: it shouldn’t reflect one way or another on your parents and it doesn’t really say anything about the viability of a flashlight business for you either. Just let this experience advise you on how important it will be to gently introduce neophytes. Picking up a one-button-interface device like a FWD or reverse clicky flashlight and learning to use it is akin to getting on a bicycle for the first time. It’s a desirable product but you do have to learn how to use it! I haven’t spent a lot of time on it, but I really haven’t seen a simple way to quickly get someone who’s totally unfamiliar with the concept up to speed.

That’s what I’m here for. :stuck_out_tongue_winking_eye:

Especially with Zebralights. Nice UI, but genuinely too complicated for a lot of people. I can’t hand a Zebralight to a muggle and expect them not to fail… they’ll generally click the button, turn it on in turbo, hurt their eyes (or someone else’s), click it again in an attempt to shut it off (taking it down to medium), then rapidly click until it starts blinking… and then hand it back to me with a negative comment like “that thing is booby-trapped!”.

Alternately, they might wait just long enough after the initial blast before they start fast-clicking, which makes it toggle between turbo and high.

So, probably a good idea to at least try to make UIs somewhat muggle-friendly… i.e. don’t do anything particularly surprising on single-press-from-off.

I stay with the convention that a WORD is always unsigned 16 bits, DWORD unsigned 32 bits, BYTE unsigned 8 bits. Most C/C++ compilers don't natively support WORD and DWORD, so I usually assign them in a common header. I've worked several times with binary data import/export or comm/dual port interfaces between processors, and it can be a nightmare if you don't have a rigorous set of standard formats. Mixing big Endian (Motorola, etc.) and little Endian (Intel, etc.) is even worse with byte ordering all messed up. In theory the WORD does depend on the processor. The int I make no assumptions on it's size, but guaranteed it's always signed. Some processors it gets debatable what it's WORD size really is. Some do BYTE addressing but have 16 bit registers, or have a mix of 16 bit and 32 bit registers, etc. Usually it's based on memory access or the accumulator size, but that can get complicated too, with different modes.

I've been working on micros as far back as the Intel 8080, Motorola 6800 back when CP/M was the latest. I bought the original IBM PC for $3,500 back in '81 or so, just to play/learn - did a few mod/upgrades on it of course Wink. Actually I still support products using the 68331, which is a variant of the 68000, and also still support 8051 variants.

Yea, thanks for the encouragement wight. I think with a proper 30 second instructional video demonstration it will be easy for the average person. I’ll incorporate it into my product video.

I think they'll stick around for a while, but you may not be able to get them from FT anymore (who seems to get them from Convoy).

Kind of OT: Any thoughts on running an XM-L2 via Qlite from 3x nimh? I haven’t done extensive testing yet but I’m wondering if it’s just not going to be enough voltage. I may end up going strictly 2x 26650 (1s2p) for my mag upgrade kit.

OL has commented on it a couple of times I think. Sounds like 3xNiMH just isn’t enough. 4x is good though, so if you don’t mind doing a quick boring operation to each host…

I haven’t tried it, but I’ve been meaning to. I expect to find that OL is exactly right, so I’m not sure what I’ll do then. Use old XM-L emitters maybe? Or for mag builds the 3xNiMH, XHP50, and a DQG 26650 boost driver might be OK.

Just to be sure, the download link in the OP has the most recent versions, correct?

Yes, it now links directly to the repository.

I’m struggling with how to properly set the dual-pwm output.

Is there a post that details how to set it up? I can’t find it…….

I would want to use the dual pwm for a FET + 7135 driver. Ideally I would want the moonlight and low (maybe also medium?) to use the 7135.

The the STAR firmware I am seeing the dual pwm based on the pwm rate, but how would I turn on the 7135 with no pwm, while keeping the FET off still?

Without making changes to the code, with the clicky version you can't turn the 7135 on to 100% (which is what would be needed for no PWM) and leave the secondary FET output off. With the momentary version it is easy to do that.

What confuses me is that you're talking about two completely different things. At first you're talking about moonlight and low (maybe also medium), then in the next sentence you're talking about turning on the 7135 with no PWM while keeping the FET off.

For the clicky you just set your modes, as normal, then set the threshold PWM level to where you want the secondary output to turn on.

Well I know the moonlight/low would be using pwm, but it would be nice to set the 7135 to on with no pwm as medium.