AT89LP4052 Atmel Corporation, AT89LP4052 Datasheet - Page 23

no-image

AT89LP4052

Manufacturer Part Number
AT89LP4052
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of AT89LP4052

Flash (kbytes)
4 Kbytes
Max. Operating Frequency
20 MHz
Cpu
8051-1C
Max I/o Pins
15
Spi
1
Uart
1
Sram (kbytes)
0.25
Operating Voltage (vcc)
2.4 to 5.5
Timers
2
Isp
SPI
Watchdog
Yes

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AT89LP4052-16PI
Manufacturer:
ITT
Quantity:
10
Part Number:
AT89LP4052-16SU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
AT89LP4052-16XU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
AT89LP4052-20SI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
AT89LP4052-20SU
Manufacturer:
ATMEL
Quantity:
3 100
Part Number:
AT89LP4052-20XI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
15.6
15.7
3547J–MICRO–10/09
Port Read-Modify-Write
Port Alternate Functions
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 15-2
Table 15-2.
Most general-purpose digital I/O pins of the AT89LP2052/LP4052 share functionality with the
various I/Os needed for the peripheral units.
pins. Alternate functions are connected to the pins in a logic AND fashion. In order to enable the
alternate function on a port pin, that pin must have a “1” in its corresponding port register bit, oth-
erwise, the input/output will always be “0”. Furthermore, each pin must be configured
for the correct input/output mode as required by its peripheral before it may be used as such.
Table 15-3
Table 15-3.
Mnemonic
ANL
ORL
XRL
JBC
CPL
INC
DEC
DJNZ
MOV PX.Y, C
CLR PX.Y
SETB PX.Y
PxM0.y
0
0
1
1
for a complete list of Read-Modify-Write instruction which may access the ports.
shows how to configure a generic pin for use with an alternate function.
Port Read-Modify-Write Instructions
Alternate Function Configurations for Pin y of Port x
PxM1.y
0
1
0
1
Instruction
Logical AND
Logical OR
Logical EX-OR
Jump if bit set and clear bit
Complement bit
Increment
Decrement
Decrement and jump if not zero
Move carry to bit Y of Port X
Clear bit Y of Port X
Set bit Y of Port X
Px.y
1
1
X
1
Table 15-4
I/O Mode
Bidirectional (internal pull-up)
Output
Input
Bidirectional (external pull-up)
AT89LP2052/LP4052
lists the alternate functions of the port
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
23

Related parts for AT89LP4052