Texas Instruments TMS320C2XX User Manual
Page 414

Controlling and Resetting the Port
10-16
When pins IO0–IO3 are configured as inputs
When pins IO0–IO3 are configured as inputs, the eight LSBs of the IOSR allow
you to monitor these four pins. Each of the IOSR bits 3–0, called IO3, IO2, IO1,
and IO0, can be used to read the current logic level (high or low) of the signal
at the corresponding pin. Each of the bits 7–4, called DIO3, DIO2, DIO1, and
DIO0, is used to track a change from a previous known or unknown signal val-
ue at the corresponding pin. When a change is detected on one of the pins,
the corresponding detect bit is set to 1, and an interrupt request is sent to the
CPU on the TXRXINT interrupt line. You can clear each of the detect bits to
0 by writing a 1 to it. DIO3–DIO0 are only useful when the pins are configured
as inputs and the serial port is enabled by the URST bit of the ASPCR
(URST = 1). Table 10–4 summarizes what IOSR bits 0–7 indicate when IO0–
IO3 are inputs.
Table 10–4. Viewing the Status of Pins IO0–IO3 With IOSR Bits IO0–IO3 and DIO0–DIO3
БББ
Б
Б
Б
БББ
ББББ
Б
ББ
Б
ББББ
IOSR Bit
Number
ББ
ББ
ББ
ББББ
Б
ББ
Б
ББББ
IOSR Bit
Name
ББ
ББ
ББ
ББББББББББББ
Б
ББББББББББ
Б
ББББББББББББ
When IO0–IO3 are inputs,
this bit indicates...
ББ
ББ
ББ
0
IO0
Current logic level (0 or 1) on pin IO0
БББ
Б
Б
Б
БББ
ББББ
Б
ББ
Б
ББББ
1
ББ
ББ
ББ
ББББ
Б
ББ
Б
ББББ
IO1
ББ
ББ
ББ
ББББББББББББ
Б
ББББББББББ
Б
ББББББББББББ
Current logic level (0 or 1) on pin IO1
ББ
ББ
ББ
2
IO2
Current logic level (0 or 1) on pin IO2
БББ
БББ
ББББ
ББББ
3
ББ
ББ
ББББ
ББББ
IO3
ББ
ББ
ББББББББББББ
ББББББББББББ
Current logic level (0 or 1) on pin IO3
ББ
ББ
4
DIO0
†
Change detected (1) or not detected (0)
on pin IO0 (when IO0 is an input)
БББ
Б
Б
Б
БББ
ББББ
Б
ББ
Б
ББББ
5
ББ
ББ
ББ
ББББ
Б
ББ
Б
ББББ
DIO1
†
ББ
ББ
ББ
ББББББББББББ
Б
ББББББББББ
Б
ББББББББББББ
Change detected (1) or not detected (0)
on pin IO1 (when IO1 is an input)
ББ
ББ
ББ
БББ
Б
Б
Б
БББ
ББББ
Б
ББ
Б
ББББ
6
ББ
ББ
ББ
ББББ
Б
ББ
Б
ББББ
DIO2
†
ББ
ББ
ББ
ББББББББББББ
Б
ББББББББББ
Б
ББББББББББББ
Change detected (1) or not detected (0)
on pin IO2 (when IO2 is an input)
ББ
ББ
ББ
БББ
Б
Б
Б
БББ
ББББ
Б
ББ
Б
ББББ
7
ББ
ББ
ББ
ББББ
Б
ББ
Б
ББББ
DIO3
†
ББ
ББ
ББ
ББББББББББББ
Б
ББББББББББ
Б
ББББББББББББ
Change detected (1) or not detected (0)
on pin IO3 (when IO3 is an input)
ББ
ББ
ББ
† Write a 1 to this bit to clear it to 0.
When pins IO0–IO3 are configured as outputs
When pins IO0–IO3 are configured as outputs, you can write to the four LSBs
(IO3–IO0) of the IOSR. The value you write to each bit becomes the new logic
level at the corresponding pin. For example, if you write a 0 to bit 2, the logic
level at pin IO2 changes to low; if you write a 1 to bit 2, the logic level on IO2
changes to high.