at89lp216-20xi ATMEL Corporation, at89lp216-20xi Datasheet - Page 25

no-image

at89lp216-20xi

Manufacturer Part Number
at89lp216-20xi
Description
At89lp216 8-bit Microcontroller With 2k Bytes Flash
Manufacturer
ATMEL Corporation
Datasheet
13.2
13.3
3621B–MICRO–11/07
Port 1 Analog Functions
Port Read-Modify-Write
Figure 13-5. Push-pull Output
The AT89LP216 incorporates an analog comparator. In order to give the best analog perfor-
mance and minimize power consumption, pins that are being used for analog functions must
have both their digital outputs and digital inputs disabled. Digital outputs are disabled by putting
the port pins into the input-only mode as described in
inputs on P1.0 and P1.1 are disabled whenever the Analog Comparator is enabled by setting the
CEN bit in ACSR. CEN forces the PWD input on P1.0 and P1.1 low, thereby disabling the
Schmitt trigger circuitry. P1.0 and P1.1 will always default to input-only mode after reset regard-
less of the state of the Tristate-Port Fuse.
A read from a port will read either the state of the pins or the state of the port register depending
on which instruction is used. Simple read instructions will always access the port pins directly.
Read-modify-write instructions, which read a value, possibly modify it, and then write it back, will
always access the port register. This includes bit write instructions such as CLR or SETB as they
actually read the entire port, modify a single bit, then write the data back to the entire port. See
Table 13-3
Table 13-3.
Mnemonic
ANL
ORL
XRL
JBC
CPL
INC
DEC
DJNZ
MOV PX.Y, C
CLR PX.Y
SETB PX.Y
From Port
Register
for a complete list of Read-Modify-Write instruction which may access the ports.
Port Read-Modify-Write Instructions
Instruction
Logical OR
Jump if bit set and clear bit
Increment
Move carry to bit Y of Port X
Logical AND
Logical EX-OR
Complement bit
Decrement
Decrement and jump if not zero
Clear bit Y of Port X
Set bit Y of Port X
Input
Data
PWD
V
CC
“Port Configuration” on page
Example
ANL P1, A
ORL P1, A
XRL P1, A
JBC P3.0, LABEL
CPL P3.1
INC P1
DEC P3
DJNZ P3, LABEL
MOV P1.0, C
CLR P1.1
SETB P3.2
Port
Pin
AT89LP216
22. Digital
25

Related parts for at89lp216-20xi