Serial protocol |
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
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:
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:
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.
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:
|