Multiple devices on one UPDI wire

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

Hi again a question abpout multiple devices. But with this one I have no idea if it is possible at all. So I will have multiple attiny1626 in one system. I would like to have the ability to update the devices without taking them out of the system. And preferably without using jumpers. So when I connect them all to one UPDI line. Would it be possible to program a specific device?

This topic has a solution.

German electrical engineer living in the Philippines.

Last Edited: Sat. Feb 26, 2022 - 11:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

flexbex1 wrote:
Would it be possible to program a specific device?
No as UPDI protocol lacks a device address.

One-Wire Enable | UPDI | tinyAVR® 2 Family

UPDI Instruction Set | tinyAVR® 2 Family

 

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

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

flexbex1 wrote:
without using jumpers.

maybe a multiplexer?

 

or just have a multi-way programming connection (it's only 1 contact per device) - and manage selecting a specific device externally?

 

or have a bootloader with some addressing scheme?  and/or use one chip as a "gateway"/master to program the others?

 

I will have multiple attiny1626 in one system

this, of course, is one downside of multiple  MCUs. Could it instead be done with a single MCU?

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
maybe a multiplexer?

 

It would need to be bidirectional since UPDI is half-duplex. So, an analog switch.

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

Could I do a resistor in the updi line? 5k or sth? So I could pull the line down with a transistor for each device which shouldn't be programmed

German electrical engineer living in the Philippines.

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

Yeah I think it might work if the number of chips is not too high. Each resistance should be 5k or less, and remember the programmer and each MCU will have to drive all those resistors in parallel so better make sure the parallel resistance is over 400 ohm or so.

And it's better if the transistor pulls up since that is the idle state of the UPDI line. That is, a PNP or PMOS.

 

I expect some programmers will have trouble, others won't depending on drive strength and other implementation details.

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

It's more planned as a future feature. Because my master aka programmer might be a raspberry pi. So I thought to adapt the jtag2updi. So I will be able to adapt the drive strength. But in the moment it's more the question if I should plan the updi line or not. The cool thing would be that I could do a web update to all my MCU in system

German electrical engineer living in the Philippines.

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

El Tangas wrote:
I expect some programmers will have trouble,

TinyX-OCD (UPDI) Special Considerations | Atmel-ICE

[beginning of last paragraph]

When designing a target application PCB where the UPDI interface will be used, the following considerations must be made for correct operation:

  • Pull-up resistors on the UPDI line must not be smaller (stronger) than 10 kΩ. A pull-down resistor should not be used, or it should be removed when using UPDI. The UPDI physical is push-pull capable, so only a weak pull-up resistor is required to prevent false Start bit triggering when the line is idle.

 

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

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

flexbex1 wrote:
Because my master aka programmer might be a raspberry pi.
Could add SPI UART though may be enough to bit-bang UPDI over GPIO (UPDI is one-wire UART with a specific protocol)

flexbex1 wrote:
The cool thing would be that I could do a web update to all my MCU in system
Can encapsulate MCU programming streams in WebSockets which are bridged to UART or USB CDC ACM by a WebSocket server (Serial Port JSON Server)

 


https://datasheets.raspberrypi.com/rpi4/raspberry-pi-4-reduced-schematics.pdf (grid C5 for "GPIO EXPANSION")

I²C/SPI UARTs - MaxLinear

GPIO - eLinux.org

 

Programming Your Arduino from SPJS | GitHub - chilipeppr/serial-port-json-server: Serial Port JSON Server is a websocket server for your serial devices. ...

Summary | GitHub - chilipeppr/serial-port-json-server: ...

 

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