Hello All
So, I have a PWM on channel 1 on the dsPIC30F3011. This gives a next signal. However when I take a scope to the other PWM channels (even though they are disabled) I get a scalled mirror of the signal. The IC works from 5V and the PWM coming out of the disabled PWM is around 120mV (see pic).
This seems to cause a slight glitch on the output of a mosfet driver.
I get the measurement on using either the 1x of 10x setitng on the probe, I am usiong the normal 150mm long GND clip placed on one of the bypass capacitor GND's. I have 3 ceramic bypass caps 1uF. 0.1uF & 0.01uF.
PS - Another thing I have noted on a couple of project shen using hte PWM's. When you set the PWM duty cycle to 0 (on either 8 or 10bit) I still get a very slight positive pulse. Any reason for this? I will catch it on te scope next time.
PWM on one channel also shown on disabled channels
Moderator: Benj
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: PWM on one channel also shown on disabled channels
Maybe try a pull down resistor on the MOSFET gate.
Would need to check device datasheet to see if zero duty is possible.
Would need to check device datasheet to see if zero duty is possible.
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: PWM on one channel also shown on disabled channels
Hi,
dsPIC with 6 MOSFETS ,Although it depends on how you drive the MOSFET not all MOSFET Drivers allow for 0-100% duty cycle many are only around 10 -95% with out knowing your MOSFET Drive circuit it is hard to comment on a simple scope print.
I assume you are using a MOSFET Driver IC between the MCU and the Mosfet(Mosfets) I agree with Leigh it seems from the print it is the discharge from the MOSFET regeions During shut down /Off , Again to understnd the scope print you need to know the circuit
I can assure you on a dsPIC30F,dsPIC33 you can set the Duty cycle from 0 -100% with no issue I have a number of Motor Control applications usingWould need to check device datasheet to see if zero duty is possible.
dsPIC with 6 MOSFETS ,Although it depends on how you drive the MOSFET not all MOSFET Drivers allow for 0-100% duty cycle many are only around 10 -95% with out knowing your MOSFET Drive circuit it is hard to comment on a simple scope print.
I assume you are using a MOSFET Driver IC between the MCU and the Mosfet(Mosfets) I agree with Leigh it seems from the print it is the discharge from the MOSFET regeions During shut down /Off , Again to understnd the scope print you need to know the circuit
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
Re: PWM on one channel also shown on disabled channels
It's difficult to get the schematic as this is only a very small section of the whole design.
I understand the theory on using bootstraps (which I am in this case IRS2011). For both thte the high side and low side there is a direct connection between the PWM output of the PIC into dhe driver, between driver and mosfet there is a 27Ohm gate resistors and a 10K pull down from gate to sourse.The drives have 2 bypass caps 2.2uF and 0.1uF.
I am working on this more today, will post any more information as it comes in. But I am sure both the 0% duty cycle issue and the scalled duplicate on the other PWM channel issues are related to the PIC and not the circuit.
I understand the theory on using bootstraps (which I am in this case IRS2011). For both thte the high side and low side there is a direct connection between the PWM output of the PIC into dhe driver, between driver and mosfet there is a 27Ohm gate resistors and a 10K pull down from gate to sourse.The drives have 2 bypass caps 2.2uF and 0.1uF.
I am working on this more today, will post any more information as it comes in. But I am sure both the 0% duty cycle issue and the scalled duplicate on the other PWM channel issues are related to the PIC and not the circuit.
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact:
Re: PWM on one channel also shown on disabled channels
Quick update
So, the duplication of the PWM on the other channels is down to hardware as you have suggested... thanks... To test it I just soldered a PIC to a new board with only athe bypass caps, crystal and its caps and the other channels look clean. I will look at updating the design with some pull downs between the PIC and driver...
With regards to the 0% PWM, below is an example. When mneasuring the duty cycle I get 0.1% almost exactly. I get this with the PIC with on both PIC's (with and without other external hardware connected).
Details are:
Channel 1
Timer 2
Period Overflow = 1000
Prescaler = 1
Then set duty cycle 10bit = 0
So, the duplication of the PWM on the other channels is down to hardware as you have suggested... thanks... To test it I just soldered a PIC to a new board with only athe bypass caps, crystal and its caps and the other channels look clean. I will look at updating the design with some pull downs between the PIC and driver...
With regards to the 0% PWM, below is an example. When mneasuring the duty cycle I get 0.1% almost exactly. I get this with the PIC with on both PIC's (with and without other external hardware connected).
Details are:
Channel 1
Timer 2
Period Overflow = 1000
Prescaler = 1
Then set duty cycle 10bit = 0
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: PWM on one channel also shown on disabled channels
Hello,
This is taken from the 30F3011 errata document on the Microchip website.
I advise that instead of writing the duty value 0 you disable the PWM and hopefully this will solve the problem. Just remember to re-enable when you next have a none 0 duty.
This is taken from the 30F3011 errata document on the Microchip website.
Because of this we already have this workaround in the CAL to avoid the glitch.Output Compare
PWM Mode 10. Output compare will produce a glitch when loading 0% duty cycle in PWM mode. It will also miss the next compare after the glitch.
Code: Select all
if (duty < 1)
duty = 1;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Flowcode V4 User
- Posts: 288
- Joined: Wed Nov 02, 2011 11:15 pm
- Has thanked: 29 times
- Been thanked: 30 times
- Contact: