AT89S4D12. 8-Bit Microcontroller with 132K Bytes Flash Data Memory AT89S4D12. Features. Description. Pin Configurations

Similar documents
8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

8-Bit Microcontroller with 2K Bytes Flash AT89C2051. Features. Description. Pin Configuration

8-Bit Microcontroller with 1K Bytes Flash. AT89C1051U Preliminary. Features. Description. Pin Configuration

8-Bit Microcontroller with 8K Bytes Flash AT89S8252. Features. Description

4-Megabit 2.7-volt Only Serial DataFlash AT45DB041. Features. Description. Pin Configurations

8-Bit Microcontroller with 12K Bytes Flash AT89LS53. Features

AT49BV004(T) TSOP Top View Type 1 1. AT49BV4096A(T) TSOP Top View Type 1 A16 BYTE GND I/O7 I/O14 I/O6 I/O13 I/O5 I/O12 I/O4 VCC I/O11 I/O3 I/O10 I/O2

AT89C Bit Microcontroller with 2 Kbytes Flash. Features. Description. Pin Configuration

8-bit Microcontroller with 1K Byte Flash AT89C1051

8-bit Microcontroller with 12K Bytes Flash and 2K Bytes EEPROM AT89S8253. Preliminary

8-bit Microcontroller with 12K Bytes Flash AT89S53

8-bit Microcontroller with 12K Bytes Flash and 2K Bytes EEPROM AT89S8253

1-Megabit (128K x 8) 5-volt Only Flash Memory AT29C010A. Features. Description. Pin Configurations

Atmel 8051 Microcontroller Family - Product Selection Guide

AT Bit Spread- Spectrum Microcontroller. Preliminary. Features. Description. Pin Configuration

spi 1 Fri Oct 13 13:04:

P1.0 P P0.0 (AD0) P1.2 P P0.1 (AD1) P P0.2 (AD2) P P0.3 (AD3) P P0.4 (AD4) P P0.

4-Megabit (512K x 8) 5-volt Only CMOS Flash Memory AT49F040 AT49F040T AT49F040/040T AT49F040/040T. Features. Description. Pin Configurations

8-bit Microcontroller with 2K Bytes Flash AT89C2051

8-bit Microcontroller with 2K Bytes Flash AT89C2051

32-megabit DataFlash + 4-megabit SRAM Stack Memory AT45BR3214B

DS1306. Serial Alarm Real Time Clock (RTC)

DataFlash. Application Note. Using Atmel s DataFlash. Introduction (AN-4)

PDIP P1.0 P P0.0 (AD0) P1.2 P P0.1 (AD1) P P0.2 (AD2) P P0.3 (AD3) P P0.4 (AD4) P P0.

DS1305EN. Serial Alarm Real-Time Clock

8-Bit Microcontroller with 8K Bytes QuickFlash Memory

8-bit Microcontroller with 4K Bytes Flash AT89C4051

Pm39LV512 / Pm39LV010 / Pm39LV020 / Pm39LV040

1-megabit (64K x 16) 5-volt Only Flash Memory AT49F1024A Features Description Pin Configurations

Pm39F010 / Pm39F020 / Pm39F040

AT45DB Megabit 2.7-Volt Only Serial DataFlash AT45DB041. Features. Description. Pin Configurations

DS1305EN. Serial Alarm Real-Time Clock

P1.0 P P0.0 (AD0) P1.2 P P0.1 (AD1) P P0.2 (AD2) P P0.3 (AD3) P P0.4 (AD4) P P0.

8051 Microcontroller

Battery-Voltage. 16K (2K x 8) Parallel EEPROMs AT28BV16. Features. Description. Pin Configurations

8-Bit CMOS Microcontorller

1 Megabit Serial Flash EEPROM SST45LF010

TSOP Top View Type 1 NC NC RDY/BUSY RESET NC NC NC VCC GND NC NC NC NC CS SCK/CLK SI* SO* NC NC

FlashFlex51 MCU SST89E564 / SST89V564 / SST89E554 / SST89V554

DS1305 Serial Alarm Real Time Clock (RTC)

Micron M25PE80 Serial Flash Memory

EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.

8-Megabit 5-volt Only Serial DataFlash AT45D081. Features. Description

