Can I connect PDI Data pin to another pin for a debug / programmer port?

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

I'd like to add debug functionality (through PC3 - USART TXD0) to the 4 pin programming header I have on the board.

 

Since I'd like to keep the existing header for compatibility, I am wondering if I can connect the 2 MCU pins together, so that the current PDI Data can be used for programming and also for debug spew through the USART.

 

MCU is XMEGA32A4U.

 

 

This topic has a solution.
Last Edited: Thu. Jul 9, 2020 - 04:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, No, Maybe...

 

No, you should not directly connect the PDI pin to another general purpose I/O pin.

The issue is that if one of the two is trying to be at a logic high level, while the other is trying to be at a logic low level, they will fight each other, and will often draw a lot of current, and potentially burn out the pin drivers (inside the chip), and perhaps do other damage to the chip as well.

So don't to that.

 

Maybe, you could connect them together through a resistor, then PortC.3 could monitor the activity on the PDI pin.

So, how large a resistor?

See the next paragraph.

 

The two PDI programming pins are suppose to have a matched impedance.  When you stick a resistor on one pin and not the other you mis-match their impedances.

That can cause the PDI programming to fail.

Ideally you don't load the PDI pins with any external load.

 

If you wanted to give it a try, you could use a 10K or 4.7 K, or perhaps even a 1 K resistor, but if it makes the PDI programming fail you will now know why.

 

JC 

Last Edited: Thu. Jul 9, 2020 - 01:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

purple_beam wrote:
debug functionality (through PC3 - USART TXD0)

But PDI =  Program and Debug Interface - so it  is a debug interface already ... ?

 

 

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...
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


DocJC wrote:
The issue is that if one of the two is trying to be at a logic high level, while the other is trying to be at a logic low level, they will fight each other, and will often draw a lot of current, and potentially burn out the pin drivers (inside the chip),

and there's also the issue of incompatibility with standard debug & programming tools.

 

The standard Atmel Microchip header is a 6-pin:

 

https://microchipdeveloper.com/atmelice:connecting-atmel-ice-to-a-pdi-target

 

http://ww1.microchip.com/downloads/en/Appnotes/doc8278.pdf

 

it has 2 spare ("N.C.") pins - you could use those ... ?

 

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

purple_beam wrote:
... so that the current PDI Data can be used for programming and also for debug spew through the USART.
or PDI for all (programming/debugging, alternate I/O to standard I/O or standard error)

https://www.avrfreaks.net/forum/avr-calibration-daq-toolchain#comment-2107876 (sigrok)

 

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

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

Thank you for the great responses.