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

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?

An Infineon ILD6070 driver. This is like any other buck driver that accepts a PWM signal, and doesn’t provide any type of feedback loop. It just does whatever the PWM signal tells it to do.

Did you try the suggestions I made to eliminate the flashing?

I put the digitalWrite(ledpin, 3) before the pin is set to output and there wasn’t any change. Still a blink before going to mode 2 (30%) and then no PWM output. Any other ideas?

You need to write the pin to 0 (low output)

Ok, I understand now. I tried that just now and no change.

sounds like it must be the hardware startup timer that other users have mentioned then