1-Megabit (128K x 8) Low Voltage Paged Parallel EEPROMs AT28LV010

DS1306 Serial Alarm Real-Time Clock

Fremont Micro Devices, Inc.

AT28C16. 16K (2K x 8) CMOS E 2 PROM. Features. Description. Pin Configurations

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION

SOIC VCC RESET A11 A10 A9 A8 A7 A6 A5 A4 A12 A13 A14 A15 A16 A17 A18 A19 NC NC NC NC I/O0 RDY/BUSY I/O1 I/O7 I/O6 I/O5 I/O4 VCC I/O2 I/O3 GND GND

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

AT25PE40. 4-Mbit DataFlash-L Page Erase Serial Flash Memory ADVANCE DATASHEET. Features

DS1305 Serial Alarm Real-Time Clock

PIN ASSIGNMENT PIN DESCRIPTION

256K (32K x 8) 3-volt Only Flash Memory

2-Megabit (256K x 8) 5-volt Only CMOS Flash Memory AT29C020. Features. Description. Pin Configurations

8-megabit 2.5-volt or 2.7-volt DataFlash AT45DB081D

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

Amarjeet Singh. January 30, 2012

AT45DB021E. 2-Mbit DataFlash (with Extra 64-Kbits), 1.65V Minimum SPI Serial Flash Memory PRELIMINARY DATASHEET. Features

AT29C K (32K x 8) 5-volt Only CMOS Flash Memory. Features. Description. Pin Configurations

8XC51RA RB RC Hardware Description

8-Bit Microcontroller with 8K Bytes QuickFlash

Battery-Voltage. 256K (32K x 8) Parallel EEPROMs AT28BV256. Features. Description. Pin Configurations

DIP Top View VCC WE A17 NC A16 A15 A12 A14 A13 A8 A9 A11 A7 A6 A5 A4 A3 A2 A1 A0 I/O0 A10 CE I/O7 I/O6 I/O5 I/O4 I/O3 I/O1 I/O2 GND.

64-megabit 2.7V Dual-interface DataFlash

RM24C64C. 64Kbit 2.7V Minimum Non-volatile Serial Memory I 2 C Bus. Features. Description

1-Megabit (128K x 8) 5-volt Only Flash Memory AT29C010A. Features. Description. Pin Configurations

64K (8K x 8) Battery-Voltage Parallel EEPROM with Page Write and Software Data Protection AT28BV64B

2-megabit 2.7-volt Minimum DataFlash AT45DB021D

DS2430A 256-Bit 1-Wire EEPROM

16-megabit 2.7-volt Only Serial DataFlash AT45DB161

ATF20V8B. High Performance Flash PLD. Features. Block Diagram. Pin Configurations


DS1676 Total Elapsed Time Recorder, Erasable

1-megabit 2.7-volt Only Serial DataFlash AT45DB011. AT45DB011 Preliminary 16- Megabit 2.7-volt Only Serial DataFlash

Micron M25P40 Serial Flash Embedded Memory

address lines and a parallel interface, the Atmel DataFlash uses an Atmel RapidS serial interface to sequentially access its data. The simple sequenti

FEATURES. Single Power Supply Operation - Low voltage range: 2.70 V V

ACE24AC128 Two-wire Serial EEPROM

16-megabit 2.5-volt or 2.7-volt DataFlash AT45DB161D

CAT28C17A 16K-Bit CMOS PARALLEL EEPROM

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

4-Megabit (512K x 8) 5-volt Only 256-Byte Sector Flash Memory AT29C040A. Features. Description. Pin Configurations

power supply Tamper Detect function will detect possible data modification from outside magnetic

Micron M25P16 Serial Flash Embedded Memory

High Temperature 128MB SPI Serial Flash Memory Module

S25FL Family (Serial Peripheral Interface)

AT45DB041E. 4-Mbit DataFlash (with Extra 128-Kbits), 1.65V Minimum SPI Serial Flash Memory. Features

1-megabit (64K x 16) 5-volt Only Flash Memory AT49F1024 AT49F1025

GT34C02. 2Kb SPD EEPROM

