PWM Modes?

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I have a pic that has ECCP.

In PWM mode there can be 4 modes.

• Single PWM mode
• Half-Bridge PWM mode
• Full-Bridge PWM, Forward mode
• Full-Bridge PWM, Reverse mode

What are the differences between these modes/

There appears to be a timing chart but I am not sure I am following it.

upload_2017-10-15_21-46-0.png
 

OBW0549

Joined Mar 2, 2015
3,566
I've never done motor control with the PIC or used the ECCP, but I did find something on the Microchip Developer Help web site that looks like it might have the answer to your questions: 8-Bit ECCP Enhanced Pulse Width Modulation.

Hope this helps a bit. It has detailed explanations of the ECCP modes, with circuit diagrams.
 

MaxHeadRoom

Joined Jul 18, 2013
30,654
The output they use is useful when using something like the IR2110 etc charge pump, if you notice, each of the direction signals for each direction has one full on and the other modulated via PWM, in this case you drive the low side of an H-bridge with the full on signal and the modulated signal goes to the high (charge pump) input.
For example in the DWG in #3, the A would be the PWM signal and D would be full on, etc
The OP chart shows the three mode options.
Tahmid's blog: Using the high-low side driver IR2110 - explanation and plenty of example circuits
Max.
 

GopherT

Joined Nov 23, 2012
8,009
Sorry but I understand this less than the datasheet. ;)
Can you post what you are trying to do, then we can guid you which mode to pick.

Single Output
Example: controlling brightness of an LED (or the speed of a simple motor)

Half bridge
Example: beeping a speaker with a push/pull n-channel and pchannel mosfet pair. To turn on the P-channel, an NPN is actually the driver (to both invert and adjust for voltage level of motor supply). The delay time insures there is no shoot-through of the push-pull). This is only a hypothetical example but gives good visualization. It works but you have to really slow down the CORE speed to make your PWM an audible frequency OR, use very high frequency Oscillator and modulate the PWM duty cycle at audible frequencies to create audible tones.

Full Bridge
A very convenient method to drive a brushed DC motor. It can drive the motor (center resistor) in forward or revers direction. Note that only the lower N-channel is modulated and the high side is simply enabled. It would not a good idea to apply PWM to the high and low side in this mode because there is no delay, and not necessary to switch both - so they just don’t let you.

The Full bridge is reversed by simply changing the two setup bits to Full Bridge Reverse mode.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Just trying to generate a virtual voltage level right now to drive 3 -4 analog meters. I am at work right now so I don't have the datasheet in front of me nor can remember the chip but I am going to need at least 3 independent outputs.

I think I will need singe output but I need to be certain I have 4 independent outputs. The datashheet seems to suggest there are four on ECCP but not sure if they mean 4 independent or not.
 

MaxHeadRoom

Joined Jul 18, 2013
30,654
What Micro are you using?
Generally refers to one module with 4 registers 4 modes and 4 outputs for the one module.
Max.
 
Last edited:

GopherT

Joined Nov 23, 2012
8,009
Just trying to generate a virtual voltage level right now to drive 3 -4 analog meters. I am at work right now so I don't have the datasheet in front of me nor can remember the chip but I am going to need at least 3 independent outputs.

I think I will need singe output but I need to be certain I have 4 independent outputs. The datashheet seems to suggest there are four on ECCP but not sure if they mean 4 independent or not.
Just avoid the headache and get a chip with 4 DAC pins (if that supports your application).

16F1779 has 4 separate simple PWM channels and 4 DAC channels so you can try both options.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Just avoid the headache and get a chip with 4 DAC pins (if that supports your application).

16F1779 has 4 separate simple PWM channels and 4 DAC channels so you can try both options.
Mine might. I am not sure. I need to dig into the datasheet.
 

Papabravo

Joined Feb 24, 2006
22,082
Just trying to generate a virtual voltage level right now to drive 3 -4 analog meters. I am at work right now so I don't have the datasheet in front of me nor can remember the chip but I am going to need at least 3 independent outputs.

I think I will need singe output but I need to be certain I have 4 independent outputs. The datashheet seems to suggest there are four on ECCP but not sure if they mean 4 independent or not.
You can use a PWM in single output mode to make crude DAC. Just run the output to a low pass filter eg. an R and a C and the output voltage will be the average of the PWM output.
 
Top