
Hercules III User Manual Rev A.2
www.diamondsystems.com
Page
77
19. DIGITAL I/O OPERATION
Hercules III contains 40 digital I/O lines organized as five 8-bit I/O ports: Port A-E. The direction of each port is
programmable. Port E is also used for the PWM outputs. The port data are accessed at registers Base+16
through Base+20, and the port direction register is located at Base+22.
Base +
7
6
5
4
3
2
1
0
16
DIOA7
DIOA6
DIOA5
DIOA4
DIOA3
DIOA2
DIOA1
DIOA0
17
DIOB7
DIOB6
DIOB5
DIOB4
DIOB3
DIOB2
DIOB1
DIOB0
18
DIOC7
DIO6
DIOC5
DIOC4
DIOC3
DIOC2
DIOC1
DIOC0
19
DIOD7 DIOD6 DIOD5
DIOD4
DIOD3
DIOD2
DIOD1
DIOD0
20
DIOE7
DIOE6
DIOE5
DIOE4
DIOE3
DIOE2
DIOE1
DIOE0
21
-
-
-
-
-
-
-
-
22
MODE
P2
P1
PO/DIRE B2/DIRD B1/DIRC B0/DIRB D/DIRA
The digital I/O lines are located on I/O header J8. The lines are 3.3V and 5V logic compatible. Each output is
capable of supplying
–8mA in logic 1 state and +12mA in logic 0 state.
DIRA, DIRB, DIRC, DIRD, and DIRE control the direction of ports A, B, C, D and E respectively. A direction value
of 0 means output and 1 means input. All ports power up to input mode and the output registers are cleared to
zero. When a port direction is changed to output, its output register is cleared to zero. When a port is in output
mode, its value can be read back.