DIP Top View A18 A16 A15 A12 A7 A6 A5 A4 A3 A2 A1 A0 I/O0 I/O1 I/O2 GND VCC A17 A14 A13 A8 A9 A11 A10 I/O7 I/O6 I/O5 I/O4 I/O3 VCC A18 A17

64K (8K x 8) Low-voltage Parallel EEPROM with Page Write and Software Data Protection AT28LV64B. 3-Volt, 64K E 2 PROM with Data Protection

AT45DB321E. Features. 32-Mbit DataFlash (with Extra 1-Mbits), 2.3V Minimum SPI Serial Flash Memory

Single-Wire, I/O Powered 1-Kbit (128 x 8) Serial EEPROM with a Unique, Factory-Programmed 64-Bit Serial Number

ACE24AC64 Two-wire Serial EEPROM

ACE24AC02A1 Two-wire Serial EEPROM

a Serial Peripheral Interace (SPI). Embedded RISC Microcontroller Core Peripheral

8 Mbit SPI Serial Flash SST25VF080

DS 1682 Total Elapsed Time Recorder with Alarm

Transcription:

Features Compatible with MCS-51 Products 128K Bytes of In-System Reprogrammable Flash data memory and 4K Bytes of Downloadable Flash Program Memory Endurance: 1,000 Write/Erase Cycles per Sector Data Retention: 10 Years Sector Programming: 128 Bytes/Sector Single 3.3V ± 10% Supply On-Chip 12 MHz oscillator Two-Level Program Memory Lock 256-Bytes Internal RAM 5 Programmable I/O Lines Serial Peripheral Interface (SPI) Channel Serial Program Downloading Dual Data Pointer Registers Description The is a low-voltage, highly integrated CMOS 8-bit microcomputer with 4K bytes of downloadable Flash program memory and 128K bytes of in-system reprogrammable Flash data memory. The device is manufactured using Atmel s high density Flash memory technology and is compatible with the industry-standard MCS-51 instruction set. The 128K bytes of on-chip Flash data memory are accessed as two 64K byte blocks. Bit 0 at SFR location 96H is used to select the active block. The MOVX instruction is used to read and write the data memory. Both the program and data memory arrays can be programmed by an external programmer. The downloadable Flash can be changed one page (128 bytes) at a time and is accessible through the SPI serial peripheral interface port. Holding RESET active forces the SPI bus into a slave input mode and allows the program memory to be written-from or read-to unless Lock Bit 2 has been activated. The functional operations of the 128K bytes Flash data memory are equivalent to those on the AT29LV010A 1M Bit Flash memory device. 8-Bit Microcontroller with 132K Bytes Flash Data Memory Pin Configurations SOIC Top View PLCC Top View GND TEST1 RESET SDI/P1.1 SDO/P1.0 TEST2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 VCC P1.2/DTR P1.3/SCK P1.4/DSR P1.0/SDO TEST2 5 6 7 8 9 10 11 12 13 P1.1/SDI RESET TEST1 GND VCC P1.2/DTR P1.3/SCK 4 3 2 1 32 31 30 14 15 16 17 18 19 20 29 28 27 26 25 24 23 22 21 P1.4/DSR 0921A-A 12/97 4-281

Block Diagram V CC GND 128K Flash RAM ADDR. REGISTER RAM 4K FLASH B REGISTER ACC STACK POINTER PROGRAM ADDRESS REGISTER TMP2 TMP1 BUFFER ALU PC IREMENTER PSW PROGRAM COUNTER RST TIMING AND CONTROL INSTRUCTION REGISTER DPTR PORT 1 LATCH SPI PORT PROGRAM LOGIC 12MHz OSC PORT 1 DRIVERS P1.0 - P1.4 4-282

