Page 1 of 1
Attiny85 Timer0 and PWM
Posted: Mon Apr 28, 2025 3:24 pm
by Viktor74
Greetings all friends! Help me to understand the macro of pulse width modulation. I need the PWM to work at the specified time, but it seems to me that the timer is not working correctly. It switches very quickly, perhaps the divider is not working correctly. As a master oscillator, I use the RC of the on-chip oscillator at 1 MHz. Here is a small example to understand how to configure it correctly.
Re: Attiny85 Timer0 and PWM
Posted: Mon Apr 28, 2025 4:09 pm
by medelec35
Hello.
Have you set the configuration settings to run at 1MHz?
The First thing I would recommend is create a
one sec flash timer to check hardware is working as expected.
if the LED or port is toggling at the correct duration, then the PWM can be revisited.
Re: Attiny85 Timer0 and PWM
Posted: Tue Apr 29, 2025 10:36 am
by Viktor74
Hi Martin! Thank you very much! I'm a little confused in the simulator, it seems to work, but in practice I can't check it under a free licence, it doesn't compile.