How do I set the duty cycle of the PWM channel for the DM6816 PWM block in xPC Target 2.7.2 (R14SP2)?
1 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
MathWorks Support Team
2009-6-27
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 个评论
更多回答(0 个)
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 C2000 Microcontroller Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!