I'm willing to pay $200 (not commercial)

What compile errors?

Arduino: 1.8.10 (Windows 10), Board: “ATtiny25/45/85, ATtiny25, Internal 1 MHz”

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

tk-attiny.h:11:5: error: redefinition of ‘int mode1’

int mode1 = 255;

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:11:5: note: ‘int mode1’ previously defined here

int mode1 = 255;

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

tk-attiny.h:12:5: error: redefinition of ‘int mode2’

int mode2 = 8;

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:12:5: note: ‘int mode2’ previously defined here

int mode2 = 8;

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

tk-attiny.h:15:11: error: redefinition of ‘const int ledPin’

const int ledPin = 0; // setting LED pin

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:15:11: note: ‘const int ledPin’ previously defined here

const int ledPin = 0; // setting LED pin

^~

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

tk-attiny.h:17:54: error: redefinition of ‘unsigned int key’

unsigned int key attribute ((section (“.noinit”)));

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:17:14: note: ‘unsigned int key’ previously declared here

unsigned int key attribute ((section (“.noinit”)));

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

tk-attiny.h:19:55: error: redefinition of ‘unsigned int mode’

unsigned int mode attribute ((section (“.noinit”)));

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:19:14: note: ‘unsigned int mode’ previously declared here

unsigned int mode attribute ((section (“.noinit”)));

^~

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘void setup()’:

tk-attiny.h:21:6: error: redefinition of ‘void setup()’

void setup() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:21:6: note: ‘void setup()’ previously defined here

