How do I set the duty cycle of the PWM channel for the DM6816 PWM block in xPC Target 2.7.2 (R14SP2)?
1 view (last 30 days)
Show older comments
I am attempting to set the duty cycle for the first PWM channel of the Real Time Devices DM6816 PWM block in xPC Target 2.7.2 (R14SP2). I don't have sufficient information related to the block's inputs.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
We have verified that documentation for the Real Time Devices DM6816 PWM block found within the xPC Target I/O Block Reference section is incomplete as of xPC Target 2.7.2 (R14SP2). Here is some additional information related to setting the duty cycle of the PWM channel associated with that block:
The value of the duty cycle relies on the input to the block. Valid input to the DM6816 PWM block is a number in the range from 0 to 255. This input corresponds to the block duty cycle, where 0 is a duty cycle of 0% and 256 is 100%. Consequently, the maximum input duty cycle is:
255 / 256 = 0.996
To set a duty cycle of 0.06 for example, the block input associated with the PWM channel should be:
0.06 * 256 = 15.36
However, note that the block rounds to the nearest integer. As a result, the duty cycle is actually:
15 / 256 = 0.0586
0 Comments
More Answers (0)
Communities
More Answers in the Power Electronics Control
See Also
Categories
Find more on C2000 Microcontroller Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!