Attiny2313 20pu pwm variable duty cyclehelp please

Thread Starter


Joined Apr 4, 2014
I am new to pics . I have an Attiny2313 20pu to hand and would like to know how if it is possible to set it up for pwm variable output to be controlled with tactile switches or maybe a rotary encoder? If so, does anyone have the answer for how I can do this please? The application is a variable psu current and voltage control so I need two outputs at different voltages both with a user variable duty cycle 0 to 100%. As always, many thanks for reading my post :)


Joined Oct 2, 2009
ATtiny2313 is not a PIC.
PICs are made by Microchip.
ATtiny2313 are made by Atmel.

Yes. Any microcontroller (MCU) can be used to generate PWM.