void setup() {

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘int modeone()’:

tk-attiny.h:38:5: error: redefinition of ‘int modeone()’

int modeone() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:38:5: note: ‘int modeone()’ previously defined here

int modeone() {

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘int modetwo()’:

tk-attiny.h:43:5: error: redefinition of ‘int modetwo()’

int modetwo() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:43:5: note: ‘int modetwo()’ previously defined here

int modetwo() {

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘int modethree()’:

tk-attiny.h:48:5: error: redefinition of ‘int modethree()’

int modethree() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:48:5: note: ‘int modethree()’ previously defined here

int modethree() {

^

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘void loop()’:

tk-attiny.h:56:6: error: redefinition of ‘void loop()’

void loop() {

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:56:6: note: ‘void loop()’ previously defined here

void loop() {

^~

In file included from sketch\tk-delay.h:24:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:164:

sketch\tk-attiny.h: In function ‘void system_sleep()’:

tk-attiny.h:74:6: error: redefinition of ‘void system_sleep()’

void system_sleep() {

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:74:6: note: ‘void system_sleep()’ previously defined here

void system_sleep() {

^~

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:30:0,

from sketch\sketch_jan21a.ino.cpp:1:

sketch\tk-attiny.h: In function ‘void __vector_2()’:

tk-attiny.h:81:5: error: redefinition of ‘void __vector_2()’

ISR (PCINT0_vect) {

^

sketch\tk-attiny.h:81:5: note: ‘void __vector_2()’ previously defined here

ISR (PCINT0_vect) {

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: At global scope:

tk-attiny.h:11:5: error: redefinition of ‘int mode1’

int mode1 = 255;

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:11:5: note: ‘int mode1’ previously defined here

int mode1 = 255;

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

tk-attiny.h:12:5: error: redefinition of ‘int mode2’

int mode2 = 8;

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:12:5: note: ‘int mode2’ previously defined here

int mode2 = 8;

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

tk-attiny.h:15:11: error: redefinition of ‘const int ledPin’

const int ledPin = 0; // setting LED pin

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:15:11: note: ‘const int ledPin’ previously defined here

const int ledPin = 0; // setting LED pin

^~

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

tk-attiny.h:17:54: error: redefinition of ‘unsigned int key’

unsigned int key attribute ((section (“.noinit”)));

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:17:14: note: ‘unsigned int key’ previously declared here

unsigned int key attribute ((section (“.noinit”)));

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

tk-attiny.h:19:55: error: redefinition of ‘unsigned int mode’

unsigned int mode attribute ((section (“.noinit”)));

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:19:14: note: ‘unsigned int mode’ previously declared here

unsigned int mode attribute ((section (“.noinit”)));

^~

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘void setup()’:

tk-attiny.h:21:6: error: redefinition of ‘void setup()’

void setup() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:21:6: note: ‘void setup()’ previously defined here

void setup() {

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘int modeone()’:

tk-attiny.h:38:5: error: redefinition of ‘int modeone()’

int modeone() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:38:5: note: ‘int modeone()’ previously defined here

int modeone() {

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘int modetwo()’:

tk-attiny.h:43:5: error: redefinition of ‘int modetwo()’

int modetwo() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:43:5: note: ‘int modetwo()’ previously defined here

int modetwo() {

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘int modethree()’:

tk-attiny.h:48:5: error: redefinition of ‘int modethree()’

int modethree() {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:48:5: note: ‘int modethree()’ previously defined here

int modethree() {

^

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘void loop()’:

tk-attiny.h:56:6: error: redefinition of ‘void loop()’

void loop() {

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:56:6: note: ‘void loop()’ previously defined here

void loop() {

^~

In file included from sketch\tk-voltage.h:23:0,

from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:

sketch\tk-attiny.h: In function ‘void system_sleep()’:

tk-attiny.h:74:6: error: redefinition of ‘void system_sleep()’

void system_sleep() {

^~

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:58:0:

sketch\tk-attiny.h:74:6: note: ‘void system_sleep()’ previously defined here

void system_sleep() {

^~

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:30:0,

from sketch\sketch_jan21a.ino.cpp:1:

sketch\tk-attiny.h: In function ‘void __vector_2()’:

tk-attiny.h:81:5: error: redefinition of ‘void __vector_2()’

ISR (PCINT0_vect) {

^

sketch\tk-attiny.h:81:5: note: ‘void __vector_2()’ previously defined here

ISR (PCINT0_vect) {

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:0:

sketch\tk-voltage.h: In function ‘void ADC_on_temperature()’:

sketch\tk-voltage.h:42:20: error: ‘V_REF’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | TEMP_CHANNEL;

^

sketch\tk-voltage.h:42:44: error: ‘TEMP_CHANNEL’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | TEMP_CHANNEL;

^~

sketch\tk-voltage.h:47:44: error: ‘ADC_PRSCL’ was not declared in this scope

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

sketch\tk-voltage.h:47:44: note: suggested alternative: ‘ADC_CRIT’

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

ADC_CRIT

sketch\tk-voltage.h: In function ‘void ADC_on()’:

sketch\tk-voltage.h:55:20: error: ‘ADC_DIDR’ was not declared in this scope

DIDR0 |= (1 << ADC_DIDR);

^~

sketch\tk-voltage.h:55:20: note: suggested alternative: ‘ADC_on’

DIDR0 |= (1 << ADC_DIDR);

^~

ADC_on

sketch\tk-voltage.h:57:20: error: ‘V_REF’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | ADC_CHANNEL;

^

sketch\tk-voltage.h:57:44: error: ‘ADC_CHANNEL’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | ADC_CHANNEL;

^

sketch\tk-voltage.h:59:44: error: ‘ADC_PRSCL’ was not declared in this scope

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

sketch\tk-voltage.h:59:44: note: suggested alternative: ‘ADC_CRIT’

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

ADC_CRIT

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘void save_mode()’:

sketch_jan21a:234:27: error: ‘EEPSIZE’ was not declared in this scope

eepos = (eepos+1) & ((EEPSIZE/2)–1); // wear leveling, use next cell

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:234:27: note: suggested alternative: ‘EEPE’

eepos = (eepos+1) & ((EEPSIZE/2)–1); // wear leveling, use next cell

^

EEPE

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘void save_state()’:

sketch_jan21a:240:24: error: ‘EEPSIZE’ was not declared in this scope

#define OPT_firstboot (EEPSIZE-1)

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:251:34: note: in expansion of macro ‘OPT_firstboot’

eeprom_write_byte((uint8_t *)OPT_firstboot, firstboot);

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:240:24: note: suggested alternative: ‘EEPE’

#define OPT_firstboot (EEPSIZE-1)

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:251:34: note: in expansion of macro ‘OPT_firstboot’

eeprom_write_byte((uint8_t *)OPT_firstboot, firstboot);

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘void restore_state()’:

sketch_jan21a:240:24: error: ‘EEPSIZE’ was not declared in this scope

#define OPT_firstboot (EEPSIZE-1)

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:270:39: note: in expansion of macro ‘OPT_firstboot’

eep = eeprom_read_byte((uint8_t *)OPT_firstboot);

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:240:24: note: suggested alternative: ‘EEPE’

#define OPT_firstboot (EEPSIZE-1)

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:270:39: note: in expansion of macro ‘OPT_firstboot’

eep = eeprom_read_byte((uint8_t *)OPT_firstboot);

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘void set_output(uint8_t, uint8_t, uint8_t)’:

sketch_jan21a:406:5: error: ‘FET_PWM_LVL’ was not declared in this scope

FET_PWM_LVL = pwm1;

^

sketch_jan21a:407:5: error: ‘PWM_LVL’ was not declared in this scope

PWM_LVL = pwm2;

^

sketch_jan21a:408:5: error: ‘ALT_PWM_LVL’ was not declared in this scope

ALT_PWM_LVL = pwm3;

^

In file included from C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:166:0:

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘uint8_t read_adc_8bit()’:

sketch\tk-voltage.h:31:25: error: redefinition of ‘uint8_t read_adc_8bit()’

#define get_temperature read_adc_8bit

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:482:9: note: in expansion of macro ‘get_temperature’

uint8_t get_temperature() {

^

sketch\tk-voltage.h:70:9: note: ‘uint8_t read_adc_8bit()’ previously defined here

uint8_t read_adc_8bit() {

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘uint8_t read_otc()’:

sketch_jan21a:501:20: error: ‘CAP_DIDR’ was not declared in this scope

DIDR0 |= (1 << CAP_DIDR);

^~

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:501:20: note: suggested alternative: ‘CAP_MED’

DIDR0 |= (1 << CAP_DIDR);

^~

CAP_MED

sketch_jan21a:503:20: error: ‘V_REF’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | CAP_CHANNEL;

^

sketch_jan21a:503:44: error: ‘CAP_CHANNEL’ was not declared in this scope

ADMUX = (1 << V_REF) | (1 << ADLAR) | CAP_CHANNEL;

^

sketch_jan21a:505:44: error: ‘ADC_PRSCL’ was not declared in this scope

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:505:44: note: suggested alternative: ‘ADC_CRIT’

ADCSRA = (1 << ADEN ) | (1 << ADSC ) | ADC_PRSCL;

^

ADC_CRIT

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino: In function ‘int main()’:

sketch_jan21a:524:20: error: ‘CAP_PIN’ was not declared in this scope

DDRB |= (1 << CAP_PIN); // Output

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:524:20: note: suggested alternative: ‘CAP_MED’

DDRB |= (1 << CAP_PIN); // Output

^

CAP_MED

sketch_jan21a:528:19: error: ‘PWM_PIN’ was not declared in this scope

DDRB |= (1 << PWM_PIN); // enable main channel

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:528:19: note: suggested alternative: ‘M_PI’

DDRB |= (1 << PWM_PIN); // enable main channel

^

M_PI

sketch_jan21a:529:19: error: ‘ALT_PWM_PIN’ was not declared in this scope

DDRB |= (1 << ALT_PWM_PIN); // enable second channel

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:529:19: note: suggested alternative: ‘NOT_A_PIN’

DDRB |= (1 << ALT_PWM_PIN); // enable second channel

^

NOT_A_PIN

sketch_jan21a:532:19: error: ‘FET_PWM_PIN’ was not declared in this scope

DDRB |= (1 << FET_PWM_PIN); // enable third channel (DDB4)

^

C:\Users\pops\Documents\Arduino\sketch_jan21a\sketch_jan21a.ino:532:19: note: suggested alternative: ‘NOT_A_PIN’

DDRB |= (1 << FET_PWM_PIN); // enable third channel (DDB4)

^

NOT_A_PIN

exit status 1
redefinition of ‘int mode1’

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

That does not appear to be generated from the file I posted

You are right, had too many files open and I selected the wrong one. I’ll test when I get more chips tomorrow. Thanks

with the right fuse setting you should not brick any chips

I had bricked chips when the leads from programmer to the clip were too long

Ok I think the firmware is now working fairly consistently. Just an odd flash of light between mode changes, but I think I can live with that. Tterev3 provided the firmware that resulted in the direct solution I was after, so he is the winner, just send me a PM with your paypal email and I’ll send over the promised $200.

Thanks everybody.

On a side note, there is a small error on the PCB, where the PWM should be going to PIN0, but it’s going to PIN3, (PB3). Attiny25 doesn’t have PWM on this pin, but ATTiny85 does. Is there any quick adjustment to this firmware that could be made to allow me to get the LED PWM over to Pin3, to save me from having another batch of PCBs made?

I’ve heard that if you load an updated core in arduino, it will allow PWM on pin 3 on the ATTINy, wondering if anyone has a quick way to get this done?

Thanks!

Received the payment, thank you! I suspect that arduino is running software pwm to get it on a pin that doesn’t have the hardware. I can put together an example of this you could use

That would be great. Thanks!

On 99% of the drivers with Attiny25 I have flashed pin3 is used for PWM (MOSFET with a slightly different PWM timing), standard Bistro and later Bistro HD OTSM allows that
any triple channel driver uses Pin 3 for PWM output
I have even run Bistro on Attiny85s with no further change in code

you have also to note that on each MCU the voltage readout can differ a bit up to 0.2V,
in OTSM you can correct that in the voltage fudge factor setting

You can create like +/-0.1 and 0.2V hex, testing each driver and if necessary re flash with the correct offset

This indicates something is wrong, between the mode cycles, I have seen that on OTSM from turbo to moon but not sure if its hardware or software related
between any mode change you should have a constant off directly getting you a stable output on next mode

I don’t understand why you are not flashing with an USBASP adapter or the original AVR one, they work well and are reliable, the AVR gives you 100% compatibility
they can be easily configured in the Atmel Studio to enable flash with a single mouse click

What is on the receiving end of the PWM? I haven’t seen any schematics on that. One thing you could try if it’s possible to fit, a pull down resistor on mosfet/regulator gate to GND. Some regulators I use can flash a little when they receive power, just before the MCU has had time to pull the pin to low. Only thing that can be done in software is to set the pin as output and to low the very first thing you do, but in my case that is not enough, I need pull down / gate resistors. I use 10k ohm.

OTSM does not power down the MCU during offtime, but the firmware might switch the FET output down as you say after leaving the standby mode when battery power is restored
I have 100k pulldown on the FET

I know that, but OP is not using OTSM so this doesn’t help.

I’m not an expert with these particular avr parts but it shoulds like from others’ replies that it should have pwm hardware on pin 3. Does it work if you just change the definition of ledPin to 3?

Also my guess about the blip during changes is probably because the pin is set to output and then not written with a pwm value until several steps later. Arduino adds a lot of overhead that will slow down functions like that and make it take enough time for you to see the flash. You could try adding a digitalWrite(ledpin, 0) immediately before the pin is set to output. If the compiler or hardware has any issue with setting the output latch before you make it an output, you could still try writing it low immediately after setting it to output to at least shorten the flash.

Also, the default startup time fuse is set to +64 ms on the 25/45/85. I have no idea what Arduino does with these fuses though. The 3217 I’m using also ships with +64 ms settling time set as default. I always change it to 0, I see no use of the delayed startup time for flashlight usage.

Is there a resource you point me to so I can figure out how to do this?

Same here, is there a resource? I tried using the default fuses for the Bistro for my code, and it just bricked chips. Not sure what to set for the startup time.

Thanks!

Here is a good thread: Guide: how to flash ATtiny13a based drivers (NANJG, QLITE, etc.) with custom firmware
I made a post in another thread after flashing my first driver (photo link is broken): what programmer to buy - #10 by Mike_C
Here is some info on fuses: AVR Tutorial - Fuses
Here is a fuse calculator for the old MCUs like 13a, 25 and 85: AVR® Fuse Calculator – The Engbedded Blog

I’ve changed the code to output the LED on PB3, and it almost works. It goes to mode 1 (High power 100% on), then flashes briefly to mode 2 for maybe 0.1 seconds and turns off, then goes to the flashing mode.

This same flash is what I described before. I don’t think its due to a lack of a pulldown resistor because it seems to only flash at mode 2. Is there something in tterev3’s code that could be causing this? I tried it on both a Attiny25 and Attiny85 with identical results. When I swap PWM back over to PIN0, it will go to all 3 modes but flashes briefly as it goes into mode 2.

Any ideas?

What’s on the receiving end of the pwm signal?