Pin Description V CC Supply voltage. GND Ground. Port 1 Port 1 is a 5-bit bidirectional I/O port with internal pullups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pullups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (I IL ) because of the internal pullups. In addition, P1.0, P1.1, and P1.3 can be configured as the SPI data output, data input and shift clock input pins, as shown in the following table. Port Pin Alternate Functions P1.0 SDO (data output pin for SPI channel) P1.1 SDI (data input pin for SPI channel) P1.3 SCK (clock input pin for SPI channel) RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. TEST1 TEST1 is set to V CC during downloading of the Flash program or data memory. This pin can be left unconnected or tied to ground during normal operation. TEST2 Test input. This pin has no user available function and can be left unconnected or tied to ground. Special Function Registers A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table 1. Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0. Memory Control Register The MCON register contains the RDY/BSY flag and the most significant Flash address bit A16, for the 128K bytes of on-chip Flash data memory. SPI Registers Control and status bits for the Serial Peripheral Interface are contained in registers SPCR (shown in Table 3) and SPSR (shown in Table 4). The SPI data bits are contained in the SPDR register. Writing the SPI data register during serial data transfer sets the Write Collision bit, WCOL, in the SPSR register. The SPDR is double buffered for writing and the values in SPDR are not changed by Reset. Dual Data Pointer Registers To facilitate data transfer, two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H - 83H and DP1 at 84H - 85H. Bit DPS = 0 in SFR MCON selects DP0 and DPS = 1 selects DP1. The user should always initialize the DPS bit to the appropriate value before accessing the respective Data Pointer register. 4-283

Table 1. SFR Map and Reset Values 0F8H 0FFH 0F0H B 0F7H 0E8H 0EFH 0E0H ACC 0E7H 0D8H 0DFH 0D0H PSW SPCR 000X01XX 0D7H 0C8H 0CFH 0C0H 0C7H 0B8H 0BFH 0B0H 0B7H 0A8H 0A0H SPSR 0AFH 0A7H 98H 9FH 90H P1 XXX11111 MCON XXXXX010 97H 88H 8FH 80H DP0L DP0H DP1L DP1H 0000000 SPDR XXXXXXXX PCON 0XXX0000 87H 4-284

Table 2. MCON Memory Control Register MCON Address = 96H Reset Value = XXXX X010B - - - - - DPS RDY/BSY A16 Bit 7 6 5 4 3 2 1 0 Symbol DPS RDY/BSY A16 Function Data Pointer Register Select. DPS = 0 selects the first bank of Data Pointer Register, DP0, and DPS = 1 selects the second bank, DP1. DataFlash Ready/Busy Flag. This bit serves as the RDY/BSY flag in a Read-Only mode during DataFlash write. RDY/BSY = 1 means that the DataFlash is ready to be programmed. While programming operations are being executed, the RDY/BSY bit equals `0' and is automatically reset to `1' when programming is completed. Memory Block Select. A16 = 0 selects the lower 64K bytes DataFlash memory block. A16 = 1 selects the upper 64K bytes DataFlash block. Table 3. SPCR SPI Control Register SPCR Address = D5H Reset Value = 000X 01XXB SPIE SPE DORD - CPOL CPHA SPR1 SPR0 Bit 7 6 5 4 3 2 1 0 Symbol SPIE SPE DORD CPOL CPHA SPR0 SPR1 Function SPI Interrupt Enable. This bit, enables SPI interrupts: SPIE = 1 enable SPI interrupts. SPIE = 0 disables SPI interrupts. SPI Enable. SPI = 1 enables the SPI channel and connects SDO, SDI and SCK to pins P1.0, P1.1, and P1.3. SPI = 0 disables the SPI channel. Data Order. DORD = 1 selects LSB first data transmission. DORD = 0 selects MSB first data transmission. Clock Polarity. When CPOL = 1, SCK is high when idle. When CPOL = 0, SCK of the master device is low when not transmitting. Please refer to figure on SPI Clock Phase and Polarity Control. Clock Phase. The CPHA bit together with the CPOL bit controls the clock and data relationship between master and slave. Please refer to figure on SPI Clock Phase and Polarity Control. SPI Clock Rate Select. These two bits control the SCK rate of the device configured as master. SPR1 and SPR0 have no effect on the slave. The relationship between SCK and the oscillator frequency, F OSC., is as follows: SPR1 0 0 1 1 SPR0 0 1 0 1 SCK = F OSC. divided by 4 16 64 128 4-285

