92
CHAPTER 4 I/O PORTS
MB89620 series
4.2 Ports 0 and 1
4.2.1 Port 0 and 1 Registers (PDR0, PDR1, DDR0, DDR1)
This section describes the port 0 and 1 registers.
n
Port 0 and 1 Register Functions
l
Port data registers (PDR0, PDR1)
The PDR0 and PDR1 registers hold the pin states.
l
Port data direction registers (DDR0, DDR1)
The DDR0 and DDR1 registers set the direction (input or output) for each pin (bit).
Setting “1” to the bit corresponding to a port (pin) sets the pin as an output port. Setting “0” sets
the pin as an input port.
Check:
As the port data direction registers are write-only, the bit manipulation instructions (SETB and
CLRB) cannot be used.
Note: •
Writing data to the port data register for pins that have been set to the input direction does not
output to the pins. (However, the data is held in the output latch.)
•
The port data direction registers are initialized to “0” (input port) by a reset.
Table 4.2.1 lists the functions of the port 0 and 1 registers.
R/W : Readable and writable
W : Write-only
X : Indeterminate
Table 4.2.1 Port 0 and 1 Register Function
Register
Data
Read
Write
Read/
Write
Address
Initial value
Port 0 data
register (PDR0)
0
Pin state is the
“L” level.
Sets “0” to the output latch.
Outputs an “L” level to the pin if the
pin functions as an output port.
R/W
0000
H
XXXXXXXX
B
1
Pin state is the
“H” level.
Sets “1” to the output latch.
Outputs an “H” level to the pin if the
pin functions as an output port.
Port 0 data
direction register
(DDR0)
0
Reading is not
permitted (write-
only).
Sets the output buffer “OFF” and
sets the pin as an input pin.
W
0001
H
00000000
B
1
Sets the output buffer “ON” and
sets the pin as an output pin.
Port 1 data
register (PDR1)
0
Pin state is the
“L” level.
Sets “0” to the output latch.
Outputs an “L” level to the pin if the
pin functions as an output port.
R/W
0002
H
XXXXXXXX
B
1
Pin state is the
“H” level.
Sets “1” to the output latch.
Outputs an “H” level to the pin if the
pin functions as an output port.
Port 1 data
direction register
(DDR1)
0
Reading is not
permitted (write-
only).
Sets the output buffer “OFF” and
sets the pin as an input pin.
W
0003
H
00000000
B
1
Sets the output buffer “ON” and
sets the pin as an output pin.
Содержание F2MC-8L MB89620 Series
Страница 8: ......
Страница 10: ...MB89620 series ...
Страница 11: ...vi MB89620 series ...
Страница 17: ...xii MB89620 series ...
Страница 18: ...xvi MB89620 series ...
Страница 30: ...MB89620 series CHAPTER 1 OVERVIEW 9 Memo ...
Страница 34: ...MB89620 series CHAPTER 1 OVERVIEW 13 Memo ...
Страница 42: ...MB89620 series CHAPTER 1 OVERVIEW 21 Memo ...
Страница 49: ...28 CHAPTER 1 OVERVIEW MB89620 series ...
Страница 62: ...MB89620 series CHAPTER 3 CPU 41 Memo ...
Страница 78: ...MB89620 series CHAPTER 3 CPU 57 Memo ...
Страница 82: ...MB89620 series CHAPTER 3 CPU 61 Memo ...
Страница 86: ...MB89620 series CHAPTER 3 CPU 65 Memo ...
Страница 90: ...MB89620 series CHAPTER 3 CPU 69 Memo ...
Страница 96: ...MB89620 series CHAPTER 3 CPU 75 Memo ...
Страница 122: ...MB89620 series CHAPTER 4 I O PORTS 101 Memo ...
Страница 144: ...MB89620 series CHAPTER 5 TIMEBASE TIMER 123 Memo ...
Страница 149: ...128 CHAPTER 5 TIMEBASE TIMER MB89620 series ...
Страница 157: ...136 CHAPTER 6 WATCHDOG TIMER MB89620 series ...
Страница 174: ...MB89620 series CHAPTER 7 8 BIT PWM TIMER 153 Memo ...
Страница 177: ...156 CHAPTER 7 8 BIT PWM TIMER MB89620 series ...
Страница 202: ...MB89620 series CHAPTER 9 16 BIT TIMER COUNTER 181 Memo ...
Страница 217: ...196 CHAPTER 9 16 BIT TIMER COUNTER MB89620 series ...
Страница 220: ...MB89620 series CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 199 Memo ...
Страница 228: ...MB89620 series CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 207 Memo ...
Страница 245: ...224 CHAPTER 10 8 BIT SERIAL I O SERIAL I O 1 AND SERIAL I O 2 MB89620 series ...
Страница 266: ...MB89620 series CHAPTER 13 A D CONVERTER 245 13 Memo ...
Страница 283: ...262 CHAPTER 13 A D CONVERTER MB89620 series ...
Страница 289: ...268 CHAPTER 14 CLOCK MONITOR FUNCTION MB89620 series ...
Страница 306: ...MB89620 series APPENDIX 285 APPEND Memo ...
Страница 319: ...298 APPENDIX MB89620 series Memo ...
Страница 321: ...2 ...
Страница 354: ......