AT89C5130A-M Atmel Corporation, AT89C5130A-M Datasheet

no-image

AT89C5130A-M

Manufacturer Part Number
AT89C5130A-M
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of AT89C5130A-M

Flash (kbytes)
16 Kbytes
Max. Operating Frequency
48 MHz
Cpu
8051-12C
Max I/o Pins
34
Usb Transceiver
1
Usb Speed
Full Speed
Usb Interface
Device
Spi
1
Twi (i2c)
1
Uart
1
Sram (kbytes)
1.25
Eeprom (bytes)
1024
Self Program Memory
API
Operating Voltage (vcc)
2.7 to 5.5
Timers
4
Isp
UART/USB
Watchdog
Yes
Features
Description
This document describes the USB bootloader functionalities as well as the USB proto-
col to efficiently perform operations on the on-chip Flash (EEPROM) memories.
Additional information on the AT89C5131A product can be found in the AT89C5131A
datasheet and the AT89C5131A errata sheet available on the Atmel web site.
The bootloader software package (binary) currently used for production is available
from the Atmel web site.
Bootloader Revision
Revision 1.0.2
Revision 1.2.0
Protocol
In-System Programming
In-Application Programming/Self Programming (IAP)
– USB Used as Physical Layer
– Device Firmware Upgrade Class Compliant
– USB Clock Auto-Configuration
– Read/Write Flash and EEPROM Memories
– Read Device ID
– Full-chip Erase
– Read/Write Configuration Bytes
– Security Setting from ISP Command
– Remote Application Start Command
– Read/Write Flash and EEPROM Memories
– Read Device ID
– Block Erase
– Read/Write Configuration Bytes
– Bootloader Start
Purpose of Modifications
First release
Bootloader improvement
Date
25/03/2003
20/03/2007
USB
Microcontrollers
AT89C5131A
USB Bootloader
4287E–USB–04/08

Related parts for AT89C5130A-M

AT89C5130A-M Summary of contents

Page 1

Features • Protocol – USB Used as Physical Layer – Device Firmware Upgrade Class Compliant – USB Clock Auto-Configuration • In-System Programming – Read/Write Flash and EEPROM Memories – Read Device ID – Full-chip Erase – Read/Write Configuration Bytes – ...

Page 2

Functional The AT89C5131A bootloader facilitates In-System Programming and In-Application Programming. Description In-System In-System Programming allows the user to program or reprogram a microcontroller on-chip Flash memory without removing it from the system and without the need of a pre-programmed Programming ...

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 USB proto- col (see section “Protocol”). This process translates ...

Page 4

Mapping and Default The 4 MSB of the Hardware Byte can be read/written by software (this area is called Fuse bits). Value of Hardware The 4 LSB can only be read by software and written by hardware in parallel mode ...

Page 5

In-System ISP allows the user to program or reprogram a microcontroller’s on-chip Flash memory through the USB bus without removing it from the system and without the need of a pre-programmed Programming application. This section describes how to start the ...

Page 6

Port3 • Port4 (only bit0 and bit1) The Hardware Condition configuration are stored in three bytes called P1_CF, P3_CF, P4_CF. These bytes can be modified by the user through a set of API or through an ISP command. There ...

Page 7

Software Boot The default value [FF]00h is used in ISP mode. The boot address is, in this mode, the lowest adress of FM1 USB bootloader. Vector The Software Boot Vector (SBV) can be used to force the execution of a ...

Page 8

Figure 3. High-pin Count Regular Boot Process lica tio n AT89C5131A USB Bootloader ardw are C ondition N o ...

Page 9

Figure 4. Low-pin Count Regular Boot Process Yes Start Application 4287E–USB–04/08 AT89C5131A USB Bootloader RESET ENBOOT = 0 Yes PC = 0000h BLJB = 1 No P1_CF = FFh No P1_CF = P1 Yes No P3_CF = P3 BSB = ...

Page 10

Physical Layer The USB norm specifies all the transfers over the USB line. The USB specification also includes several CLASS and SUB-CLASS specifications. These stand-alone documents are used by the manufacturer to implement a USB link between a PC and ...

Page 11

Figure 6. 48 MHz Frequency Auto-Configuration 4287E–USB–04/08 AT89C5131A USB Bootloader No No Resume Detected? Yes Yes USB Scheduler MAIN USB Connected? Suspend/Resume Yes Configure PLL for Frequency X Configure Timer 0 SOF Detected Timer 0 Overflow? Yes Change ...

Page 12

Protocol Device Firmware Device Firmware Upgrade is the mechanism for accomplishing the task of upgrading the device Upgrade Introduction firmware. Any class of USB device can exploit this capability by supporting the requirements specified in this document. Because it is ...

Page 13

Table 3. DFU Mode Device Descriptor Offset Field 0 bLength 1 bDescriptorType 2 bcdUSB 4 bDeviceClass 5 bDeviceSubClass 6 bDeviceProtocol 7 bMaxPacketSize0 8 idVendor 10 idProduct 12 bcdDevice 14 iManufacturer 15 iProduct 16 iSerialNumber 17 bNumConfigurations DFU Configuration This descriptor ...

Page 14