Table 4. SPSR SPI Status Register SPCR Address = AAH Reset Value = 000X 0000B SPIF WCOL Bit 7 6 5 4 3 2 1 0 Symbol SPIF WCOL Function SPI Interrupt Flag. When a serial transfer is complete, the SPIF bit is set and an interrupt is generated if SPIE = 1. The SPIF bit is cleared by reading the SPI status register with SPIF and WCOL bits set, and then accessing the SPI data register. Write Collision Flag. The WCOL bit is set if the SPI data register is written during a data transfer. During data transfer, the result of reading the SPDR register may be incorrect, and writing to it has no effect. The WCOL bit (and the SPIF bit) are cleared by reading the SPI status register with SPIF and WCOL set, and then accessing the SPI data register. Table 5. SPDR SPI Data Register SPDR Address = 86H Reset Value = unchanged SPD7 SPD6 SPD5 SPD4 SPD3 SPD2 SPD1 SPD0 Bit 7 6 5 4 3 2 1 0 Data Memory Flash and RAM The implements 128K bytes of on-chip Flash for data storage and 256 bytes of RAM. The upper 128 bytes of RAM occupy a parallel space to the Special Function Registers. That means the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128-bytes of RAM or the SFR space. Instructions that use direct addressing access SFR space. For example, the following direct addressing instruction accesses the SFR at location 086H (which is SPDR). MOV 086H, #data Instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 086H, accesses the data byte at address 086H, rather than SPDR (whose address is 086H). MOV @R0, #data Note that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space. The MOVX instructions are used to access the Flash data memory. Flash write cycles are self-timed and typically take 5 ms per 128-byte page. The progress of Flash write can be monitored by reading the RDY/BSY bit (read-only) in SFR MCON. RDY/BSY = 0 means programming is still in progress and RDY/BSY = 1 means Flash write cycle is completed and another write cycle can be initiated. 4-286

Serial Peripheral Interface The serial peripheral interface (SPI) allows high-speed synchronous data transfer between the and an SPI master. The SPI features include the following: Full-Duplex, 3-Wire Synchronous Data Transfer 2 MHz Bit Frequency (max.) LSB First or MSB First Data Transfer Four Programmable Bit Rates End of Transmission Interrupt Flag Write Collision Flag Protection The interconnection between master and slave CPU with SPI is shown in the following figure. The SCK pin is the clock input. Writing to the SPI data register of the master CPU starts the SPI clock generator, and the data written shifts out of the MOSI pin and into the SDI pin of the slave CPU. After shifting one byte, the SPI clock generator stops, setting the end of transmission flag (SPIF). If the SPI interrupt enable bit (SPIE) is set, an interrupt is requested. There are four combinations of SCK phase and polarity with respect to serial data, which are determined by control bits CPHA and CPOL. The SPI data transfer formats are shown in Figure 3 and Figure 4. Figure 1. SPI Block Diagram OSCILLATOR DIVIDER 4 16 64 128 SELECT SPI CLOCK (MASTER) MSB LSB 8/16-BIT SHIFT REGISTER READ DATA BUFFER CLOCK LOGIC CLOCK PIN CONTROL LOGIC SDO P1.0 SDI P1.1 SCK P1.3 SPIF WCOL SPR1 SPR0 SPI CONTROL SPE 8 SPIE SPE DORD CPOL CPHA SPR1 SPR0 SPE DORD SPI STATUS REGISTER SPI CONTROL REGISTER 8 8 SPI INTERRUPT REQUEST INTERNAL DATA BUS 4-287

Figure 2. SPI Master - Slave Interconnection MSB MASTER LSB MISO SDO MSB SLAVE LSB 8-BIT SHIFT REGISTER 8-BIT SHIFT REGISTER MOSI SDI SPI CLOCK GENERATOR SCK SS V CC SCK Figure 3. SPI Transfer Format with CPHA = 0 * Not defined but normally MSB of character just received. Figure 4. SPI Transfer Format with CPHA = 1 * Not defined but normally LSB of previously transmitted character. 4-288

