State of the UPDI pin when not in use

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

Hi, I have just started out with a 40 pin dip avr 4809 and used a circuit diagram I found at pyupdi https://github.com/mraardvark/py... (bottom of page) to create a updi programmer. Essentially it uses an FTDI board (in my case) and connects the Tx and Rx with a 4k7 resistor and the junction of Rx and the resistor is connected to the UPDI pin on the 4809. It works fine and I got the Microchip blinkled program uploaded and working (minor change req'd to code as no port B on the 40 pin chip).

 

So my question is I'd like to use the same FTDI board as UART comms with my serial monitor. I could introduce a couple of switches one to to break the lines connecting the Tx and Rx and one to break the UPDI line. ( I might try to use mosfets if I can work it out). That would free up the FTDI board when its not used for uploading, but then what about the state of the UPDI pin on the 4809? I thought I'd read the 4809 datasheet section 30 about UPDI and that made me realise I have led a sheltered life :) , so can I leave the UPDI pin floating when not in use or do I need to pullup / down (or none of these). Perhaps I'd be better off dedicating the FTDI board to the programming task and use another for the UART comms.

 

Although I've done a fair bit of programming over the years, my main electronics experience was working with valve guitar amps. They were nice and warm in winter...

 

thanks for help with the Q.

Paul

Paul

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

I use two 74LVC2G07 (label Z4), which has a pair of open-drain buffers; this allows level shift and switching between a UPDI or UART mode. When U101 is off and U103 has the power, it is in UPDI mode. The UPDI pin is pulled up through the R105 to the MCU voltage (5V in my case). If my host (an R-Pi) pulls down its TX line for serial communications, the open drain of the buffer connects the UPDI pin to the ground through R106, which may be needed (I do not know for sure if the MCU will ever tie the pin to its supply).  If fliped to UART mode, I cross over the host RX to the MCU TX (U101 has power, and U103 is off). Anyway, some food for thought. 

 

 

 

Update: so, in my case, the UPDI pin is not floating; when U103 is powered down, its output (and input) is hi-z (an IOFF feature), which allows the pull up to work.

 

Update2: After some thinking, I am reasonably sure floating would be wrong; maybe MC has a weak pull-up on the pin, but knowing that would require looking at the DS.

Last Edited: Mon. Feb 15, 2021 - 03:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your reply Ron, much appreciated. Just a few questions if I may:

1 - does the circuit switch to UPDI mode automatically when UPDI becomes active?

2 - Thinking about the external connections:

 

From_RPU_Tx - that would be connected to my avr4809 Rx pin?

From_RPU_Rx - that would be connected to my avr4809 Tx pin?

MGR_UPDI      - that's connected to my 4809 updi pin?

PI_Tx             - that's connected to my FTDI Tx pin

PI_Rx             - that's connected to my FTDI Rx pin

 

also it looks like r103 pulls up to to 3.3v could that be 5v instead?

 

Are the resistor values important? Could I use the nearest value non SMD for breadboarding?

 

Actually I lied a bit about my electronics background, I have modernised a bit since my days of Valve amps, so it would be great to try to understand how your circuit works.

 

thanks again,

Paul

Paul

Last Edited: Mon. Feb 15, 2021 - 11:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With the low cost of USBttl cables, it would be simpler and less costly to just buy another cable, but where is the fun in that!

 

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

paulskirk53 wrote:
... but then what about the state of the UPDI pin on the 4809? I thought I'd read the 4809 datasheet section 30 about UPDI and that made me realise I have led a sheltered life :) , so can I leave the UPDI pin floating when not in use or do I need to pullup / down (or none of these).
high impedance (floating)

32.18. UPDI | ATmega4808/4809 Data Sheet

 

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

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

thanks for all replies. It occurs to me that having an oscilloscope or logic analyser might be a good idea. Any pointers to something useful would be greatly appreciated. I live in the U.K. budget about £200 if possible.

Paul

Paul

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

paulskirk53 wrote:
logic analyser might be a good idea. Any pointers to something useful

I have a Saleae I like, pricey but I believe is well worth it, there are really cheap Chinese clones available, but you get what you pay for.   You can use the Saleae s/w on Windows, but there are alternatives for linux that will work with the h/w.

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

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

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

ki0bk wrote:
... but there are alternatives for linux that will work with the h/w.
Logic analyzers | Supported hardware - sigrok

plus FreeBSD, OpenBSD, and Android Arm

 

 

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

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

paulskirk53 wrote:
1 - does the circuit switch to UPDI mode automatically when UPDI becomes active?

 

I have a Makefile flip the switch to UPDI mode before upload, then back to UART mode after it is done.

 

 

paulskirk53 wrote:

2 - Thinking about the external connections:

 

From_RPU_Tx - that would be connected to my avr4809 Rx pin?

From_RPU_Rx - that would be connected to my avr4809 Tx pin?

MGR_UPDI      - that's connected to my 4809 updi pin?

PI_Tx             - that's connected to my FTDI Tx pin

PI_Rx             - that's connected to my FTDI Rx pin

 

That looks right.

 

 

update: a snip from the Makefile (it is the upload rule)

 

