Programming ATmega4809 with UPDI from R-Pi

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

The other day I was sorting through some ideas for interfacing an R-Pi to an AVR so it could program.  That got me thinking about UPDI; I have been looking at ElTangas/jtag2updi and mraardvark/pyupdi.

 

I have decided to try pyupdi with an R-Pi; I will have the R-Pi enable some buffers depending on if I want a standard UART or UPDI.

 

Schematic

 

Part labels: K38 is NMOS BSS138, K84 is PMOS BSS84, DMB is PMOS DMP3098L, Z4 is buffer 74LVC2G07.

 

The 74LVC2G07 is a buffer with IOFF; it is Hi-Z when its power is off (both input and output). So, in theory, I can power the +5V (the SMPS is optional), and that will run the AVR. I can push the button to start (and latch) the R-Pi power; then I can do programming (or whatever). I can also halt (shutdown) the R-Pi with the other switch and then kill the power to clear the R-Pi power latch. It is a bit hacky.

 

For programming, I plan to have a Makefile set the R-Pi BCM24 pin before running pyupdi and then clear it after. When other programs connect to the serial, they are attached to the UART on PA0 and PA1.

 

https://github.com/epccs/PiUpdi/tree/master/Hardware

 

Eagle files

 

https://github.com/epccs/Eagle/tree/master/PiUpdi

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

Hi Ron,

Here is an interesting topic cheeky I was playing around theses days with pyupdi on an OrangePi, but I could'nt make it work properley. I got stuck on the issue#27.

Have you managed to make it work ? I thought using one the UARTs for programming, but if you can make use on only BCM24, it would be great !

 

Currently I can make use bitbang the Raspberry GPIOs for ICSProgramming an ATTiny84, but it is so much pin consumming, and I would prefer to go on the new tiny3216/3217. The tiny84 is more than 10 years old and quite limited.

 

Anyway, thank you for starting this project !

Nico

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

On an R-Pi, avrdude -c linuxspi needs some updates, but it does work for ICSP. I have not used avrdude -c linuxgpio. The R-Pi also bootloads over the hardware UART perfectly (with CTS/RTS enabled, and RTS used to start the bootloader). I have no experience with OrangePi (thought on that issue it said R-Pi). I am confident that the R-Pi UART works since I have been using it. Here is a link to my last toy that does some of that.

 

https://github.com/epccs/Driver/tree/master/ICSP

 

If UPDI works on this board, I may add it on some future spin of that ICSP board (I will probably remove the spring probes, they need to be on a separate little board).

 

I will order the board soon for testing. It has four transistors, two IC's and a hand full of passives, so I am 100% sure there is not more than a few mistakes.

 

There should be a better option for enabling IOFF buffers, but some hacks are good enough, I say test it.

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

ron_sutherland wrote:
There should be a better option for enabling IOFF buffers, ...
or alternatives

  • mega4809 Curiosity Nano, multiple 1-bit dual-supply bus transceivers (direction pin)
  • Arduino Nano Every, common level translator (there's one power source via USB Vbus or a buck converter module)
  • bi-directional dual-supply level translators (no direction pin, nFET with well control so no reverse current, active pull-ups for edge speed then usually a bus-hold)

ron_sutherland wrote:
... but some hacks are good enough, I say test it.
Will be close to correct given your success with the ICSP board.

There are Raspberry Pi protoboards.

 


ATmega4809_Curiosity_Nano (page 3, center, UPDI + RESET + UART to USB CDC ACM + two GPIO) via ATmega4809 Curiosity Nano

NANOEveryV3.0.sch via Arduino Nano Every

NLSX4373: Level Translator, 2-Bit, 20 Mbps, Dual-Supply

MPM3610 | Power Modules | 21V Input, 1A Module Synchronous Step-down Converter with Integrated Inductor | MPS | Monolithic Power Systems

https://schmartboard.com/search.php?search_query=Raspberry

edit : 710-0010-01 SchmartBoard | Mouser

 

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

Last Edited: Fri. Sep 27, 2019 - 12:48 AM