Oscillator Characteristics An on-chip oscillator is provided with a minimum frequency of 12 MHz and maximum frequency of 15 MHz over the recommended operating conditions. Each CPU instruction cycle takes 12 oscillator cycles. Program Memory Lock Bits The has two lock bits that can be left unprogrammed (U) or can be programmed (P) to obtain the additional features listed in the following table. The self-timed lock bit programming operation typically takes 40 ms. Once programmed, the lock bits can only be unprogrammed with the Chip Erase operation. Lock Bit Protection Modes (1)(2) Program Lock Bits LB1 LB2 Protection Type 1 U U No internal memory lock feature. 2 P U Programming of the Flash memory is disabled. 3 P P Same as mode 2, but verify is also disabled. Notes: 1. U = Unprogrammed 2. P = Programmed Flash Programming Specification Both the 128K bytes Data and 4K bytes Code flash memory arrays can be programmed using the serial SPI bus while the RESET and TEST1 pins are pulled to V CC = 3.3V (±10%). Both memory arrays are organized in 128-byte sectors for programming and are written sector-by-sector, similar to the Atmel AT29LV010A. The serial interface consists of pins SCK (serial shift clock), SDI (serial input) and SDO (serial output). After RESET and TEST1 are set high, the Programming Enable instruction needs to be executed once before programming operations can occur. During device programming, pin TEST2 should be connected to Ground. An auto-erase cycle is built into the self-timed Page Write operation and there is no need to first execute the Chip Erase instruction. The Chip Erase operation is self-timed and typically takes 5 ms. Chip Erase turns the content of every flash memory location in both the Code and Data arrays into FFH. The Code and Data memory arrays have separate address spaces: 0000H to 0FFFH for Code memory and 00000H to 2FFFFH for Data memory. The maximum serial clock (SCK) frequency used during flash programming should be less than 500 KHz. The High time of SCK should be 1.5 µs minimum and Low time should be 0.5 µs minimum. DATA Polling The features DATA Polling to indicate the end of a page write cycle. During a write cycle, an attempted serial read of the last byte written will result in the complement of the written datum at bit D7. Once the write cycle has been completed, true data are valid on all output data bits, and the next write cycle may begin. DATA Polling may begin any time after a write instruction has been executed. Toggle Bit The Toggle Bit provides another method to detect completion of a programming cycle. During a page write or chip erase operation, successive attempts to read data from the memory will result in output bit D6 toggling between 1 and 0. Once the program cycle has completed, output data bit D6 will stop toggling and valid data will be presented. Examining the toggle bit may begin any time during a program cycle. Ready/Busy A third method to monitor the progress of programming is provided by the RDY/BSY output signal. Pin P1.4/DSR is pulled Low during programming to indicate BUSY and is pulled High again when programming is done to indicate READY. Page Write The Code and Data memory arrays are programmed on a sector basis. If a byte of data is to be changed, data for the entire 128-byte sector must be serially loaded into the device using the appropriate serial interface instruction. The data in any byte that is not loaded during the programming of its sector will be indeterminate. The automatically does a sector erase to turn the whole sector into FFH prior to loading the data into the sector. An erase command is not required. The self-timed Page Write cycle typically takes 5 ms (t WC ). (continued) 4-289

Once the bytes of a sector are loaded into the device, they are simultaneously programmed during the self-timed programming cycle (t WC ). After the first data byte has been loaded into the device, successive bytes need to be entered within 300-µs time intervals. If a Page Write instruction is not detected in 300-µs after the last write instruction, the load period will end and the internal programming cycle will start. Address bits A7 - A11 and A7 - A16 specify the sector address of the Code and Data memory arrays, respectively. The valid sector address must be entered during each write instruction. Address bits A0 - A6 specify the byte address within the sector. The bytes may be loaded in any order, sequential loading is not required. Once a programming operation has been initiated, and for a duration of typically 5 ms, a read operation will effectively be a polling operation. Program Verify If lock bits LB1 and LB2 have not been programmed, the programmed Code and Data byte can be read back via serial output pin SDO. The state of the lock bits can only be verified indirectly by observing that the lock bit features are enabled. Serial Programming Instruction Set Format Instruction Programming Enable Byte 1 Byte 2 Byte 3 Byte 4 10101100 01010011 11111111 11111111 Chip Erase 10101100 10000000 xxxxxxxx xxxxxxxx Read Code Memory Page Write Code Memory Read Data Memory 0010000x 0100000x 1010000 Page Write Data Memory 1100000 A16 A16 xxxx xxxx A11 A10 A9 A8 A11 A10 A9 A8 A15 A14 A13 A12 A11 A10 A9 A8 A15 A14 A13 A12 A11 A10 A9 A8 Notes: 1. A16:A0 = Memory byte address 2. DDDDDDDD = Data input at pin SDI or data output at pin SDO. 3. x = Don t care. A7 A6 A5 A4 A3 A2 A1 A0 A7 A6 A5 A4 A3 A2 A1 A0 A7 A6 A5 A4 A3 A2 A1 A0 A7 A6 A5 A4 A3 A2 A1 A0 DDDDDDDD DDDDDDDD DDDDDDDD DDDDDDDD Program Lock Bits 10101100 111000 xxxxxxxx xxxxxxxx Read Signature 0011000x xxxxxxxx LB2 LB1 x A6 A5 A4 A3 A2 A1 A0 DDDDDDDD Operation Enable Serial Programming after RST goes high. Chip erase both 128K & 4K memory arrays. Read data at pin SDO for Code memory at address A11:A0. Write data at pin SDI for Code memory at address A11:A0. Read data at pin SDO for Data memory at address A16:A0. Write data at pin SDI for Data memory at address A16:A0. Set LB1, LB2 = 0 to program lock bits. Read device I.D. at address A6:A0. 4-290

