PWM circuit design using CMOS (NMOS and PMOS)

Thread Starter

hcuma

Joined May 12, 2022
4
I'm working on an assignment to design a PWM circuit using NMOS, PMOS, Capacitors and resistances.

So far I have implemented the following schematic, Please anyone can help me with this? Any recommendations or references will be great.1653337664517.png

1653337618047.png
 

MrAl

Joined Jun 17, 2014
11,474
Hi,

So this is more or less a VCO (Voltage Controlled Oscillator)?

As long as you have adequate drive to the MOSFETs it should be ok. You need a decent drive high and decent drive low to get the transistors to switch fast.
To get the overall circuit (if you dont have it already that is) you can just design a comparator circuit with high gain, then go look up the LM339 comparator for a VCO circuit they are very simple. You can then wire up your transistors to mimic the way the LM339 circuit works.

If you need TRUE PWM then it may get a little more difficult. Usually you will need one input to be a triangular wave with the other is a voltage level that acts as a threashold. When the triangle wave exceeds the threshold (or goes under it) the pulse goes high, or goes low depending on the logical function you need (inverting or non inverting).

Not sure if they have a true PWM circuit for the LM339 in the app notes but if not we can draw one here i can find one or just draw something up it's quite simple. One of the things you will have to design is a triangle wave generator of fixed frequency using your CMOS transistors.

I once made a JK Master/Slave flip flop out of a LM339 package by looking up a TTL JK Master/Slave flip flop internal diagram. That's a pretty complicated flip flop because it requires several logic gates to get all the functionality.

Here is a block diagram. The triangle waves can be any of the three shown but a simple cap charging can work too with some limitations.
Have to check for stability when in a feedback circuit because the triangles cause a slight delay when there is a change in output could end up looking like a RHP pole.
Vset could go to a potentiometer voltage divider for testing.

PWM_BlockDiagram-1.png
 
Last edited:

Thread Starter

hcuma

Joined May 12, 2022
4
Hi,

So this is more or less a VCO (Voltage Controlled Oscillator)?

As long as you have adequate drive to the MOSFETs it should be ok. You need a decent drive high and decent drive low to get the transistors to switch fast.
To get the overall circuit (if you dont have it already that is) you can just design a comparator circuit with high gain, then go look up the LM339 comparator for a VCO circuit they are very simple. You can then wire up your transistors to mimic the way the LM339 circuit works.

If you need TRUE PWM then it may get a little more difficult. Usually you will need one input to be a triangular wave with the other is a voltage level that acts as a threashold. When the triangle wave exceeds the threshold (or goes under it) the pulse goes high, or goes low depending on the logical function you need (inverting or non inverting).

Not sure if they have a true PWM circuit for the LM339 in the app notes but if not we can draw one here i can find one or just draw something up it's quite simple. One of the things you will have to design is a triangle wave generator of fixed frequency using your CMOS transistors.

I once made a JK Master/Slave flip flop out of a LM339 package by looking up a TTL JK Master/Slave flip flop internal diagram. That's a pretty complicated flip flop because it requires several logic gates to get all the functionality.
Thank you a ton, that is really helpful... is there any way I can contact you for the assignment I'm working on it?
 

MrAl

Joined Jun 17, 2014
11,474
Thank you a ton, that is really helpful... is there any way I can contact you for the assignment I'm working on it?
Yes you can PM me but we dont like to hand out the entire solutions because this is the homework section. I'll help as much as possible but you should do a lot of thinking about how this might be done too. You want to learn not copy so you will be ready for the real world and get a darn good job.
 

Thread Starter

hcuma

Joined May 12, 2022
4
Yes you can PM me but we dont like to hand out the entire solutions because this is the homework section. I'll help as much as possible but you should do a lot of thinking about how this might be done too. You want to learn not copy so you will be ready for the real world and get a darn good job.
Thank you, definitely, I'm trying my best to do it. But at the same time, I'm coming from a different discipline and I'm not very familiar with CMOS design. Concerning the designing a PWM using CMOS, for now, I succeed in building the first block which is the comparator for the next step is to have a triangle wave can I do it using a Sawtooth wave? If so do you have a reference for a way to build "which components I should use"?

