Firmware-830 Command-047

From I-CubeX Wiki
Jump to: navigation, search

SET OUTPUT PULSE (47, 2Fh)

The SET OUTPUT PULSE command sets the output pulse type as specified by its interval and width range and applies to all outputs at the same time. The default pulse is 1 – 2 ms long and repeats every 20 ms. It can be used to control a standard RC servo. Power for the servo has to be supplied by a separate power supply. The SET OUTPUT PULSE command can also configure the pulse to have no minimum pulse width. The command can be used in both modes of operation. After a RESET of the WiDig the common pulse interval and width as set by the SET OUTPUT PULSE command are retrieved from non-volatile memory. Upon completion of the command the digitizer sends out the same command with the actual set values (ie. if a desired setting is not permitted, the corrected setting will be used and sent back). To get the values stored in non-volatile memory, use the DUMP OUTPUT PULSE command.

The [BODY] of the SET OUTPUT PULSE command consists of three 7-bit bytes with the following format:

0uuuuuuu: uuuuuuu = [0..127]; pulse interval MSB
0vvvvvvv: vvvvvvv = [5..127]; pulse interval LSB
0zzzzzzz: zzzzzzz = 0; pulse width range of 1-2 ms (RC servo mode)
zzzzzzz = [3..127]; pulse width range in ms

The default setting is the standard pulse for RC servos: a pulse interval of 20 ms and a pulse width range of 1-2 ms.

Example:

In order to set the output pulse interval to 15 ms and the width range to 0-10 ms to control the light level emitted by an LED connected to the actuator output, the following message is sent:

240, 125, 0 {DEV}, 47 {SET OUTPUT PULSE}, 0 (interval MSB), 15 {interval LSB}, 5 {width range}, 247 (F0h, 7Dh, 00h, 2Fh, 00h, 0Fh, 05h, F7h)

In order to set the output pulse interval to 20 ms and the width range to 1-2 ms to control an RC servo, the following message is sent:

240, 125, 0 {DEV}, 47 {SET OUTPUT PULSE}, 0 (interval MSB), 20 {interval LSB}, 0 {width range}, 247 (F0h, 7Dh, 00h, 2Fh, 00h, 14h, 00h, F7h)