AT89C51AC2 Atmel Corporation, AT89C51AC2 Datasheet
AT89C51AC2
Specifications of AT89C51AC2
Available stocks
Related parts for AT89C51AC2
AT89C51AC2 Summary of contents
Page 1
... Purpose of Modifications Revision 1.2.0 First release Revisions 1.4.0 New command supported - EEPROM access - Start application - Extra Byte access - 128 bytes page Flash programming - New boot process Revision 1.4.1 Standardization of tasks in source program. 80C51 Microcontrollers AT89C51AC2 T89C51AC2 UART Bootloader Date 23/04/2001 02/11/2001 20/03/2007 4231D–CAN–03/08 ...
Page 2
Functional The A/T89C51AC2 Bootloader facilitates In-System Programming and In-Application Programming. Description In-System In-System Programming (ISP) allows the user to program or reprogram a microcontroller’s on- chip Flash memory without removing it from the system and without the need of a ...
Page 3
ISP Communication The purpose of this process is to manage the communication and its protocol between the on- Management chip bootloader and an external device (host). The on-chip bootloader implements a Serial pro- tocol (see Section “Protocol”, page 9). This ...
Page 4
Mapping and Default The 4 Most Significant Byte (MSB) of the Hardware Byte can be read/written by software (this Value of Hardware area is called Fuse bits). The 4 Least Significant Byte (LSB) can only be read by software and ...
Page 5
Software Boot The Software Boot Vector (SBV) forces the execution of a user bootloader starting at address [SBV]00h in the application area (FM0). Vector The way to start this user bootloader is described in the section “Boot Process”. Figure 2. ...
Page 6
In-System The ISP allows the user to program or reprogram a microcontroller’s on-chip Flash memory through the serial line without removing it from the system and without the need of a pre-pro- Programming grammed application. This section describes how to ...
Page 7
Figure 3. Regular Boot Process Start Application 4231D–CAN–03/08 A/T89C51AC2 UART Bootloader RESET Hardware Condition No ENBOOT = 0 Yes PC = 0000h BLJB = 1 No FCON = 00h No SBV < F8h Yes Start User Bootloader Bit ENBOOT in ...
Page 8
Physical Layer The UART used to transmit information has the following configuration: • Character: 8-bit data • Parity: none • Stop: 2 bit • Flow control: none • Baud rate: autobaud is performed by the bootloader to compute the baud ...
Page 9
Protocol Overview An initialization step must be performed after each Reset. After microcontroller reset, the boot- loader waits for an autobaud sequence (see Section “Autobaud Performances”). When the communication is initialized the protocol depends on the record type issued by ...
Page 10
Frequency (MHz) Baudrate (kHz) 38400 57600 115200 Command Data All commands are sent using the same flow. Each frame sent by the host is echoed by the Stream Protocol bootloader. Figure 5. Command Flow Host Sends first character of the ...
Page 11
Programming the The flow described below shows how to program data in the Flash memory or in the EEPROM Flash or EEPROM data memory. Data The bootloader programs on a page of 128 bytes basis when it is possible. The ...
Page 12
Read the Flash or The flow described below allows the user to read data in the Flash memory or in the EEPROM EEPROM Data data memory. A blank check command is possible with this flow. The device splits into blocks ...
Page 13
Flow Description: Blank Check Command Host Send Blank Check Command OR Wait Checksum Error COMMAND ABORTED Wait COMMAND_OK OR COMMAND FINISHED Wait Address not erased COMMAND FINISHED Example 4231D–CAN–03/08 A/T89C51AC2 UART Bootloader Blank Check Command ’X’ & CR & LF ...
Page 14
Flow Description: Read Command Host Send Display Command OR Wait Checksum Error COMMAND ABORTED OR Wait Security Error COMMAND ABORTED Wait Display Data All Data Read COMMAND FINISHED Example A/T89C51AC2 UART Bootloader 14 Display Command ’X’ & CR & LF ...
Page 15
Program The flow described below allows the user to program Configuration Information regarding the Configuration bootloader functionality. Information The Boot Process Configuration: – – – – – Requests from Host Command Name Erase SBV & BSB Program SSB level1 Program ...
Page 16
Flow Description Host Send Write Command OR Wait Checksum Error COMMAND ABORTED OR Wait Security Error COMMAND ABORTED Wait COMMAND_OK COMMAND FINISHED Program Configuration Example A/T89C51AC2 UART Bootloader 16 Write Command ’X’ & CR & LF ’P’ & CR & ...
Page 17
Read Configuration The flow described below allows the user to read the configuration or manufacturer information. Information or Manufacturer Information Requests from Host Read Manufacturer Code Read Product Name Read Product Revision Read HSB (Fuse bit) Read Bootloader version Note: ...
Page 18
Flow Description Host Send Read Command OR Wait Checksum Error COMMAND ABORTED OR Wait Security Error COMMAND ABORTED Wait Value of Data COMMAND FINISHED Read Example Flash Erase The flow described below allows the user to erase the Flash memory. ...
Page 19
Requests from Host Erase block0 (0K to 8K) Erase block1 (8K to 16K) Erase block2 (16K to 32K) Answers from As the Program Configuration Information flows, the erase block command has three possible Bootloader ...
Page 20
Start the Application The flow described below allows to start the application directly from the bootloader upon a spe- cific command reception. Two options are possible: • Start the application with a reset pulse generation (using watchdog). When the device ...
Page 21
In-Application The IAP allows to reprogram a microcontroller on-chip Flash memory without removing it from the system and while the embedded application is running. Programming/S The user application can call some Application Programming Interface (API) routines allowing elf- IAP. These ...
Page 22
API Commands Several types of APIs are available: • Read/Program Flash and EEPROM Data memory • Read Configuration and Manufacturer Information • Program Configuration Information • Erase Flash • Start bootloader Read/Program Flash All routines to access EEPROM Data are ...
Page 23
Instruction: LCALL FFF0h. • At the complete API execution by the bootloader, the value to read is in the api_value variable. Note: Program • Parameter Settings Configuration Information • Instruction: LCALL FFF0h. Note: 4231D–CAN–03/08 A/T89C51AC2 UART Bootloader ...
Page 24
Erase Flash The A/T89C51AC2 flash memory is divided in several blocks: Block 0: from address 0000h to 1FFFh Block 1: from address 2000h to 3FFFh Block 2: from address 4000h to 7FFFh These three blocks contain 128 pages. • Parameter ...
Page 25
Appendix-A Table 3. Summary of Frames From Host Command Program Nb Data Byte in Flash. Erase block0 (0000h-1FFFh) Erase block1 (2000h-3FFFh) Erase block2 (4000h-7FFFh) Start application with a reset pulse generation Start application with a jump at “address” Erase SBV ...
Page 26
Appendix-B Table 4. API Summary Function Name __api_rd_code_byte __api_wr_code_byte __api_wr_code_page __api_erase_block0 __api_erase_block1 __api_erase_block2 __api_rd_HSB __api_set_X2 __api_clr_X2 __api_set_BLJB __api_clr_BLJB __api_rd_BSB __api_wr_BSB __api_rd_SBV __api_wr_SBV __api_erase_SBV __api_rd_SSB __api_wr_SSB_level0 __api_wr_SSB_level1 __api_wr_SSB_level2 __api_rd_EB __api_wr_EB __api_rd_manufacturer __api_rd_device_id1 __api_rd_device_id2 __api_rd_device_id3 __api_rd_bootloader_version __api_eeprom_busy __api_rd_eeprom_byte __api_wr_eeprom_byte __api_start_bootloader A/T89C51AC2 UART ...
Page 27
... Datasheet Revision History 4231A - 04/ Bit stop for the UART protocol added. 4231B 12/03 4231B 12/ Added AT89C51AC2 part number. 4213C 03/05 4213C 03/ Updated Bootloader version. 4213D 03/08 4231D–CAN–03/08 A/T89C51AC2 UART Bootloader 27 ...
Page 28
... Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. © 2008 Atmel Corporation. All rights reserved. Atmel Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. International Atmel Asia ...