DF2211NP24V Renesas Technology / Hitachi Semiconductor, DF2211NP24V Datasheet - Page 121

no-image

DF2211NP24V

Manufacturer Part Number
DF2211NP24V
Description
H8S/2200 Series, 2212 Group, USB, RTC, HSS TNP-64B; Vcc= 2.7 to 3.6 volts, Temp= -20 to 75 C; Package: PVQN0064LB-A
Manufacturer
Renesas Technology / Hitachi Semiconductor
Datasheet
The instructions BSET, BCLR, BNOT, BST, and BIST perform the following operations in the
order shown:
1. Read data in byte units
2. Perform bit manipulation on the read data according to the instruction
3. Write data in byte units
Example: Using the BCLR instruction to clear pin 14 only of P1DDR for port 1
P1DDR is an 8-bit register that contains write-only bits. It is used to specify the I/O setting of the
individual pins in port 1. Reading produces invalid data. Attempting to read from P1DDR returns
undefined values.
In this example, the BCLR instruction is used to set pin 14 as an input port. Let us assume that pins
17 to 14 are presently set as output pins and pins 13 to 10 are set as input pins. Thus, the value of
P1DDR is initially H'F0.
I/O
P1DDR
To change pin 14 from an output pin to an input pin, the value of bit 4 in P1DDR must be changed
from 1 to 0 (H'F0 to H'E0). Now assume that the BCLR instruction is used to clear bit 4 in P1DDR
to 0.
However, using the above bit manipulation instruction on the write-only register P1DDR can cause
problems, as described below.
The BCLR instruction first reads data from P1DDR in byte units, but in this case the read values
are undefined. These undefined values can be 0 or 1 for each bit in the register, but there is no way
of telling which. Since all of the bits in P1DDR are write-only, undefined values are returned for
all of the bits when the register is read. In this example the value of P1DDR is H'F0, but we will
assume that the value returned when the register was read is H'F8, which would give bit 3 a value
of 1.
BCLR
#4, @P1DDR
P17
Output
1
P16
Output
1
P15
Output
1
P14
Output
1
P13
Input
0
Rev.7.00 Dec. 24, 2008 Page 67 of 698
P12
Input
0
P11
Input
0
REJ09B0074-0700
P10
Input
0

Related parts for DF2211NP24V