Creating A PWM (Pulse Width Modulator) generator using Statemachine?

Thread Starter

hwing91

Joined Feb 19, 2011
1
Hey, so I'm attempting to create a PWM generator using a state machine.
I've only barely started to think about how i should approach this, but here's what i've thought out.

Based on three inputs, lets define them as S2/S1/S0, it produces duty cycles in increments of 12.5%, from 0% - 87.%, such as 000 = 0%, 001 = 12.5%, 010 = 25%, so on and so forth till 111 = 87.5%.

I've quickly made a truth table but im not sure if thats the best way to approach it.

Someone else advised me to use a 3-but up counter, such as in this picture
http://forum.allaboutcircuits.com/attachment.php?attachmentid=74&d=1098880662

Seeing it makes it look do-able, but afterwards, im not quite sure how to actually limit the duty cycles from outputs D7-D0?
 
Top