Flash Memory Serial Programming Circuit 3.3V INSTRUCTION INPUT DATA OUTPUT SDI/P1.1 SDO/P1.0 VCC RESET TEST1 CLOCK IN SCK/P1.3 RDY/BUSY DSR/P1.4 TEST2 GND Reading the Signature Bytes The signature bytes are read by executing the Read Signature command at locations 30H and 31H. The values returned are as follows: (30H) = 1EH indicates manufactured by Atmel (31H) = 84H indicates Serial Downloading Waveforms SERIAL CLOCK INPUT SCK/P1.3 7 6 5 4 3 2 1 0 SERIAL DATA INPUT SDI/P1.1 MSB LSB SERIAL DATA OUTPUT SDO/P1.0 MSB LSB 1ST INSTRUCTION 2ND INSTRUCTION BYTE 1 BYTE 2 BYTE 3 BYTE 4 BYTE 1 BYTE 2 BYTE 3 BYTE 4 t BLC = 300 µs MAX. 4-291

Absolute Maximum Ratings* Operating Temperature... -55 C to +125 C Storage Temperature... -65 C to +150 C Voltage on Any Pin with Respect to Ground...-1.0V to +7.0V Maximum Operating Voltage... 6.0V *NOTICE: Stresses beyond those listed under Absolute Maximum Ratings may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. DC Output Current... 15.0 ma DC Characteristics The values shown in this table are valid for T A = -40 C to 85 C and V CC = 3.0V to 3.6V, unless otherwise noted. Symbol Parameter Condition Min Max Units V IL Input Low Voltage -0.5 0.2 V CC - 0.1 V V IH Input High Voltage (Except RST) 0.2 V CC + 0.9 V CC + 0.5 V V IH1 Input High Voltage (RST) 0.7 V CC V CC + 0.5 V V OL Output Low Voltage (1) I OL = 1.6 ma 0.5 V I OH = -60 µa 2.4 V V OH I IL Output High Voltage Logical 0 Input Current I OH = -25 µa 0.75 V CC V I OH = -10 µa 0.9 V CC V V IN = 0.45V -50 µa I TL Logical 1 to 0 Transition Current V IN = 2V -650 µa RRST Reset Pulldown Resistor 50 300 KΩ C IO Pin Capacitance Test Freq. = 1 MHz, T A = 25 C 10 pf I CC Power Supply Current Active Mode 20 ma Notes: 1. Under steady state (non-transient) conditions, I OL must be externally limited as follows: Maximum I OL per port pin: 10 ma Maximum I OL per 5 bit port: 15 ma If I OL exceeds the test condition, V OL may exceeed the related specification. Pins are not guaranteed to sink current greater than the listed test conditions. 2. Minimum V CC for Power Down is 2V. 4-292

Ordering Information Speed (MHz) Power Supply Ordering Code Package Operation Range 12 3.3V ± 10% -12JC -12RC -12JI -12RI 32J 28R 32J 28R Commercial (0 C to 70 C) Industrial (-40 C to 85 C) Package Type 32J 28R 32-Lead, Plastic J-Leaded Chip Carrier (PLCC) 28-Lead, Plastic Gull Wing Small Outline (SOIC) 4-293