ATMEGA4809-PF Programming with AVRdude

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

Hello everyone,

 

The question would be related to new AVR line from Microchip, the Atmega 4809-PF. I was wondering if someone here have tried to use the regular AVRdude 6.3, or 5.5 or any other version, and the #include <avr/io.h> header file to program the device as it is normally done by the other ATmegas, (328, 1284p, or any other device populated inside the header file) mention above.

Basically my plan is to follow the exactly same procedure of programming  ATmega4809-PF, as I would any other AVR. Would this still be possible?

 

Thanks in advance

 

Greetings

This topic has a solution.

work in progress...

Last Edited: Fri. Jan 24, 2020 - 08:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I doubt if Avrdude v5.5 knows about UPDI.

 

But Avrdude v6.3 can use :

-c atmelice_updi

-c jtag2updi

-c powerdebugger_updi

-c xplainedpro_updi

 

What programmer hardware do you own?

 

I suspect that future avrdude might support PICKIT4 and SNAP.

 

David.

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

Hello David and  thanks for the information,

Currently I've got a Atmel AVR Mk2 ISP programmer, and have additionally an arduino Uno setup as ISP programmer.

Mostly I program "avrdude -p m1284p -c avrisp -P com4 -b 19200"

 

 

work in progress...

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

Your AVRISP-mk2 does not support UPDI.

 

Google for "UPDI Uno" and you get https://github.com/SpenceKonde/megaTinyCore/blob/master/MakeUPDIProgrammer.md

 

You upload the software to your Uno.   And then use avrdude -c jtag2updi

 

Making a permanent UPDI programmer from a Nano looks like a good idea.

 

Personally,   I would just buy a SNAP,  PICKIT4 or ATMEL-ICE.   And then you get full debugging for all AVR, ARM and PIC chips.

 

David.

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

maybe for the first run I will turn my Uno into UPDI programmer, and afterwards, Atmel -ICE would be a nice option to have. As you already mentioned it does cover all the range from AVR, SAMs, and now also the megaAVRs.

 

Do you think it will be possible to use the Atmel -ICE with a make files, or it is binded to the AS7 IDE environment.

Thanks a for sharing the information.

 

work in progress...

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ATMEL-ICE can be driven by avrdude.  i.e. Makefile.

 

You can also use Microchip command line tools e.g. atprogram.exe

 

Yes,  it seems wise to try the Uno first.

 

atprogram.exe supports:
 

  -t  --tool <arg>           Tool name: avrdragon, avrispmk2, avrone, jtagice3,
                             jtagicemkii, qt600, stk500, stk600, samice, edbg,
                             medbg, nedbg, atmelice, pickit4, snap,
                             powerdebugger, megadfu or flip.

So you can buy the cheap SNAP or PICKIT4.    Note that you need to make your own ribbon cables.

 

David.

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

There are a couple of other projects that use an Arduino as a UPDI programmer:

https://github.com/ElTangas/jtag...

https://github.com/MCUdude/micro...

 

Or you could take the part of the Nano Every circuit that uses a SAMD11 running the MuxTO firmware.

 

Of course, if you burn a serial bootloader, then the standard avrdude approach applies.

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

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

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

david.prentice wrote:
You can also use Microchip command line tools e.g. atprogram.exe
in addition, IPECMD in MPLAB IPE should work with MPLAB X MDB for a debugger.

https://www.avrfreaks.net/forum/trouble-flashing-attiny3217-xplained-pro-board-mdb#comment-2834981

https://microchipdeveloper.com/search:site/a/p/q/MDB/

MPLAB® IPE - Developer Help

 

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

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

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

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

Good Morning,

 

I'm personally unable to spot the advantages of this new UPDI programming method, if the data is clocked over a single line, does'nt it make the in-system programming process longer?.

Despite the fact that the 3 SPI GPIOs are free on target device, what else makes any resaonable difference. By the way, in regular ISP-programming mode does not interfere with the device attached to SPI Bus, if I am not wrong.
 

 

 

work in progress...

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

Dave_Zeb. wrote:
I'm personally unable to spot the advantages of this new UPDI programming method
Dave_Zeb. wrote:
if the data is clocked over a single line,
Surely you just answered your own question?

 

ISP takes 3 pins, JTAG takes 4. An interface (presumably inspired by earlier debugWire) that uses just 1 pin is surely the supposed advantage. More pins a re left for your application? presumably you would not have picked to use a 40/48 pin chip in your design if you did not intend to use pretty much all of those pins? (smaller/cheaper "cut down" versions are available in the AVR-0/AVR-1 families)

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

Dave_Zeb. wrote:
if the data is clocked over a single line, does'nt it make the in-system programming process longer?.
No

4ms/page for page erase and write

128B/page

8b/B * 128B/page * 1page/4ms = 256000b/s

Atmel-ICE UPDI is up to 750Kb/s

(don't know MPLAB PICkit 4's UPDI speed)

flash write is the long pole in the tent

Dave_Zeb. wrote:
what else makes any resaonable difference.
XMEGA PDI can reach 30MHz though that would be via an FPGA and may cause effects due to arbitration