DFU Functional Descriptor Table 5. DFU Functional Descriptor Offset Field 0 bLength 1 bDescriptorType 2 bmAttributes 3 wDetachTimeOut 5 wTransferSize Command Description This protocol allows to: • Initiate the communication • Program the Flash or EEPROM Data • Read the ...

Page 15

Device Status Get Status The Host employs the DFU_GETSTATUS request to facilitate synchronization with the device. This status gives information on the execution of the previous request: in progress/OK/Fail/... bmRequestType bRequest 1010 0001b DFU_GETSTATUS (3) 0010 0001b DFU_CLRSTATUS (4) The ...

Page 16

Table 7. bStatus values (Continued) Status Value errUSBR 0x0C errPOR 0x0D errUNKNOWN 0x0E errSTALLEDPK 0x0F Table 8. bState Values Clear Status Any time the device detects an error and reports an error indication status to the host in the response ...

Page 17

Device State This request solicits a report about the state of the device. The state reported is the current state of the device with no change in state upon transmission of the response. The values specified in the bState field ...

Page 18

Request From Host Write Command The write command is 6 bytes long. In order to reach the USB specification of the Control type transfers, the write command is completed with non-significant bytes. The total length ...

Page 19

Figure 7. Example of Firmware Download Zero Length DFU_DNLOAD Request SETUP OUT OUT OUT OUT IN The Host sends a DFU_DNLOAD request with the wLength field cleared the device to indicate that it has completed transferring the ...

Page 20

Reading the Flash The flow described below allows the user to read data in the Flash memory or in the EEPROM data memory. A blank check command on the Flash memory is possible with this flow. or EEPROM Data This ...

Page 21

Answers from the The Host controller send a GET_STATUS request to the device. Once internal blank check has Device to a Blank Check been completed, the device sends its status. Command • If the device status is “OK”: the device ...

Page 22

Reading Configuration 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 ...

Page 23

Answers from The device has two possible answers to a DFU_GETSTATUS request: Bootloader • If the chip is protected from program access, an “err_VENDOR” status is returned to the Host. • Otherwise, the device status is “OK“. The Host can ...

Page 24

Answers from The device has two possible answers to a DFU_GETSTATUS request: Bootloader • If the chip is protected from program access, a “err_WRITE” status is returned to the Host. • Otherwise, the device status is “OK“. The full chip ...

Page 25

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 Application Programming Interface (API) routines allowing IAP. elf These API ...

Page 26

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 27

Read Configuration • Parameter settings and Manufacturer API Name Information __api_rd_HSB __api_rd_BSB __api_rd_SBV __api_rd_P1_CF __api_rd_P3_CF __api_rd_P4_CF __api_rd_SSB __api_rd_EB __api_rd_manufacturer __api_rd_device_id1 __api_rd_device_id2 __api_rd_device_id3 __api_rd_bootloader_version • Instruction: LCALL FFC0h. • At the complete API execution by the bootloader, the value to read ...

Page 28

Program • Parameter settings Configuration API Name Information __api_clr_BLJB __api_set_BLJB __api_clr_X2 __api_set_X2 __api_clr_OSCON1 __api_set_OSCON1 __api_clr_OSCON0 __api_set_OSCON0 __api_wr_BSB __api_wr_SBV __api_wr_P1_CF __api_wr_P3_CF __api_wr_P4_CF __api_wr_SSB __api_wr_EB • instruction: LCALL FFC0h. Notes: Erasing the Flash The AT89C5131A Flash memory is divided in several blocks: ...

Page 29

Starting the This routine allows to start at the beginning of the bootloader as after a reset. After calling this Bootloader routine the regular boot process is performed and the communication must be opened before any action. • No special ...

Page 30

Appendix-A Table 10. Summary of Frames from Host Command Identifier data[0] 00h Id_prog_start 01h 01h 00h Id_display_data 01h 03h 02h 00h Id_write_command 04h 01h 02h 03h AT89C5131A USB Bootloader 30 data[1] data[2] data[3] start_address end_address start_address end_address 00h 20h 40h ...

Page 31

Table 10. Summary of Frames from Host (Continued) Command Identifier data[0] 00h Id_read_command 05h 01h 02h Table 11. DFU Class-specific Requests Table 12. USB Parameters Table 13. Hardware Security Byte (HSB) 4287E–USB–04/08 AT89C5131A USB Bootloader data[1] data[2] data[3] 00h 01h ...

Page 32

Appendix-2 Table 14. 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_clr_BLJB __api_set_BLJB __api_clr_X2 __api_set_X2 __api_clr_OSCON1 __api_set_OSCON1 __api_clr_OSCON0 __api_set_OSCON0 __api_rd_BSB __api_wr_BSB __api_rd_SBV __api_wr_SBV __api_erase_SBV __api_rd_P1_CF __api_wr_P1_CF __api_rd_P3_CF __api_wr_P3_CF __api_rd_P4_CF __api_wr_P4_CF __api_rd_SSB __api_wr_SSB __api_rd_EB __api_wr_EB ...

Page 33

Table 14. API Summary (Continued) Function Name __api_wr_code_page __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 __api_start_isp 4287E–USB–04/08 AT89C5131A USB Bootloader Bootloader Execution api_command yes 01h yes 05h yes 05h yes 0Eh api_dph api_dpl api_value 60h ...

Page 34

... 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 ...

Related keywords