NEC V850ES/F 3-L Series User Manual page 44

32-bit single-chip microcontroller
Table of Contents

Advertisement

Chapter 2
Alternative mode
Table 2-11
Caution
44
In alternative mode (PMCn.PMCnm = 1), the corresponding port type defines
whether a pin is in input or output mode. However, register PMn influences the
writing/reading of register Pn.
In alternative mode, data is written to or read from the Pn register as follows:
Writing/reading register Pn in alternative mode (PMCn.PMCnm = 1)
Function
Write to Pn
without affecting the pin status
Read from Pn...
...and read the value of the alternative output function
(for pins in alternative output function)
...and disregard the pin status
(for pins in alternative input function)
...and thus read the pin status
Although 1-bit operations (read-modify-write operations) on Pn registers are
intended to modify only a single bit, the entire Pn register is read. After the
single bit has been modified, the contents of the complete register is written
back.
If the ports of the register Pn contain both input and output ports Pnm, the
read of Pn returns
• the contents of the register Pn for output ports
• the pin status of input ports, but not the Pn register bits
That means the read value of Pn may be different to the contents of the Pn
register at bit positions, which are assigned to input ports.
Thus the contents of Pn may differ to the previous value not just in the bit that
was to be modified, but also in other bits.
Example:
• Register P1 has the contents 00
• Port P10 is configured as an output port, all other ports of port group 1
(ports P11 to P17) are configured as input ports.
• The port pins of ports P11 to P17 all have the level "1".
• Bit P1.P10 is set to 1 by a 1-bit operation.
Afterwards, register P1 holds the value FF
01
, since bits P11 to P17 have be overwritten with the corresponding pin
H
levels "1".
User's Manual U18743EE1V2UM00
PM
X
0
1
.
H
instead of the expected value
H
Pin Functions
I/O
I

Advertisement

Table of Contents
loading

Table of Contents