(bus matrix masters : CPU, Prog/Debug Controller (PDI), DMAC)

PDI and UPDI share instructions; both are available for moving data to and from memory.

 


ATMEGA4809 - 8-bit Microcontrollers

Features | Atmel-ICE

 

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

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

Dave_Zeb. wrote:
unable to spot the advantages of this new UPDI programming method

 

It is UART based; maybe I need to repeat that a few times. UART, UART, UART. Those things work everywhere.

 

Some adventures fool might even figure out how to make it work over RS-485 transceivers, perhaps even multidrop with no bootloader on the target. The more I think about it, the more interesting it sounds.

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

david.prentice wrote:

But Avrdude v6.3 can use :

-c atmelice_updi

-c jtag2updi

-c powerdebugger_updi

-c xplainedpro_updi

 

I have avrdude 6.3 but it does not know atmelice_updi programmer !

doom@doom-PC:~$ avrdude -v

avrdude: Version 6.3
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

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

avrdude: no programmer has been specified on the command line or the config file
         Specify a programmer using the -c option and try again

doom@doom-PC:~$ avrdude -c atmelice_updi

avrdude: Can't find programmer id "atmelice_updi"

Valid programmers are:
  2232HIO          = FT2232H based generic programmer
  4232h            = FT4232H based generic programmer
  89isp            = Atmel at89isp cable
  abcmini          = ABCmini Board, aka Dick Smith HOTCHIP
  alf              = Nightshade ALF-PgmAVR, http://nightshade.homeip.net/
  arduino          = Arduino
  arduino-ft232r   = Arduino: FT232R connected to ISP
  atisp            = AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> 
  atmelice         = Atmel-ICE (ARM/AVR) in JTAG mode
  atmelice_dw      = Atmel-ICE (ARM/AVR) in debugWIRE mode
  atmelice_isp     = Atmel-ICE (ARM/AVR) in ISP mode
  atmelice_pdi     = Atmel-ICE (ARM/AVR) in PDI mode
  avr109           = Atmel AppNote AVR109 Boot Loader
  avr910           = Atmel Low Cost Serial Programmer
  avr911           = Atmel AppNote AVR911 AVROSP

 

Did I miss something ?

 

D.

AVR inside

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

It looks as if my avrdude is coming from the regular Arduino install.

If I call it with a .BAT file


C:\Users\David Prentice\Documents\Arduino>"C:\Users\David Prentice\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino16"\bin\avrdude.exe -C"C:\Users\David Prentice\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino16"\etc\avrdude.conf -v

avrdude.exe: Version 6.3-20171130
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "C:\Users\David Prentice\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino16\etc\avrdude.conf"

And if I ask for -c? I get:


