3 Jul 2012

How a .hex file is written in the microcontroller

AC530000  --> program enable
AC800000  --> chip erase
40000ioo  --> load program memory page low  
010000000 0000xxxx xxx 0 0000 iiiiiiii
                                              |          |__________data in
                                              |__________________load at address

Write data i to Program memory page at word address b. Data Low byte must be loaded before Data High byte is applied within the same address
                                      
48000ioo  --> load program memory page high

4c00 3f 00--> write program memory page       
01001100 0000 0000 001 xxxxx xxxxxxxx
                                 |_______ write at this address
                            
280 03f 00--> read program meory at word address
00101000 0000 aaaa bbbbbbbb  oooooooo
                                     |                        |______ data out
                                     |___________________ at word address

300000000-->read signature bits
300000100                                
300000200                        
00110000 00xxxxxx xxxxxx aa oooooooo                                 
                                              |          |____ out signature
                                              |________address of the signature

Programming Enable                                     $AC $53 $00 $00
Chip Erase (Program Memory/EEPROM)     $AC $80 $00 $00

 Poll RDY/BSY                                                $F0 $00 $00 data byte out
Load Extended Address byte(1)                     $4D $00 Extended adr $00

Load Program Memory Page, High byte       $48 adr MSB adr LSB high data byte in
Load Program Memory Page, Low byte        $40 adr MSB adr LSB low data byte in
Load EEPROM Memory Page (page access)(1)$C1 $00 adr LSB data byte in

Read Program Memory, High byte                   $28 adr MSB adr LSB high data byte out
Read Program Memory, Low byte                    $20 adr MSB adr LSB low data byte out
Read EEPROM Memory     $A0 adr MSB adr LSB data byte out
Read Lock bits                    $58 $00 $00 data byte out
Read Signature Byte           $30 $00 0000 000aa data byte out
Read Fuse bits                     $50 $00 $00 data byte out
Read Fuse High bits            $58 $08 $00 data byte out
Read Extended Fuse Bits    $50 $08 $00 data byte out
Read Calibration Byte         $38 $00 $0b00 000bb data byte out

Write Program Memory Page   $4C 000a aaaa aa00 0000 $00
Write EEPROM Memory           $C0 adr MSB adr LSB data byte in
Write EEPROM Memory Page (page access)  $C2 adr MSB adr LSB $00
Write Lock bits                          $AC $E0 $00 data byte in
Write Fuse bits                          $AC $A0 $00 data byte in
Write Fuse High bits                 $AC $A8 $00 data byte in
Write Extended Fuse Bits         $AC $A4 $00 data byte in

you can check the sample writting of the programmer into the microcontroller:

click here 

You won't get this until you see the above link . if you don't get please put a comment ok. i will be more specific. 

No comments:

Post a Comment