3
\$\begingroup\$

My question is regarding a pin(s) on an MCU, specifically a TMS320F28035, that has multiple functions. Pins 57-60 of the 80-pin QFP version of this MCU are GPIOs but also douple as JTAG pins TCK, TDO, TDI, and TMS, respectively. In fact even the TCK pin could also be an XCLKIN, but that isn't where I am going to take this discussion. Here is the actual question:

If JTAG is only used when I initially program the MCU, or diagnose issues in units that were deployed in the field, could I use the pins as GPIOs when not being used for the JTAG function? Is this a bad practice? If I can do this, is there a good way to do it through firmware?

A quick thought on the firmware approach, I was thinking of using a flag on the TRST input, which is a dedicated pin, that way if 1 (connected to JTAG) use the above GPIOs as JTAG pins, else if 0 use GPIOs for other functions.

Thanks in advance for any help!

enter image description here enter image description here

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

This is typically fine, and also done in practice.

As you have already figured out, and the fine documentation tells you, you need a way to make sure that any peripheral circuits you connect to the affected pins are not causing mayhem when they see their inputs toggling at random, and make sure that they don't drive the pins unless specifically told so.

You must also look at the drive strength. For example, you may have an MCU that can drive an LED at 10 mA directly from a GPIO. While the LED would not care about a test signal driving it, the JTAG adapter will likely not be able to drive the extra load that the LED demands.

Another issue is when you're standing in the field to debug something, and realize that you have connected an essential functionality to one of the debug pins, so they can't operate simultaneously. Try to have less important functions here.

In summary: It's ok, but don't use them for critical functionality or load them down.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.