![Sino Wealth SH79F3283 Manual Download Page 38](http://html1.mh-extra.com/html/sino-wealth/sh79f3283/sh79f3283_manual_1283063038.webp)
SH79F3283
38
7.7.3 Port Diagram
Data
Register
Data Bus
Write
Read Port Pad
PxCRy
Read Data Register/Pad Selection
Read
PxPCRy
Output Mode
I/O Pad
0: From Pad
1: From data register
SFEN
Second
Function
Input Mode
Read Port Data Register
(Pull-up)
0 = ON
1 = OFF
V
DD
V
DD
0 = OFF
1 = ON
Note:
(1) The input source of reading input port operation is from the input pin directly.
(2) The input source of reading output port operation has two paths, one is from the port data Register, and the other is from
the
output pin directly.
(3) The read Instruction distinguishes which path is selected: The read-modify-write instruction is for the reading of the data
register in output mode, and the other instructions are for reading of the output pin directly.
(4) The destination of writing port operation is the data register regardless of the port shared as the second function or not.
7.7.4 Port Share
The 46/42/30 bi-directional I/O ports can also share second or third special function. But the share priority should obey the
Outer Most Inner Lest
rule:
The out most pin function in
Pin Configuration
has the highest priority, and the inner most pin function has the lowest priority.
This means when one pin is occupied by a higher priority function (if enabled), it cannot be used as the lower priority functional
pin, even the lower priority function is also enabled. Only until the higher priority function is closed by hardware or software,
can the corresponding pin be released for the lower priority function use. Also the function that need pull up resister is also
controlled by the same rule.
When port share function is enabled, the user can modify PxCR, PxPCR (x = 0-5), but these operations will have no effect on
the port status until the second function was disabled.
When port share function is enabled, any read or write operation to port will only affect the data register. The value of the port
pin keeps unchanged until the second function was disabled.
PORT0:
- LCD Segment 17-19 (P0.0-P0.2)
- PWM01B: PWM01B output (P0.0)
- PWM0B: PWM0B output (P0.1)
- PWM01A: PWM01A output (P0.2)
- PWM0A: PWM0A output (P0.3)
- INT0: external inturrupt0 (P0.4)
- INT1: external inturrupt1 (P0.5)
- INT2: external inturrupt2 (P0.6)
- INT3: external inturrupt3 (P0.7)
- T2: Timer2 external input/baud rate clock output (P0.5)
- T2EX: Timer2 reload/capture control (P0.4)
- T4: Timer4 external input/Baud-rate clock output (P0.3)