Valid programmers are:
  2232HIO          = FT2232H based generic programmer
  4232h            = FT4232H based generic programmer
  89isp            = Atmel at89isp cable
  abcmini          = ABCmini Board, aka Dick Smith HOTCHIP
  alf              = Nightshade ALF-PgmAVR, http://nightshade.homeip.net/
  arduino          = Arduino
  arduino-ft232r   = Arduino: FT232R connected to ISP
  arduinoisp       = Arduino ISP Programmer
  arduinoisporg    = Arduino ISP Programmer
  atisp            = AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/>
  atmelice         = Atmel-ICE (ARM/AVR) in JTAG mode
  atmelice_dw      = Atmel-ICE (ARM/AVR) in debugWIRE mode
  atmelice_isp     = Atmel-ICE (ARM/AVR) in ISP mode
  atmelice_pdi     = Atmel-ICE (ARM/AVR) in PDI mode
  atmelice_updi    = Atmel-ICE (ARM/AVR) in UPDI mode
  avr109           = Atmel AppNote AVR109 Boot Loader
  avr910           = Atmel Low Cost Serial Programmer
  avr911           = Atmel AppNote AVR911 AVROSP
  avrftdi          = FT2232D based generic programmer
  avrisp           = Atmel AVR ISP
  avrisp2          = Atmel AVR ISP mkII
  avrispmkII       = Atmel AVR ISP mkII
  avrispv2         = Atmel AVR ISP V2
  bascom           = Bascom SAMPLE programming cable
  blaster          = Altera ByteBlaster
  bsd              = Brian Dean's Programmer, http://www.bsdhome.com/avrdude/
  buspirate        = The Bus Pirate
  buspirate_bb     = The Bus Pirate (bitbang interface, supports TPI)
  butterfly        = Atmel Butterfly Development Board
  butterfly_mk     = Mikrokopter.de Butterfly
  bwmega           = BitWizard ftdi_atmega builtin programmer
  C232HM           = FT232H based module from FTDI and Glyn.com.au
  c2n232i          = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts
  dapa             = Direct AVR Parallel Access cable
  dasa             = serial port banging, reset=rts sck=dtr mosi=txd miso=cts
  dasa3            = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts
  diecimila        = alias for arduino-ft232r
  dragon_dw        = Atmel AVR Dragon in debugWire mode
  dragon_hvsp      = Atmel AVR Dragon in HVSP mode
  dragon_isp       = Atmel AVR Dragon in ISP mode
  dragon_jtag      = Atmel AVR Dragon in JTAG mode
  dragon_pdi       = Atmel AVR Dragon in PDI mode
  dragon_pp        = Atmel AVR Dragon in PP mode
  dt006            = Dontronics DT006
  ehajo-isp        = avr-isp-programmer from eHaJo, http://www.eHaJo.de
  ere-isp-avr      = ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf>
  flip1            = FLIP USB DFU protocol version 1 (doc7618)
  flip2            = FLIP USB DFU protocol version 2 (AVR4023)
  frank-stk200     = Frank STK200
  ft232r           = FT232R Synchronous BitBang
  ft245r           = FT245R Synchronous BitBang
  futurlec         = Futurlec.com programming cable.
  jtag1            = Atmel JTAG ICE (mkI)
  jtag1slow        = Atmel JTAG ICE (mkI)
  jtag2            = Atmel JTAG ICE mkII
  jtag2avr32       = Atmel JTAG ICE mkII im AVR32 mode
  jtag2dw          = Atmel JTAG ICE mkII in debugWire mode
  jtag2fast        = Atmel JTAG ICE mkII
  jtag2isp         = Atmel JTAG ICE mkII in ISP mode
  jtag2pdi         = Atmel JTAG ICE mkII PDI mode
  jtag2slow        = Atmel JTAG ICE mkII
  jtag2updi        = JTAGv2 to UPDI bridge
  jtag3            = Atmel AVR JTAGICE3 in JTAG mode
  jtag3dw          = Atmel AVR JTAGICE3 in debugWIRE mode
  jtag3isp         = Atmel AVR JTAGICE3 in ISP mode
  jtag3pdi         = Atmel AVR JTAGICE3 in PDI mode
  jtagkey          = Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2
  jtagmkI          = Atmel JTAG ICE (mkI)
  jtagmkII         = Atmel JTAG ICE mkII
  jtagmkII_avr32   = Atmel JTAG ICE mkII im AVR32 mode
  linuxspi         = Use Linux SPI device in /dev/spidev*
  lm3s811          = Luminary Micro LM3S811 Eval Board (Rev. A)
  mib510           = Crossbow MIB510 programming board
  mkbutterfly      = Mikrokopter.de Butterfly
  nibobee          = NIBObee
  o-link           = O-Link, OpenJTAG from www.100ask.net
  openmoko         = Openmoko debug board (v3)
  pavr             = Jason Kyle's pAVR Serial Programmer
  pickit2          = MicroChip's PICkit2 Programmer
  picoweb          = Picoweb Programming Cable, http://www.picoweb.net/
  pony-stk200      = Pony Prog STK200
  ponyser          = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts
  powerdebugger    = Atmel PowerDebugger (ARM/AVR) in JTAG mode
  powerdebugger_dw = Atmel PowerDebugger (ARM/AVR) in debugWire mode
  powerdebugger_isp = Atmel PowerDebugger (ARM/AVR) in ISP mode
  powerdebugger_pdi = Atmel PowerDebugger (ARM/AVR) in PDI mode
  powerdebugger_updi = Atmel PowerDebugger (ARM/AVR) in UPDI mode
  siprog           = Lancos SI-Prog <http://www.lancos.com/siprogsch.html>
  sp12             = Steve Bolt's Programmer
  stk200           = STK200
  stk500           = Atmel STK500
  stk500hvsp       = Atmel STK500 V2 in high-voltage serial programming mode
  stk500pp         = Atmel STK500 V2 in parallel programming mode
  stk500v1         = Atmel STK500 Version 1.x firmware
  stk500v2         = Atmel STK500 Version 2.x firmware
  stk600           = Atmel STK600
  stk600hvsp       = Atmel STK600 in high-voltage serial programming mode
  stk600pp         = Atmel STK600 in parallel programming mode
  ttl232r          = FTDI TTL232R-5V with ICSP adapter
  tumpa            = TIAO USB Multi-Protocol Adapter
  UM232H           = FT232H based module from FTDI and Glyn.com.au
  uncompatino      = uncompatino with all pairs of pins shorted
  usbasp           = USBasp, http://www.fischl.de/usbasp/
  usbasp-clone     = Any usbasp clone with correct VID/PID
  usbtiny          = USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
  wiring           = Wiring
  xil              = Xilinx JTAG cable
  xplainedmini     = Atmel AVR XplainedMini in ISP mode
  xplainedmini_dw  = Atmel AVR XplainedMini in debugWIRE mode
  xplainedmini_updi = Atmel AVR XplainedMini in UPDI mode
  xplainedpro      = Atmel AVR XplainedPro in JTAG mode
  xplainedpro_updi = Atmel AVR XplainedPro in UPDI mode

I suspect that there are several "v6.3" builds on the Internet.

 

For example,  the megaavr Core for NANO-EVERY has a custom avrdude.

And it will be nice if avrdude supports PICKIT4 and SNAP in the future.

 

David.

Last Edited: Mon. Mar 2, 2020 - 04:43 PM