Hercules-EBX CPU User Manual V1.02
Page 96
//
Port B is output; ports A,C,D,E all inputs
BYTE Mode : For byte-mode operation, the data for a given byte is read or written to the
appropriate DIO byte register: DIO ports A-E are located at Base+16 – Base+20, respectively. As
an example, the following illustrates setting port A to output (B-E to input), writing a value of “AA”
to port A, and reading data from port C:
outp(base+22,
0x01
)
;
// Selects:
DIO direction Mode (bit 7=0) and
//
Port A is output; ports B,C,D,E all inputs
outp(base+16,
0xAA
)
;
// Send data to DIO output port A
data = inp(base+18
)
;
// Read data from port C
Note that accessing a Digital Output port can be handled as bit or byte-level accesses
interchangeably – the two methods are provided to allow maximum flexibility for output
operations.
13.9 Special Digital I/O Operation – Port E
In addition to the standard Digital I/O operation detailed above, port E may alternatively be
configured for some special I/O functions, allowing access to several special-purpose Digital I/O
controls. These special functions are controlled with the DIOCTR0 and DIOCTR1 bits.
DIOCTR0 controls the special functions for DIO E3-E0:
J8 - Pin
DIOCTR0
Number 0
1
33 DIO
E0 PWM0
34 DIO
E1 PWM1
35 DIO
E2 PWM2
36 DIO
E3 PWM3
Table 39: DIOCTR0 (DIO3-0 Alternate Functions)
See section on PWM functionality for details on PWM functions for these pins (when DIOCTR0 =
1).
DIOCTR1 controls the special functions for DIO E7-E4:
J8 - Pin
DIOCTR1
Number 0
1
37
DIO E4
GATE 0
38 DIO
E5
DIOLATCH
39
DIO E6
TOUT 1
40
DIO E7
GATE 1
Table 40: DIOCTR1 (DIO7-4 Alternate Functions)