CPC522
C P C 5 2 2 U s e r M a n u a l
36
© 2 0 2 2 F a s t w e l V e r . 0 0 1
2.5.1 GP LED indicator configuration and control registers (logic device 5)
Table 2-7 GP indicator configuration and control registers
INDEX
I/O port address
Type
HARD RESET
Configuration register
30h
-
R/W
00h
Activate. Bit [0] in
“1” – LED module is
active.
-
Base+0
R/W
01h
LED data register [3:0]. The other bits are
unimportant and read as
“0”.
60h
-
R/W
-
Base[15:8] - I/O port base address
bits[15:8]
61h
-
R/W
-
Base[7:0] - I/O port base address bits[7:0]
To work with the GP indicator you must set the base address of the device and activate it (LDN=5)
similar to the watchdog timer or FRAM module. GP indicator operation is controlled by the LED
register. Modification of the LED register is performed in the I/O area with respect to the set base
address.
2.5.2 LED register initialization
Sequence of actions when initializing the device:
Enter configuration mode
MOV DX, 302H
MOV AL, 46H
OUT DX, AL
MOV AL, 57H
OUT DX, AL
Write the number of the logical device to the LDN register
(FRAM has logical number 5)
MOV DX, 302H
MOV AL, 7
OUT DX, AL
MOV DX, 303H
MOV AL, 5
OUT DX, AL
Set the base address of the device in the I/O area (31Dh for example):
MOV DX, 302H
MOV AL, 60H
OUT DX, AL
MOV DX, 303H
MOV AL, 3H
OUT DX, AL
MOV DX, 302H
MOV AL, 61H
OUT DX, AL
MOV DX, 303H
MOV AL, 1DH
OUT DX, AL
Activate the device: