Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Can i programm the atmega48pa with avrdude? I have problems with the signature ...

% avrdude -pm48 -cavrisp2 -Pusb -V -U flash:w:main.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e920a
avrdude: Expected signature for ATMEGA48 is 1E 92 05
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

I have add some new lines to the avrdude.conf in /etc -directory

[...]
part
    id               = "m48pa";
    desc             = "ATMEGA48PA";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
                     0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
                     0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode   = 0x59;
    signature        = 0x1e 0x92 0x0a;
[...]

but now i get a another error

avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable.

Edit - 1

Here some debugging information with "-vvv":

% avrdude -pm48pa -cavrisp2 -Pusb -F -vvv -U flash:w:main.hex

avrdude: Version 5.10, compiled on Apr  3 2010 at 18:48:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/silvio/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200030996
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: stk500v2_getsync(): found AVRISP mkII programmer
         AVR Part                      : ATMEGA48PA
         Chip Erase delay              : 45000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no        256    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6    64    0 yes      4096   64     64  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.10
         Vtarget         : 5.0 V
         SCK period      : 100.37 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e920a
avrdude: safemode read 1, lfuse value: 62
avrdude: safemode read 2, lfuse value: 62
avrdude: safemode read 3, lfuse value: 62
avrdude: safemode: lfuse reads as 62
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: safemode read 1, efuse value: 1
avrdude: safemode read 2, efuse value: 1
avrdude: safemode read 3, efuse value: 1
avrdude: safemode: efuse reads as 1
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (2336 bytes):

Writing | ################################################## | 100% 8.54s

avrdude: 2336 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 2336 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 8.26s

avrdude: verifying ...
avrdude: 2336 bytes of flash verified

avrdude: safemode read 1, lfuse value: 62
avrdude: safemode read 2, lfuse value: 62
avrdude: safemode read 3, lfuse value: 62
avrdude: safemode: lfuse reads as 62
avrdude: safemode read 1, hfuse value: df
avrdude: safemode read 2, hfuse value: df
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: safemode read 1, efuse value: 1
avrdude: safemode read 2, efuse value: 1
avrdude: safemode read 3, efuse value: 1
avrdude: safemode: efuse reads as 1
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Question

Can someone help me to flash a atmega48pa aith a avrispmkii

share|improve this question
    
Do you still have any problems? According to your final output log, everything worked correctly. –  davr Jul 26 '10 at 20:20
    
No I don't have problems anymore ... Thanks to all for helping. –  silvio Aug 9 '10 at 22:11

1 Answer 1

up vote 3 down vote accepted

You are doing:

% avrdude -pm48 -cavrisp2 -Pusb -V -U flash:w:main.hex

You should be doing:

% avrdude -pm48pa -cavrisp2 -Pusb -V -U flash:w:main.hex

And in your edit 1 you are using the correct -p flag and it also seems to work. :)

share|improve this answer
2  
It's also worth noting that newer versions of avrdude have the newer chip configurations included, so check for updates there too. –  Peter Gibson Jul 27 '10 at 0:05
    
Peter, looking at the latest source in SVN, I cannot find a definition for the m48pa chip (i.e. 0x1e 0x92 0x0A identifier)... –  Benoit Miller Aug 4 '10 at 1:27
    
As a follow-up, adding the new lines to the avrdude config file allowed me to successfully program my ATMEGA48PA (using -p m48pa) firmware and fuses. Thanks silviof! –  Benoit Miller Aug 4 '10 at 2:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.