Analog inputs/outputs
RB700 Advance and RB700 Standard have four 0-10V analog inputs and two 0-10V analog outputs. The analog inputs and outputs are controlled via the SPI interface (/dev/spidev0.1). SPI settings:
- Mode bits: CPHA = 1, CPOL = 0,
- Bits per word: 8,
- Max. speed 2 MHz.
Analog outputs
The following figure shows the write analog outputs frame. Each rectangle represents one byte.
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 |
---|---|---|---|---|
0X4F | AO1[7:0] | AO1[15:8] | AO2[7:0] | AO2[15:8] |
Fig. 1. Write analog outputs frame
The value 1000 corresponds to the output voltage 10V. If the fifteenth bit of the output value is 1 then the output is ignored. Frame timeout is 100ms.
Example 1
Set both analog outputs: AO1 = 10.0V ⇒ 1000 ⇒ 0x03E8 AO2 = 5.0V ⇒ 500 ⇒ 0x01F4
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 |
---|---|---|---|---|
0X4F | 0XE8 | 0X03 | 0XF4 | 0X01 |
Fig. 2. Write analog outputs frame - example 1
Example 2
Set only A01: AO1 = 10.0V ⇒ 1000 ⇒ 0x03E8
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 |
---|---|---|---|---|
0X4F | 0XE8 | 0X03 | 0X00 | 0X80 |
Fig. 3. Write analog outputs frame - example 2
Example 3
Set only A02: AO2 = 5.0V ⇒ 500 ⇒ 0x01F4
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 |
---|---|---|---|---|
0X4F | 0X00 | 0X80 | 0XF4 | 0X01 |
Fig. 4. Write analog outputs frame - example 3
Analog inputs
The following figure shows the read analog inputs frame. Each rectangle represents one byte.
Byte 1 | Byte 2 | Byte 3 | Byte 4 | Byte 5 | Byte 6 | Byte 7 | Byte 8 | Byte 9 |
---|---|---|---|---|---|---|---|---|
0X41 | AI1[7:0] | AI1[15:8] | AI2[7:0] | AI2[15:8] | AI3[7:0] | AI3[15:8] | AI4[7:0] | AI4[15:8] |
Fig. 5. Read analog inputs frame
Between the first two bytes (0x41 and AI1[7:0]) there should be a delay of at least 100 µs.
The voltage at the analog input can be calculated using the formula:
Vin = ((AI[15:8] ← 8) OR AI[7:0]) · 10.065 / 1023.0
where:
-
"<<" denotes a left shift by 8 bits,
-
"|" denotes a bitwise OR operation.