AT89C51SND1_06 ATMEL [ATMEL Corporation], AT89C51SND1_06 Datasheet

no-image

AT89C51SND1_06

Manufacturer Part Number
AT89C51SND1_06
Description
USB Microcontrollers
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
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 memory. Additional
information on the AT89C51SND1 product can be found in the AT89C51SND1
datasheet and the AT89C51SND1 errata sheet available on the Atmel web site.
The bootloader software (binary file) currently used for production is available from the
Atmel web site.
Bootloader Revision
Revisions 1.6.2 and higher
Protocol
In-System Programming
In-Application Programming/Self-Programming
– USB Used as a Physical Layer
– Device Firmware Upgrade Class Compliant
– Auto-Frequency Detection
– Read/Write Flash Memory
– Read Device ID
– Full-chip Erase
– Read/Write Configuration Bytes
– Security Setting from ISP Command
– Remote Application Start Command
– Read/Write Flash Memory
– Read Device ID
– Block Erase
– Read/Write Configuration Bytes
– Bootloader Start
Purpose of Modifications
First release
Date
3/25/2003
USB
Microcontrollers
AT89C51SND1
USB Bootloader
4254C–MP3–03/06

Related parts for AT89C51SND1_06

AT89C51SND1_06 Summary of contents

Page 1

Features • Protocol – USB Used as a Physical Layer – Device Firmware Upgrade Class Compliant – Auto-Frequency Detection • In-System Programming – Read/Write Flash Memory – Read Device ID – Full-chip Erase – Read/Write Configuration Bytes – Security Setting ...

Page 2

Functional The AT89C51SND1 USB Bootloader facilitates In-System Programming (ISP) and In-Applica- tion Programming. Description In-System In-System Programming allows the user to program or reprogram the microcontroller on-chip Programming Flash memory without removing it from the system and without the need ...

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”, page 12). This ...

Page 4

