AT89C5132-ROTIL Atmel, AT89C5132-ROTIL Datasheet
![IC 8051 MCU FLASH 64K USB 80TQFP](/photos/12/13/121358/313-80-tqfp_sml.jpg)
AT89C5132-ROTIL
Specifications of AT89C5132-ROTIL
Available stocks
Related parts for AT89C5132-ROTIL
AT89C5132-ROTIL Summary of contents
Page 1
... This document describes the USB bootloader functionalities as well as the USB proto- col to efficiently perform operations on the on-chip Flash memory. Additional information on the AT89C5132 product can be found in the AT89C5132 datasheet and the AT89C5132 errata sheet available on the Atmel web site. The bootloader software (binary file) currently used for production is available from the Atmel web site ...
Page 2
... Functional The AT89C5132 USB Bootloader facilitates In-System Programming (ISP) and In-Application Programming. Description In-System In-System Programming allows the user to program or reprogram the microcontroller on-chip Flash memory without removing it from the system and without the need of a pre-programmed Programming application. Capability The USB bootloader can manage a communication with a host through the USB bus. It can also access and perform requested operations on the on-chip Flash memory ...
Page 3
... U 4 – reserved U 2 LB2 P 1 LB1 U 0 LB0 U U: Unprogrammed = 1 P: Programmed = 0 AT89C5132 Description To start in x1 mode To map the boot area in code area between F000h-FFFFh To lock the chip (see datasheet) Default Value FFh FOh FFh FFh 58h D7h F7h DFh 3 ...
Page 4
... Flash Fuse bit BSB & SBV & EB SSB Manufacturer info Bootloader info Erase block Full chip erase Blank Check AT89C5132 4 Level 0 Level 1 Any access allowed Read only access allowed Any access allowed Read only access allowed Any access allowed Any access allowed ...
Page 5
... Atmel Flash microcontrollers and USB protocol communication media. Program This free software program is available from the Atmel web site. 4256B–USB–03/06 Table 6) forces the execution of a user bootloader starting User Bootloader [SBV]00h FM0 AT89C5132 USB Bootloader FM1 ® ® 9x/Me/2000/XP and LINUX that sup- 5 ...
Page 6
... The programmed condition is based on the Bootloader Jump Bit (BLJB) in HSB (see Condition Boot As shown in Figure 2, this bit is programmed (by hardware or software programming mode), the Mapping chip reset set ENBOOT and forces the reset vector to F000h instead of 0000h, in order to exe- cute the bootloader software. AT89C5132 6 Table 4). The three ways to Table 5). ...
Page 7
... Prog Cond? BLJB = P? Standard Init Prog Cond Init ENBOOT = 0 ENBOOT = 0000h PC = F000h FCON = F0h FCON = F0h Hard Init? FCON = 00h? User Boot? SBV < F0h? User’s User’s Application Bootloader AT89C5132 Hard Cond Init ENBOOT = F000h FCON = 00h Atmel’s Bootloader 7 ...
Page 8
... This bit is stuck to logic 0 to allow INC AUXR1 instruction without affecting GF3 flag. - Reserved for Data Pointer Extension. Data Pointer Select Bit DPS Set to select second data pointer: DPTR1. Clear to select first data pointer: DPTR0. 1. ENBOOT bit is only available in AT89C5132 product BLJB - Bit Mnemonic ...
Page 9
... MHz for USB controller: frequency auto-detection performed by the bootloader. 4256B–USB–03/06 1. X2B initializes the X2 bit in CKCON during the reset phase order to ensure boot loader activation at first power-up, AT89C5132 products are delivered with BLJB programmed. 3. Bits (LSN) can only be programmed by hardware mode. ...
Page 10
... MHz Frequency The following table shows the allowed frequencies compatible with the USB bootloader 48 MHz Auto-generation auto-generation. AT89C5132 10 12 MHz MHz 20 MHz OK OK 4256B–USB–03/06 ...
Page 11
... Figure 4. 48 MHz Frequency Auto-generation 4256B–USB–03/ Resume Detected? Yes Yes USB Scheduler AT89C5132 MAIN USB Connected? Suspend/Resume Yes Configure PLL for Frequency X Configure Timer 0 SOF Detected Timer 0 Overflow? Yes Change Frequency 11 ...
Page 12
... DFU_ABORT (6) Zero Parameter Vendor ID Product ID Release Number wIndex wLength Data Interface (4) Zero none Interface (4) Length Firmware Interface (4) Length Firmware Interface (4) 6 Status Interface (4) Zero none Interface (4) 1 State Interface (4) Zero none ATMEL – AT89C5132 Bootloader 0x03EB 0x2FFF 0x0000 4256B–USB–03/06 ...
Page 13
... Details concerning other possible uses of alternate settings are beyond the scope of this document. However, their use is intentionally not AT89C5132 Description Size of this descriptor, in bytes ...
Page 14
... Program Configuration Information • Read Configuration and Manufacturer Information • Erase the Flash • Start the application Overview of the protocol is detailed in Appendix-A. AT89C5132 14 restricted because it is anticipated that implementers will devise additional creative uses for alternate settings. Field Size Value bLength ...
Page 15
... DFU_DNLOAD and the subsequent solicitation of the device’s status via DFU_GETSTATUS. An indication of the state that the device is going to enter immediately following transmission of this response. Index of status description in string table. AT89C5132 Data 6 Status Zero none ...
Page 16
... DFU_CLRSTATUS request. Upon receipt of DFU_CLRSTATUS, the device sets a status of OK and transitions to the dfuIDLE state. Only then it is able to transition to other states. bmRequestType 0010 0001b AT89C5132 16 Value Description 0x0B ...
Page 17
... DFU_GETSTATE (5) bRequest wValue DFU_ABORT (6) Zero Field Size dwCRC 4 bLength 1 ucDfuSignature 3 bcdDFU 2 idVendor 2 AT89C5132 wValue wIndex wLength Zero Interface (4) 1 wIndex wLength Interface (4) 0 Value Description Number The CRC of the entire file, excluding dwCRC 16 The length of this DFU suffix including dwCRC 5: 44h ...
Page 18
... Flash page start_address [32]. For example, if the start address is 00AFh (175d 175 [32] = 15. DFU Suffix The DFU suffix of 16 bytes are added just after the last byte to program. This suffix is reserved for future use. AT89C5132 18 Field Size idProduct ...
Page 19
... First Request from Host The Host sends a DFU Download request with a Display command in the data field. 4256B–USB–03/06 DFU_DNLOAD Prog_Start + (EP0 FIFO length - 6) x 00h X offset bytes + Firmware Packet 1 Firmware Packet 2 Firmware Packet n + DFU suffix ZLP DFU_DNLOAD SETUP Display_Data (6 bytes) OUT ZLP IN AT89C5132 19 ...
Page 20
... Host request. • If the device status is “ the device memory is not blank. The device waits for an DFU_UPLOAD request to send the first address where the byte is not 0xFF. AT89C5132 20 data[0] data[1] 00h ...
Page 21
... Security Byte”, page 3). SETUP OUT IN data[0] data[1] 00h 01h 01h 05h 04h 06h 02h 00h AT89C5132 DFU_DNLOAD Write_command (6 bytes) ZLP data[2] data[3] data[4] Write value in BSB Write value in SBV Value Write value in SSB Write value in EB Value Write value in Fuse (HSB) ...
Page 22
... The flow described below allows the user to read the configuration or manufacturer information. Information or Manufacturer Information Requests from Host To start the programming operation, the Host sends DFU_DNLOAD request with the Read com- mand in the data field (2 bytes). Command Identifier Id_read_command AT89C5132 22 SETUP OUT IN data[0] data[1] 00h 00h ...
Page 23
... If the chip is protected from program access, a “err_VENDOR” status is returned to the Host. • Otherwise, the device status is “OK“. The Host can send a DFU_UPLOAD request to the device in order the value of the requested field. 4256B–USB–03/06 DFU_UPLOAD SETUP Byte value (1 byte) IN ZLP OUT AT89C5132 23 ...
Page 24
... BSB = FFh • SBV = FFh • SSB = FFh (NO_SECURITY) The Block erase command erases only a part of the Flash. Four Blocks are defined in the AT89C5132: • block0 (from 0000h to 1FFFh) • block1 (from 2000h to 3FFFh) • block2 (from 4000h to 7FFFh) • ...
Page 25
... Request from Host Command Identifier Id_write_command Answer from Bootloader No answer is returned by the device. 4256B–USB–03/06 SETUP IN OUT SETUP data[0] data[1] 00h 04h 03h 01h AT89C5132 DFU_UPLOAD Jump option ( bytes) ZLP DFU_UPLOAD data[2] data[3] data[4] address – Description Hardware reset LJMP address 25 ...
Page 26
... The interrupts are not disabled by the bootloader. Interrupts must be disabled by user prior to jump to the USER_CALL, then re-enabled when returning. The user must take care of hardware watchdog before launching a Flash operation. For more information regarding the Flash writing time see the AT89C5132 datasheet. AT89C5132 26 4256B–USB–03/06 ...
Page 27
... Erase Flash • Start bootloader Read/Program Flash To read the Flash memory the bootloader is not involved. Memory For more details on these routines see the AT89C5132 Datasheet section “Program/Code Memory”. Two routines are available to program the Flash: – – • The application program load the column latches of the Flash then call the __api_wr_code_byte or __api_wr_code_page see the datasheet section “ ...
Page 28
... Instruction: LCALL FFC0h. • At the complete API execution by the bootloader, the value to read is in the api_value variable. Note: AT89C5132 28 api_command 08h 05h 05h 05h 05h 05h 05h 05h 05h 0Eh No special resources are used by the bootloader during this operation ...
Page 29
... No special resources are used by the bootloader during these operations. api_command 00h 00h 00h 00h 1. Refer to the AT89C5132 datasheet for information on Write operation Timing, then multiply this timing by the number of pages special resources are used by the bootloader during these operations. AT89C5132 api_dph api_dpl api_value (HSB & ...
Page 30
... Appendix A Table 17. Summary of Frames from Host Command Identifier Id_prog_start Id_display_data Id_write_command Id_read_command AT89C5132 30 data[0] data[1] 00h start_address 01h 00h start_address 03h 01h 00h 20h 00h 40h 80h FFh 00h 04h 01h 01h 05h 06h 02h 00h 00h 03h 01h 00h 00h ...
Page 31
... DFU_DETACH (0) wTimeout DFU_DNLOAD (1) wBlock DFU_UPLOAD (2) wBlock DFU_GETSTATUS (3) Zero DFU_CLRSTATUS (4) Zero DFU_GETSTATE (5) Zero DFU_ABORT (6) Zero AT89C5132 wIndex wLength Data Interface (4) Zero none Interface (4) Length Firmware Interface (4) Length Firmware Interface (4) 6 Status Interface (4) Zero none ...
Page 32
... AT89C5132 32 Bootloader Execution api_command no yes 0Dh yes 0Dh yes 00h yes 00h yes 00h yes 00h yes 08h yes 07h ...
Page 33
... Atmel does not make any commitment to update the information contained herein. Unless specifically providedot- herwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel’sAtmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. © ...