# # This part has a built in UART based uploader (UPDI), so no bootloader is needed. Unfortunalty avrdude is not set up for this interface so...
# sudo apt install python3-pip
# pip3 install pyserial intelhex pylint
# pip3 install https://github.com/mraardvark/pyupdi/archive/master.zip
# # place RPUusb next to this project since the BCM24 pin needs controled
# git clone https://github.com/epccs/RPUusb
# # This program expects oem fuses
updi: ## upload with pyupid
	@echo testing for prerequesetits a false will stop make
	which python3 2>/dev/null || false
	which pyupdi 2>/dev/null || false
	ls ../../../RPUusb/UPDImode/UPDImode.py 2>/dev/null || false
	ls ../../../RPUusb/UPDImode/UARTmode.py 2>/dev/null || false
	python3 ../../../RPUusb/UPDImode/UPDImode.py
	pyupdi -v -d $(MCU) -c $(UPDI_PORT) -b 115200 -e -f $(TARGET).hex
	python3 ../../../RPUusb/UPDImode/UARTmode.py

The python scripts that control the pins used to change modes are in my USB bridge repo. Maybe the RTS handshake could be used from the FTDI, but I think a manual switch would be more straightforward.

Last Edited: Mon. Feb 15, 2021 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

paulskirk53 wrote:
also it looks like r103 pulls up to to 3.3v could that be 5v instead?

 

yes

 

paulskirk53 wrote:
Are the resistor values important? Could I use the nearest value non SMD for breadboarding?

 

yes, my values are ball park, https://github.com/mraardvark/py... calls for 4.7k Ohm but I don't have that in any project boxes so I used 3.01k which I have.

 

 

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

thanks again for all replies.

Paul

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


paulskirk53 wrote:
thanks for all replies. It occurs to me that having an oscilloscope or logic analyser might be a good idea. Any pointers to something useful would be greatly appreciated. I live in the U.K. budget about £200 if possible.
On the basis that Hantek make good, cheap scopes when these brand new models appeared I ordered one (early November):

 

https://www.aliexpress.com/item/...

 

ranging up to:

 

 

There are four models. Two are 100MHz. Two are 150MHz. For each model you have the option of "with built in signal generator" or not. The cheap picture is 100MHz without, the expensive one is 150MHz with.

 

So I ordered the 100/with (but not from Hantek but a different vendor on Aliexpress). I got notification of shipping in later November. I then waited the worst case 50 days for shipping then contacted the vendor who advises me that shortly after the notice about shipping it was returned by their courier. I now know this was a lie in fact. What actually happened was that Hantek had promised to ship but then problems with the new design (Covid??) meant it simply could not ship on time. So I got a refund (that bit was quick and easy and happened in less than 24 hours) and I actually ordered it again but this time I chose to order from Hantek's own store on AliExpress which promises free 7-15 day DHL delivery. Hantek did make it clear at that time that it was a "pre-order". Because I was buying again I decided to push the boat out for 150/with. I later got notification of dispatch but it seemed to hold in the Chinese side (pre DHL) for ages. But then it shipped but this time I got a notification that DHL China could not find my address (which is kind of odd because DHL UK must be delivering something or other here almost once a week) but then Chinese went into New Year so they can't process my reply about DHL until 18th.

 

I *hope* it may got on its way shortly after that. However I still suspect some of this delay, even from Hantek, is because of supply shortages.

 

One way I know this is via Youtube. You can tell when brand new things (scopes, pianos, synths) have finally shipped because within a day or two Youtube is awash with review videos from people who just received theirs and made the classic "unboxing video". I've been monitoring Youtube for DSO[C|D][10|15] for weeks and only in the last few days have some more videos started to appear. So it gives me hope that they are now shipping.

 

If I ever receive mine I'll put some words up about it here. All I have are some videos on Youtube that were clearly early samples (and many are in Chinese!) that show some of the features.

 

It's basically seems to be a replacement for the classic old Hantek DS05102P but with "more of everything". That was 100Mhz and 1Gs/s with a 40K buffer. These new ones are similar but the 40KB buffer is replaced with 8MB.

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

clawson wrote:
Because I was buying again I decided to push the boat out for 150/with.
Bandwidth is reasonable, quality is likely good, a good value; probes may be marginal (I didn't read the data sheet)

clawson wrote:
These new ones are similar but the 40KB buffer is replaced with 8MB.
Quicker to find glitches.

 


Adequate Bandwidth by Dr. Howard Johnson

I/O Pin Characteristics | ATmega4808/4809 Data Sheet

Passive Probes | Tyrosys Corp | Apple Authorized Service Provider

 

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

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

clawson wrote:
It's basically seems to be a replacement for the classic old Hantek DS05102P but with "more of everything". That was 100Mhz and 1Gs/s with a 40K buffer. These new ones are similar but the 40KB buffer is replaced with 8MB.

 

Nice. I have a 5072P, these new ones look exactly the same but with different colored plastic. Yeah, these Hantek scopes are cheap and nice for hobbyist needs.

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

clawson wrote:
If I ever receive mine I'll put some words up about it here.
Holy Mother of God.

 

Ordered: 8th November 2020

Delivered: 4th March 2021

 

I have heard of "slow boats from China" but this is taking that to the extreme!

 

(OK admittedly I cancelled the first order then re-ordered 15th Jan but that is still Jan -> March!)

 

I will probably put together the inevitable YouTube "unboxing" video...

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

clawson wrote:

Ordered: 8th November 2020

Delivered: 4th March 2021

 

Impressive, my personal best is about 2 months.

 

clawson wrote:
I will probably put together the inevitable YouTube "unboxing" video...

 

In case you do, what is your youtube channel?

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

El Tangas wrote:
what is your youtube channel?

https://www.youtube.com/user/Wri...