System controller usb serial commands, I/o control requests/answers, 3 system controller usb serial commands – Kontron MSM-LP Manual User Guide V106 User Manual

Page 28: 1 i/o control requests/answers

Advertising
background image

MSM-LP / Special Features




www.kontron.com

24

4.3 System Controller USB Serial Commands

Note:

"System Controller USB" function must be enabled in the BIOS setup for using the ADC and PWM functions.

MSM-LP on-board 4-channel ADC and 2-channel PWM are accessible over a USB-serial port interface.

»

In the Windows Device Manager it is represented as "KCC ADC/PWM Control Serial Interface". For a driver
installation under Windows, the "KCCUSBserial.inf" file is required.

»

For Linux this interface does not require any drivers and is listed in the system as the "ttyACM0" serial port.

»

Communication with ADC/PWM can be organized over the standard serial asynchronous protocol.

»

Every control request consists of a 4 Byte package, with the leading (synch) Byte always 0x15.

»

The number of Bytes in the answer is variable and depends on the request.

4.3.1 I/O Control Requests/Answers:

4 Byte Command

Parameters

Description

'\x15','a','c',N
{0x15,0x61,0x63,N}

N-channels mask
N=0 – stop measurement
N=0x01...0x0F define which

channels 0...3 will be

measured

Start cyclic ADC measurement when ADC measures all channels

defined in the mask field, the controller sends an answer:

'\x15','D',VS...VE {0x15,0x44,VS…VE} ,

where VS is the Byte value of the first defined channel and VE is the
Byte value of the last defined channel.

The measurement/answer will repeat until the controller receives a

stop command ('\x15','a','c',0).

The number of received Bytes defined by the channels mask.

Example: mask N=0x05, ADC will measure on Channels 0 and 2 and

send a 4 Byte answer '\x15','D',V0,V2, where V0 and V2 are results

of the measurement on the appropriate channels.

'\x15','a','s',N
{0x15,0x61,0x73,N}

N-channels mask
N=0 – stop measurement
N=0x01...0x0F define which

channels 0...3 will be
measured

Start single shot ADC measurement when ADC measures all channels

defined in the mask field, the controller sends an answer:

'\x15','D',NS...NE {0x15,0x44,VS…VE}

where VS is the Byte value of the first defined channel and VE is the
Byte value of the last defined channel.
A non-cycled variant of the command above.
The number of received Bytes defined by the channels mask.

'\x15','p','a','e'
{0x15,0x70,0x61,0x65}

Enable PWM Channel A.

'\x15','p','a','d'
{0x15,0x70,0x61,0x64}

Disable PWM Channel A.

'\x15','p','b','e'
{0x15,0x70,0x62,0x65}

Enable PWM Channel B.

'\x15','p','b','d'
{0x15,0x70,0x62,0x64}

Disable PWM Channel B.

'\x15','w','a',N
{0x15,0x77,0x61,N}

N – PWM value

Set PWM value on Channel A (PWM must be enabled).

'\x15','w','b',N
{0x15,0x77,0x62,N}

N – PWM value

Set PWM value on Channel B (PWM must be enabled).

'\x15','f','v','r'
{0x15,0x66,0x76,0x72}

Get firmware version.

Answer: '\x15','V','M','S','M','L','P','_','0','6',0

The answer is always 11 Bytes, '\x15','V' - answer prefix, 8 Bytes of
the firmware version and a final Byte 0.

Advertising