Phase Correct PWM

It seems for our application the PWM-mode, fast or phase-correct, doesn’t matter. What matters is the resulting frequency. Low frequencies flicker visibly, medium frequencies produce an audible whine and high frequencies drop out of regulations pretty fast.

It is just important to know, that with an ATtiny13A you can’t reach every frequency with both PWM versions. Some you can, some only with fast or phase correct PWM:

PhaseCorrect FastPWM
kHz CPU freq divider fuse CPU freq divider fuse
1.2 kHz 4.8 MHz :8 0x65
2.4 kHz 9.6 MHz :8 0x6a 4.8 MHz :8 0x65
4.7 kHz - - - 9.6 MHz :8 0x6a
9.4 kHz 4.8 MHz :1 0x75 - - -
19 kHz 9.6 MHz :1 0x7a 4.8 MHz :1 0x75

CPU freq is set by the fuse (Low Fuse bit 0 and 1) and “#define F_CPU” should be set accordingly.
PWM is set by “TCCR0A = 0x23”, where 0x23 is FastPWM and 0x21 is PhaseCorrectPWM
The divider is set by the fuse (Low Fuse, bit 4) and can be :1 or :8

In the STAR Firmware thread of RMM/JohnnyC this had been adressed, just look some posts up and/or down to find more about the topic by others.

~4.7 and ~9.4 kHz both produce an audible whine, so the PWM version doesn’t help here.

The ~19kHz frequency can be reached with both and I tested both in lights and couldn’t tell (see or hear) any difference in practical use. Both are silent and similarly bright.
The downside of this high frequency is, that the driver drops out of regulation even in low modes pretty fast, HKJ showed this when he tested the Qlite driver. Perhaps one of the 2 PWM-versions would be better than the other in this department, I simply don’t know.
Or perhaps our FET-driver developers here found differences between the PWM-versions and could chime in, if that’s the case.