Security The bootloader has Software Security Byte (SSB see or ISP access. The Software Security Byte (SSB) protects from ISP accesses. The command ‘Program Soft- ware Security Bit’ can only write a higher priority level. There are three levels of ...

Page 5

Software Boot The Software Boot Vector (SBV see at address [SBV]00h in the application area (FM0). Vector The way to start this user bootloader is described in Section “Bootloader Configuration”. Application FLIP Software FLIP software program running ...

Page 6

In-System The ISP allows the user to program or reprogram the 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 2. Boot Process Algorithm 4254C–MP3–03/06 RESET Hard Cond? ISP Prog Cond? BLJB = P? Standard Init Prog Cond Init ENBOOT = 0 ENBOOT = 0000h PC = F000h FCON = F0h FCON = F0h ...

Page 8

Registers Special Function Table 4. AUXR1 Register Register AUXR1 (S:A2h) – Auxiliary Register Bit Number Reset Value = XXXX 00X0b Note: Hardware Bytes Table 5. HSB Byte – ...

Page 9

Note: Table 6. SBV Byte – Software Boot Vector 7 ADD15 Bit Number 7-0 Reset Value = XXXX XXXX, UUUU UUUU after an hardware full chip erase. Table 7. SSB Byte – Software Security Byte 7 SSB7 Bit Number 7-0 ...

Page 10

MHz Frequency The following table shows the allowed frequencies compatible with the USB bootloader 48 MHz Auto-generation auto-generation. AT89C51SND1 10 12 MHz MHz 20 MHz OK OK 4254C–MP3–03/06 ...

Page 11

Figure 4. 48 MHz Frequency Auto-generation 4254C–MP3–03/ Resume Detected? Yes Yes USB Scheduler AT89C51SND1 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

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 10. DFU Mode Device Descriptor Offset DFU Configuration This descriptor is identical to the standard configuration descriptor described in the USB DFU Descriptor specification version ...

Page 14

DFU Functional Descriptor Table 12. DFU Functional Descriptor Offset Command Description This protocol allows to: • Initiate the communication • Program the Flash Data • Read the Flash Data • Program Configuration Information • Read ...

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 1010 0001b 0010 0001b The device responds to the DFU_GETSTATUS ...

Page 16

Table 14. bStatus Values (Continued) Status errVENDOR errUSBR errPOR errUNKNOWN errSTALLEDPK Table 15. bState Values appDETACH dfuDNLOAD-SYNC dfuDNBUSY dfuDNLOAD-IDLE dfuMANIFEST-SYNC dfuMANIFEST dfuMANIFEST-WAIT- dfuUPLOAD-IDLE dfuERROR Clear Status Any time the device detects an error and reports an error indication status to ...

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

Table 16. DFU File Suffix Offset - Request from Host bmRequestType 0010 0001b Write Command Command Identifier Id_prog_start The write command is 6 bytes long. In order to reach the USB specification of the Control type transfers, ...

Page 19

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

Command Identifier Id_display_data Second Request from The Host sends a DFU Upload request. Host Answers from the The device send to the Host the firmware from the specified start address to the end address. Device SETUP OUT ...

Page 21

Programming The flow described below allows the user to program Configuration Information regarding the bootloader functionality. Configuration Information • Boot Process Configuration: – – – Ensure that the Program Fuse bit command programs the 4 Fuse bits at the same ...

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, a “err_VENDOR” status is returned to the Host. • Otherwise, the device status is “OK“. The Host can ...

Page 24

Erasing the Flash The flow described below allows the user to erase the Flash memory. Two modes of Flash erasing are possible: • Full chip erase • Block erase The Full Chip erase command erases the whole Flash (32 Kbytes) ...

Page 25

Starting the The flow described below allows to start the application directly from the bootloader upon a spe- cific command reception. Application Two options are possible: • Start the application with a reset pulse generation (using watchdog). When the device ...

Page 26

In-Application The IAP allows to reprogram the 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 27

API Commands Several types of APIs are available: • Read/Program Flash memory • Read Configuration and Manufacturer Information • Program Configuration Information • Erase Flash • Start bootloader Read/Program Flash To read the Flash memory the bootloader is not involved. ...

Page 28

Read Configuration • Parameter settings and Manufacturer API Name Information __api_rd_HSB __api_rd_BSB __api_rd_SBV __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 is in the ...

Page 29

Program • Parameter settings Configuration API Name Information __api_clr_BLJB __api_set_BLJB __api_clr_X2 __api_set_X2 __api_wr_BSB __api_wr_SBV __api_wr_SSB __api_wr_EB • Instruction: LCALL FFC0h. Notes: Erasing the Flash The AT89C51SND1 Flash memory is divided into four blocks: Block 0: from address 0000h to 1FFFh ...

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 Table 18. DFU Class-specific Requests bmRequestType 0010 0001b AT89C51SND1 30 data[0] data[1] 00h start_address 01h 00h start_address 03h 01h 00h 20h 00h 40h 80h FFh ...

Page 31

Table 18. DFU Class-specific Requests bmRequestType 0010 0001b 1010 0001b 1010 0001b 0010 0001b 1010 0001b 0010 0001b 4254C–MP3–03/06 bRequest wValue DFU_DNLOAD (1) wBlock DFU_UPLOAD (2) wBlock DFU_GETSTATUS (3) Zero DFU_CLRSTATUS (4) Zero DFU_GETSTATE (5) Zero DFU_ABORT (6) Zero AT89C51SND1 ...

Page 32

Appendix B Flash API Routines Table 19. 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_erase block3 __api_rd_HSB __api_clr_BLJB __api_set_BLJB __api_clr_X2 __api_set_X2 __api_rd_BSB __api_wr_BSB __api_rd_SBV __api_wr_SBV __api_erase_SBV __api_rd_SSB __api_wr_SSB __api_rd_EB __api_wr_EB __api_rd_manufacturer __api_rd_device_id1 __api_rd_device_id2 __api_rd_device_id3 ...

Page 33

Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131, USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Regional Headquarters Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland Tel: (41) 26-426-5555 Fax: (41) 26-426-5500 Asia Room 1219 ...

Related keywords