Access from the user program
KL5121
36
Version: 3.1.0
Control byte in the register mode
MSB
REG = 1
W/R
A5
A4
A3
A2
A1
A0
REG = 0: Process data exchange
REG = 1: Access to register structure
W/R = 0: Read register
W/R = 1: Write register
A5...A0 = register address
Addresses A5...A0 can be used to address a total of 64 registers
Examples for the register communication
Fig. 15: Register mode control byte
The control or status byte occupies the lowest address of a logical channel. The corresponding register
values are located in the following 2 data bytes. (The BK2000 is an exception: here, an unused data byte is
inserted after the control or status byte, and the register value is therefore placed on a word boundary).
Sample 1
Reading register 8 in the BK2000 with a KL5121 and the end terminal:
If the following bytes are transferred from the controller to the terminal,
Byte
Byte 3
Byte 2
Byte 1
Byte 0
Name
DataOUT 1, low byte
DataOUT 0, high byte
Not used
Control byte
Value
0xXX
0xXX
0xXX
0x88
The terminal returns the following type identifier (0x1401 corresponds to unsigned integer 5121).
Byte
Byte 3
Byte 2
Byte 1
Byte 0
Name
DataIN 1, low byte
Data IN 0, high byte
Not used
Status byte
Value
0x01
0x14
0x00
0x88
Содержание KL5121
Страница 2: ......
Страница 4: ...Table of content KL5121 4 Version 3 1 0...