TS-8820-pwm: Difference between revisions

From embeddedTS Manuals
(Formatting)
(Removed H Bridge references)
Line 1: Line 1:
The TS-8820 has 8 PWM outputs. PWM channels 1 to 6 feed digital outputs 1 to 6 respectively when the PWM override bit is set for a given output. PWM channels 7 and 8 are used for the [[#H Bridges|H Bridges]]. If an H Bridge channel is not enabled then both contacts will be high impedance. If a channel is enabled it will have one output connected to ground and the other driven by the PWM output. The direction bit can be toggled at any time to toggle the H Bridge direction. An electrical brake, shorting the motor windings together, is not supported at this time. See the [[#H Bridge|H Bridge section]] for more information on the H Bridge operation.
The TS-8820 has 6 PWM outputs. PWM channels 1 to 6 feed digital outputs 1 to 6 respectively when the PWM override bit is set for a given output.


For all 8 PWM channels, the PWM frequency is approximately (12207/(2^prescalar)) Hz, where the prescalar value is 3 bits wide. That is, a prescalar value of 0 through 7. The PWM duty cycle has 12 bits of resolution. If bit 12 of a PWM register is set, then the PWM output for that channel will be 100% high. Otherwise, the duty cycle setting is divided by 4096 to give the effective duty cycle.
For all 8 PWM channels, the PWM frequency is approximately (12207/(2^prescalar)) Hz, where the prescalar value is 3 bits wide. That is, a prescalar value of 0 through 7. The PWM duty cycle has 12 bits of resolution. If bit 12 of a PWM register is set, then the PWM output for that channel will be 100% high. Otherwise, the duty cycle setting is divided by 4096 to give the effective duty cycle.

Revision as of 12:21, 17 January 2019

The TS-8820 has 6 PWM outputs. PWM channels 1 to 6 feed digital outputs 1 to 6 respectively when the PWM override bit is set for a given output.

For all 8 PWM channels, the PWM frequency is approximately (12207/(2^prescalar)) Hz, where the prescalar value is 3 bits wide. That is, a prescalar value of 0 through 7. The PWM duty cycle has 12 bits of resolution. If bit 12 of a PWM register is set, then the PWM output for that channel will be 100% high. Otherwise, the duty cycle setting is divided by 4096 to give the effective duty cycle.

To give OUT5 a ~3 kHZ 50% duty cycle PWM output using ts8820ctl, the following arguments would be used:

# --prescalar= sets the PWM frequency to (12207/(2^VALUE))Hz.
# --mvolts= sets the PWM duty cycle percentage from a decimal scale of 0-10000
# --pwm= PWM channel to enable and modify
ts8820ctl --pwm=5 --mvolts=5000 --prescalar=2