Documentation

Real Time Devices DM6816 PWM

DM6816 PWM block

Library

Simulink® Real-Time™ Library for Real Time Devices

Note

As input to the DM6816 PWM block, use a number ranging from 0 to 255. This range corresponds to the duty cycle, where 256 is a duty cycle of 100 percent and 0 is 0 percent. The maximum duty cycle that can be given as an input is 255/256 = 0.996.

For example, to get a duty cycle of 0.06, input 0.06*256 = 15.36 as the input to the channel. The nearest integer will be used such that the duty cycle will actually be 15/256 = 0.05859.

Block Parameters

Channel vector

Enter numbers between 1 and 9 to select the PWM channel. This driver allows the selection of individual PWM channels in arbitrary order. The number of elements defines the number of channels used.

For example, to use all of the channels, enter

[1,2,3,4,5,6,7,8,9]

Number the lines beginning with 1 even if this board manufacturer starts numbering the lines with 0.

Clock source for channels 1, 2, 3

From the list choose either 8 MHz clock or Timer 1 output as the clock source for the channels. By default, it is Timer 1 output. This parameter affects channels 1, 2, or 3.

Clock source for channels 4, 5, 6

From the list choose either 8 MHz clock or Timer 1 output as the clock source for the channels. By default, it is Timer 1 output. This parameter affects channels 4, 5, or 6.

Clock source for channels 7, 8, 9

From the list choose either 8 MHz clock or Timer 1 output as the clock source for the channels. By default, it is Timer 1 output. This parameter affects channels 7, 8, or 9.

Frequency divisors for timers 0, 1, 2

Enter a vector [d0 d1 d2] of integers, with each integer in the range from 2 to 65535. The driver uses these integers as frequency divisors for the timers 0, 1, and 2, respectively. For example, if timer 0 uses the 8 MHz clock as a source, a frequency divisor value of 4 for d0 causes timer 0 to run at 2 MHz (8 MHz/4).

If you specify one integer in the vector, that value applies to all timers.

Sample time

Enter the base sample time or a multiple of the base sample time (-1 means sample time is inherited).

Base address (e.g. 0xd000)

Enter the base address of the board. It is important that this entry corresponds to the DIP-switch settings on the board. For example, if the base address is d000 (hexadecimal), enter 0xd000.

External Websites

Was this topic helpful?