Rev. 1.0, 02/00, page 193 of 1141
Port Mode Register 1 (PMR1)
0
0
1
0
R/W
2
0
R/W
3
0
4
0
R/W
0
R/W
5
0
7
0
R/W
R/W
R/W
R/W
6
PMR14
PMR13
PMR12
PMR11
PMR10
PMR17
PMR16
PMR15
Bit :
Initial value :
R/W :
Port mode register 1 (PMR1) controls switching of each pin function of port 1. The switching is
specified in a unit of bit.
PMR1 is an 8-bit read/write enable register. When reset, PMR1 is initialized to H'00.
Note the following items when the pin functions are switched by PMR1.
•
If port 1 is set to an
,&
input pin and
,54
8
to
,54
3
by PMR1, the pin level needs be set to the
high or low level regardless of the active mode and low power consumption mode. The pin
level must not be set to an intermediate level.
•
When the pin functions of P16/
,&
and P15/
,34
8
to P10/
,54
3
are switched by PMR1, they are
incorrectly recognized as edge detection according to the state of a pin signal and a detection
signal may be generated. To prevent this, perform the operation in the following procedure.
Before switching the pin functions, inhibit an interrupt enable flag from being interrupted.
After having switched the pin functions, clear the relevant interrupt request flag to 0 by a
single instruction.
Program Example:
:
MOV.B ROL,@IENR
⋅⋅⋅⋅⋅⋅
Interrupt disabled
MOV.B R1L,@PMR1
⋅⋅⋅⋅⋅⋅
Pin function change
NOP
⋅⋅⋅⋅⋅⋅
Optional instruction
BCLR m @IRQR
⋅⋅⋅⋅⋅⋅
Applicable interrupt clear
MOV.B R1L,@IENR
⋅⋅⋅⋅⋅⋅
Interrupt enabled
: