Re: TPU3 PWM glitch?
Eric McRae <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
I think the thread has settled this but to be definitive, the documentation for the PWM function says that the minimum time between any two edges is 32 CPU clocks. The problem as [email protected] mentioned, is that it takes the code and the TPU scheduling hardware some time to process each edge and schedule the next. In the case of a low duty cycle pulse, the falling edge of the pulse may actually occur, or you might want it to occur, before the end of the code thread that creates it. Typically this leads to the edge being delayed by 32K or 64K TCR clocks. In some cases, the first edge occurs but the match is not recognized so the thread never runs again. A similar problem occurs near 100% duty cycle. I wrote a high resolution PWM function a few years ago that could handle the short pulses down to the resolution of TCR1. For the very short pulses, the function syncs with TCR1 and just counts its clicks. It worked great but only because the customer didn't care about slight variations in the pulse period. The function had to control both the rising and falling edges (in low duty cycle situations) in the firmware because there were other functions running on the same TPU and the associated latency would have stretched any hardware generated pulses. Schroeder, Steven A. wrote: > We are using a TPU3 channel in the MPC563 to generate a 4kHz PWM > signal. Updating the duty cycle is accomplished by simply writing a > new PWMHI value and it operates very well. Until now. When the duty > cycle first becomes 0% we write 0 to PWMHI. The first cycle at 0% > outputs a 550ns pulse; after that it stays low. > > The problem is that the device being driven does not like narrow > pulses such as this. Has anyone seen this before? -- Eric McRae, Electro-Logic Machines, Inc. 511 Root St., Port Townsend WA, 98368 Phone/Fax: 360.379.0969, http://www.elmi.com ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hri845t/M=362335.6886445.7839731.1510227/D=groups/S=1706554205:TM/Y=YAHOO/EXP=1123171825/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font> --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/