1653750843978.png
 

MrAl

Joined Jun 17, 2014
11,474
Thank you, definitely, I'm trying my best to do it. But at the same time, I'm coming from a different discipline and I'm not very familiar with CMOS design. Concerning the designing a PWM using CMOS, for now, I succeed in building the first block which is the comparator for the next step is to have a triangle wave can I do it using a Sawtooth wave? If so do you have a reference for a way to build "which components I should use"?

View attachment 268216
Hi,

Oh ok well if you managed to create a comparator, then just create another one and then maybe look at a square wave oscillator using an LM339 and use the capacitor voltage as the triangle.
If you want a true triangle, then you have to create a constant current source and have that charge the capacitor. That might not be needed though.

The LM339 as 'square wave oscillator' is just an oscillator that uses a resistor/capacitor where the cap charges and discharges repeatedly. That acts like a 'curved' triangle wave across the capacitor. That would be like the minimum type of triangle wave you could make.
There are other ways to do it too. Using op amps you can generate a triangle, but you would also have to create an op amp (similar to the comparator). That would take more parts but it would be a true triangle.

A secondary question comes up here. What kind of power supply are you allowed to use to power this. That is, what is the voltage or voltages?
 

Thread Starter

hcuma

Joined May 12, 2022
4
Hi,

Oh ok well if you managed to create a comparator, then just create another one and then maybe look at a square wave oscillator using an LM339 and use the capacitor voltage as the triangle.
If you want a true triangle, then you have to create a constant current source and have that charge the capacitor. That might not be needed though.

The LM339 as 'square wave oscillator' is just an oscillator that uses a resistor/capacitor where the cap charges and discharges repeatedly. That acts like a 'curved' triangle wave across the capacitor. That would be like the minimum type of triangle wave you could make.
There are other ways to do it too. Using op amps you can generate a triangle, but you would also have to create an op amp (similar to the comparator). That would take more parts but it would be a true triangle.

A secondary question comes up here. What kind of power supply are you allowed to use to power this. That is, what is the voltage or voltages?
Hi,

Thank you for your reply.

Well for LM339 we aren't allowed to use such a component we have to create it ourselves. So to create a signal generator that generates a Sawtooth would it serve the case to design PWM. Like in the figure below?
1653816462271.png


For the power supply, if you are refereing to power the transistors, we are allowed to use vdd=3.3v.


Thank you a lot!!!
 

MrAl

Joined Jun 17, 2014
11,474
Hi,

Thank you for your reply.

Well for LM339 we aren't allowed to use such a component we have to create it ourselves. So to create a signal generator that generates a Sawtooth would it serve the case to design PWM. Like in the figure below?
View attachment 268271


For the power supply, if you are refereing to power the transistors, we are allowed to use vdd=3.3v.


Thank you a lot!!!
Hi,

Yes i am aware that you can not use an LM339 or LM358 op amp. The suggestion was that if you create your own comparator and op amp out of the transistors, then you can look up app notes for those two parts to find out suggestions for circuits that can do what you need.
For example, the LM339 app notes contain a circuit for a VCO. If you needed a VCO, you could create a comparator like the LM339 and then find a circuit for a VCO in the LM339 app notes and use that as a guide to make the real circuit you need.
So you never use an actual LM339 or LM358, you just use the app notes for those two.

The app notes for the LM339 contain a square wave oscillator that uses a resistor and capacitor to get the timing, and the waveform across the capacitor is a pseudo triangle. If you need a better triangle, then you probably have to also create an op amp with the transistors then look for an app note that uses a comparator and op amp to generate a true triangle wave.
 
Top