Need help with STAR firmware (or driver recommendation)

Did you get it working?

It’s a bit of a change, but if you don’t want PWM then you needn’t be worrying about 255 anyhow. Remove the PWM/timer related code and set the output pins connected to the 7135’s as high (on) or low (off) as needed. Sorry, I know your not a coder but that’s a cleaner way to do it.

I’m on my phone at the moment or otherwise I’d try to be of more assistance. I can try cooking something up later.

I’m still trying. It still doesn’t work.
I used to try to play around with Arduino but this is quite different.
And it was a long time ago :confused:

Could you send a link to which driver you’re using? I’ll see if I can throw something together real quick.

My current list of questions…

  • Which driver? (for layout purposes)
  • Memory or no?
  • Turbo timer to drop from high to low? If so, after how much time?

Feel free to PM if you’d rather discuss there.

Nanjg with cutted trace to the side amc which is connected to the fifth pin of attiny.
No memory by default. Can be configurable via star-gnd.
No turbo timer.
LVP

Something like that?

I have had similar questions as you

This is the problem with this firmware, and I need an even simpler option - switching between two channels. That’s all.
Probably trivial for every coder. They are wizards imho.

CVP, whenever I start working with a new board, I usually try the most simple code as possible to make sure that the hardware is working as expected. Once you know the hardware is functional, then I move onto the “real” code. The program below should be about as basic as it gets for your board. It rotates through the low channel, the high channel, and then both (pausing 3 seconds after each change). Could you confirm this works on your board?

This program changes modes (channels) every three seconds. Only Lo (first channel) and Med (second channel), but according to your comments it should be Lo (first channel) > Med (second channel) > Hi (both channels).
After inserting these two lines into the comment:

PORTB = (1 << LED_HIGH_PIN); // High channel on
_delay_ms(3000); // wait 3 seconds

the program jumps between Lo (first channel) > Hi (both channels)

These two lines seems needles, because I only need first channel and both channels.

Ok, that was just a test to make sure each channel worked independently. It actually worked though, right?

Now that I know that control method is working with your board, I can try helping out with the STAR code. :+1:

Alright… I’ve compiled this, but haven’t tested it at all on an actual driver (so good luck!). Feel free to give it a shot and let me know how it goes.

Works great! Just one question. If I want to turn on the turbo timer, I have to connect star3 with gnd. Then the default is 2 minutes. How can I set it to 5 minutes?
I know I need to change #define TICKS_250MS to a larger value, but what is max? 250ms is a quarter of a second, and for 5 minutes 1.25 is needed. How to make it work? 1250?

In the original STAR code there is a note at #define TICKS_250MS:
Affects mode saving and turbo timeout / rampdown timing

There are two things influencing the turbo timer: the TURBO_TIMEOUT setting (240 ticks) and the Watch Dog Timer (“WDT”) prescaler. By default in the firmware, the WDT is set to interrupt every 500 ms (bits WDP2 and WDP0). If you want something longer, the easiest thing is to probably change these flags. If you added WDP1 (in addition to WDP2 and WDP0), the WDT would fire off every 2 seconds instead of 0.5 seconds. 5 minutes = 300 seconds. If WDT fires every 2 seconds, set your TURBO_TIMEOUT to 300 / 2 = 150.

In summary, to obtain a 5 minute turbo timeout:

  • Change TURBO_TIMEOUT to 150
  • In WDT_on(),
    replace WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP0);

    with WDTCR = (1<<WDTIE) | (1<<WDP2) | (1<<WDP1) | (1<<WDP0);

PS - you don’t need to worry about what the original code says about WDT affecting the mode switching. I replaced ontime memory with our “noinit” trick

Also, yes… There are other ways. But as it is defined, the turbo timer variable is a uint8_t (1 byte) so it’s maximum value is 255. You could make it a bigger variable (like a uint16_t) and then set the value to something higher. More than one way to skin a cat, as they say. I think my earlier proposed change is probably the most efficient/flexible.

Thank you for the very simple explanation. The changes seem small, but I would rather not do it myself.

Ok. I’ll try to get an updated version uploaded tomorrow. Any other change requests? :wink:

Updated? That’s all I need.

Code updated. Same link

Works great. Thank you for your help and your time.

Thanks for letting me know! Glad it worked out :+1: