programming ATMEGA324PB with avrdude

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

SITUATION :

I've recently done a new homemade board (very basic) in atmega324pb (I was on atmega2561 before) and tried programming it but here is the problem !

I'm using atmel studio 7.0, which recognize this microcontroller so the code is well configured/compiled. I use avrdude (and a USBASP) to upload the code in all my previous project but here, avrdude doesn't know this new microcontroller 324PB. I tried to upload with the m324pa configuration but of course I had an output error of unexpected device signature...

 

SOLUTION TRIED :

I found the avrdude.conf file which describe every devices configuration recognized by avrdude. I saw that it would be possible to add a new device directly by editing a new configuration here so that's what I've tried. I took the ATMEGA324PA configuration paragraph (the most similar device in this list) and edit a new one for the 324PB, here it is :

 

#------------------------------------------------------------
# ATmega324PA
#------------------------------------------------------------

# similar to ATmega324P

part parent "m324p"
    id               = "m324pa";
    desc             = "ATmega324PA";
    signature        = 0x1e 0x95 0x11;

    ocdrev              = 3;
  ;

#------------------------------------------------------------
# ATmega324PB
#------------------------------------------------------------

# similar to ATmega324P

part parent "m324p"
    id               = "m324pb";
    desc             = "ATmega324PB";
    signature        = 0x1e 0x95 0x17;

    ocdrev              = 3;
  ;

I replaced the name, id and signature with the 324PB signature (found in the output signature error message).

 

Now, when uploading from atmelstudio with avrdude, the 324PB is recognized and the process seams to be sucessfull (no error message), but my board doesn't react to any simple command.

I saw that I could edit a better configuration for my device if I would have found the device configuration XML file but I didn't...

 

QUESTION : help !

Does anybody already tried to do that ?

Is there an other way to do it ?

 

I hope I've been clear, 

Thank you very much in advance !

 

Ian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ian_ISS wrote:
Is there an other way to do it ?
The preferred way : -C +filename

-C for avrdude.conf, +filename extends the configuration controlled avrdude.conf

searched for mega324PB; it's not in the current AVRDUDE (not surprising as mega328PB appears to be more popular than mega324PB in third party boards)

http://svn.savannah.gnu.org/viewvc/avrdude/trunk/avrdude/avrdude.conf.in?revision=1422&view=markup (lines 13 thru 15)

http://download.savannah.gnu.org/releases/avrdude/avrdude-doc-6.3.pdf (page 12 for -C, second paragraph)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ian_ISS wrote:
I saw that I could edit a better configuration for my device if I would have found the device configuration XML file but I didn't...
the XML is the .atdf files by the ones at Microchip for Atmel Studio 7 and MPLAB X v5.

Can try an atdf reader and run mega324PB through it to confirm the data in post #1.

Vagrearg - Atmel Pack - parser, visualizer, fuse calculator given Atmel Packs (for Atmel Studio 7)

due to AtPack: Atmel Pack parser, visualizer and fuse calculator – Dangerous Prototypes

 

edit :

ATmega324PB - 8-bit PIC Microcontrollers

https://www.microchip.com/mymicrochip/Reports.aspx?type=cpn&filter=ATmega324PB

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Jan 27, 2020 - 12:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ian_ISS wrote:
... but my board doesn't react to any simple command.
If that pin's signal is spare, program CKOUT  (reason: confirm the oscillator you've selected does start)

Review your hardware design and implementation versus the reference mega324PB design in AVR042 (VCC and GND for that pair, AVCC and GND for that pair, clock, reset, if high frequency oscillator then the correct crystal or resonator, etc)

If can acquire a debugger then consider JTAG.

 

https://docs.microchip.com/ContentDelivery/web/content.xql?pub=DS40001908&lang=en-US&action=topic&xslmode=print&docid=GUID-4DBF67A9-4B03-4570-8DD2-F42E9DAC1B75

https://docs.microchip.com/ContentDelivery/web/content.xql?pub=AVR_Microcontroller_Hardware_Design_Considerations&lang=en-US&action=topic&xslmode=print&docid=GUID-B77B8B59-3D31-463D-9EA8-5163EF6712D3 (Figure 4)

 

edit : AVR042 :

AVR® Microcontroller Hardware Design Considerations

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Jan 27, 2020 - 11:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

For reference here is a Makefile that shows how I use avrdude -C

 

https://github.com/epccs/Gravimetric/blob/master/Applications/Bootloader/Makefile#L102

 

And the config file, note the clock fail fuse bit is also added to efuse bit 3 (same is on 328pb).

 

https://github.com/epccs/Gravimetric/blob/master/Applications/lib/avrdude/324pb.conf

my projects: https://github.com/epccs

Debugging is harder than programming - don’t write code you can’t debug! https://www.avrfreaks.net/forum/help-it-doesnt-work