| поискавой системы для электроныых деталей |
|
AN1302 датащи(PDF) 2 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
AN1302 датащи(HTML) 2 Page - Microchip Technology |
|
2 / 8 page ![]() AN1302 DS01302A-page 2 2009 Microchip Technology Inc. BASIC OPERATION The basic functionality of a bootloader is to receive, interpret and execute a set of commands known both by the host software and the target firmware. The command set can be more or less complex than shown in the application note, but it must generally support commands to read, erase and write the Flash memory. Additionally, it must support a command to jump from the bootloader code to the application code. This command is typically issued at the end of a program/verify cycle. The application code might require a command to exit the application code and enter the bootloader code. ERASING PROGRAM MEMORY The program memory can be erased under software control only in rows of instructions. A row consists of 32 instruction words of program memory. Please note that the address must be aligned to a 32-word boundary (EEADRL <4:0> = 0 0 0 0). Because the erase sequence can modify existing data, the special unlock sequence is needed. The unlock sequence consists in consecutive write values 0x55, 0xAA to the EECON2 register. UPDATING PROGRAM MEMORY Before writing to the program memory, an erase operation should be performed. The program memory is written in blocks. A block consists of 8 words of program memory data with sequential address, aligned to an 8-word boundary (EEADRL <2:0> = 0 0 0). If smaller blocks of memory need to be modified, then a read-modify-erase program approach should be used, as the program memory can only be written in 8-word blocks. An erase operation sets the value of 0x3FFF to all erased locations. This corresponds to an all-ones in binary. BOOTLOADER COMMANDS The bootloader firmware used in this design supports a set of commands used to read, erase and write to the Flash memory of the target device. The commands are shown in Table 1. TABLE 1: BOOTLOADER COMMANDS Command Name Read/Write Description 0x01 Set/Get Address Pointer R/W Sets/Reads the Address Pointer. Data is written/read in two bytes format, MSB first. 0x02 Download data to internal buffer -/W 8 words of data are downloaded from the host into an internal buffer. Data is downloaded MSB first starting from the lower address. This command is usually followed by a Write command (0x05). 0x03 Read Flash command R/- Reads 8 words from the Flash memory starting with the address specified by the Address Pointer. The Address Pointer is automatically incremented by 8 words upon a read. 0x04 Erase Flash command R/- Erases a row of 32 words starting with the address specified by the Address Pointer. The Address Pointer must be aligned to a 32-word boundary (0x0000, 0x0020, 0x0040, 0x0060……). The Address Pointer is automatically advanced by 32 words. This command uses clock stretching and returns a dummy 0x00 byte after command completion. 0x05 Write Flash command R/- The data that is stored into the buffer is written into the Flash memory at the address pointed to by the Address Pointer. The Address Pointer is automatically incremented by 8 words upon a successful write. This command uses clock stretching and returns a dummy 0x00 byte after command completion. 0x06 Jump to application code R/- Usually used after a successful firmware download. The application resets itself and jumps to the application segment. This command uses clock stretching and returns a dummy 0x00 byte after command completion. |
|
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |