Unformatted text preview: e avr910.asm for a
complete listing of supported devices Table 5. Part Number Identification Examples
Part Family and Flash Size Part Number Part $90 $01 AT90S1200 $91 $01 AT90S2313 $92 $01 AT90S4414 $93 $01 AT90S8515 $FF $FF Device Code Erased (or Target Missing) $01 $02 Device Locked Table 6. Example, Reading the Device Code From an AT90S1200, Code $1E 90 01 Expected
Read Vendor Code at Address $00
Read Part Family and Memory Size at $01
Read Part Number at Address $02 Flash Program
Memory Access MOSI, Sent to
Target AVR MISO, Returned from
Target AVR $30 xx 00 yy $zz 30 xx 1E $30 nn 01 mm $yy 30 nn 90 $30 xx 02 yy $mm 30 xx 01 When the part has been identified, it is time to start accessing the Flash memory. A Chip Erase
should be performed before programming the Flash memory. Depending on the target device
the Flash is programmed using “Byte” or “Page” mode.
For devices with Byte Programming mode each Flash location is dressed and programmed individually. In Page Programming mode, a temporary Page buffer is first filled, and then
programmed in one single write cycle. This mode reduces the total Flash programming time. A
device will only have one of these modes available. A device with Byte Programming mode do
not have the Page Programming option. A device with Page Programming mode of the Flash
will, however, use byte programming for the EEPROM memory.
Regardless if the device uses Byte Programming mode or Page Programming mode the Flash
will be read one byte at the time using the “Read Flash Program Memory” command. The command sends a memory address ($aa bb) to select a 16-bit word, and selects low or high byte
with the H bit in the command byte (0 is low, 1 is high byte). The byte stored at this address is
then returned from the target AVR microcontroller in byte 4.
Usually, each 16-bit word in Flash contains one AVR instruction. Assuming the instruction stored
at address $104 is “add r16,r17”, the op-code for this instruction would be stored as $0F01.
Reading address $104 serially, the expected result returned in byte 4 will be $0F from the high 6 AVR910
byte, and $01 from the low byte. The data on the MISO and MOSI lines will look like shown in
Writing to the Flash memory will, however, differ depending on the available programming
For devices using Byte Programming mode bytes are written with the “Write Program Flash
Memory” command. This command sends a memory address ($aa bb) to select a 16-bit word,
and selects low or high byte with the H bit (0 is low, 1 is high byte). The byte to be stored is then
sent to the target AVR microcontroller in byte 4.
For devices using Page Programming mode the Flash is programmed in two steps. First a temporary Page buffer is filled using the “Load Program Memory Page” command. Each byte in this
buffer can be directly accessed. Once the entire Page buffer is filled, it can be written to the
Flash Memory using the “Write Program M...
View Full Document
- Three '12
- Atmel AVR, target avr