I want to design a digital circuit to generate PWM signals from 8 bit digital value of analog input

Thread Starter

Trik369

Joined May 24, 2023
2
Hello,I am a beginner to electronics and after researching in internet I came to know that we should use comparator and counter to do the same and I tried to do the same using logic gates and flip flops.But I guess it is not working properly.So I request anyone to help me by identifying the mistake in circuit and how to rectify it.I have attached it below.Thank youScreenshot 2023-05-24 135119.jpg
 

ronsimpson

Joined Oct 7, 2019
3,052
I can not see details.
It looks like there is a ADC that reads the pot and output a 8 bit number. Is that working?
Looks like there is a 8 bit counter. Is that working?

I think you are getting a pulse of 1/256 every time there is a compare. Are you getting a very short pulse on the output?

I would put a SetReset FF at the output. The compart signal resets the FF. Look at the counter and make a circuit that has a output when the counter reaches FF or 00 and that drives the sets the FF.
 

Thread Starter

Trik369

Joined May 24, 2023
2
Thank you very much for replying to my message @ronsimpson .I guess both ADC and 8 bit counter is working .When I simulate,it is on for some long time and off for some time and same again.I guess it is not like pulse.I can send you the proteus file if u have proteus installed in your system so that you can simulate and correct me.Thanks
 

BobTPH

Joined Jun 5, 2013
9,003
It would be far simpler to generate the PWM directly from the analog input.

Assume the input is 0-10V.

Generate a ramp from 0 to 10 V and the PWM out is just an analog comparator of the input to the ramp., i.e. the output is high whenever the input is greater than the ramp.
 
Top