Serial protocol

Pico ADC-16

Serial protocol

Top  Previous  Next

 

About a second after powering on the ADC-16, the driver can  communicate with the ADC-16 as a normal RS232 device.  The ADC-16 operates at 9600 baud with 1 stop bit and no parity.

The driver controls the  ADC-16 using the following sequence

 

1.Switch RTS on and DTR off to provide power.
2.Wait for more than 1 second for the ADC-16 to settle
3.Send an single control byte to the ADC-16
4.Wait for the 3 byte response from the ADC-16

 

Steps 3 and 4 are repeated for each measurement.

The ADC-16 signals the end of conversion by sending three bytes.  No data should be sent to the ADC-16 during the conversion, as it may be lost or corrupted.

Control byte description

The control byte tells the ADC-16 the information it needs to carry out a conversion.  It has the following format, where bit 7 is the MSB and bit 0 is the LSB:

Bits

Function

Value

7 - 5

Set the channel

000 = channel 1

001 = channel 2

...........

110 = channel 7

111 = channel 8

4 - 1

Select Resolution

0111 = 8 bit

1000 = 9 bit

..........

1110 = 15 bit

1111 = 16 bit

0

Mode

1 = single ended

0 = differential

If the mode bit is 1, each channel voltage will be measured with respect to ground (single ended operation).  If the mode bit is 0 then adjacent channels act as differential pairs.  Differential operation can be useful if problems due to earth loops are encountered.

If you select channel 1 and differential operation, the ADC-16 will measure the voltage between channels 1 and 2.  Similarly selecting channel 3 will cause the voltage to be measured between channels 3 and 4.  Whilst in differential mode, selecting even channel numbers may give incorrect results.

The control byte 00000001 is a request for the version number: see below for details of the version response. The following examples show complete control bytes and their effects:

Binary

Hex

Effect

000 1111 1

1F

channel 1, 16 bits, single ended

110 0111 0

CE

channels 7 and 8, 8 bits, differential mode.

000 0000 1

01

request version number

Response format

On receipt of a control byte containing a valid data request, the ADC-16 will start a conversion cycle. At the end of this conversion, the ADC-16 will respond by sending three bytes. Note that three bytes are sent even for 8-bit readings.

Byte

Contents

Value

1

Sign

value >= 0: ASCII + (hex 2B)

value <= :  ASCII - (hex 2D)

2

Result MSB

Binary

3

Result LSB

Binary

For example, the value +41349 (which is hex 85A1) would be sent as hex 2B, 85, A1.

On receipt of a control byte containing a valid version request, the ADC-16 will respond immediately with the version details in the following format:

Byte

Contents

Value

1

ADC type

16 (hex 10)

2

version

decimal version number