4
\$\begingroup\$

I've recently had a design made that requires a programming port to be located quite far from the device I'm trying to program. This has meant that my cJTAG traces are around 13cm long. I think as a result of this the programming is a bit temperamental regardless of the programming clock frequency.

I had a similar problem in another design, and resolved it by using 22 ohm series resistors on the TMS and TCK lines near the microcontroller, but that doesn't seem to have worked so reliably with this design. That could be because the distance is greater, or because the lines switch layer a few times on their way from the programming port. There is also a UART Tx/Rx that runs along to the port beside the JTAG traces.

The photo below shows the route of the JTAG and UART traces (top to bottom: Tx, Rx, TCK, TMS) enter image description here

At the bottom left you can see the series resistors, and an additional 10k pullup resistor on the TCK line which I was the datasheet advised to allow hot-plugging a programming connector.

Right now I'm hoping to find a way to make programming of the devices more reliable, so I'd really appreciate any insight or advice on running jtag over this distance.

\$\endgroup\$
  • 1
    \$\begingroup\$ Is there any significant difference in length between TMS and TCK? I usually make TCK a bit longer (perhaps 10mm) to ensure timing is met and to prevent a power up race for devices that do not have TRST. \$\endgroup\$ – Peter Smith Dec 20 '18 at 16:52
  • 1
    \$\begingroup\$ You don't mention of there is a pullup on TMS (there should be somewhere). \$\endgroup\$ – Peter Smith Dec 20 '18 at 17:01
  • 1
    \$\begingroup\$ Series termination should be used as the source, not the load -- i.e., near the JTAG header, not near the device. (Except for TDO, for which the device is the source.) \$\endgroup\$ – Dave Tweed Dec 20 '18 at 17:25
  • 1
    \$\begingroup\$ What coupling INTO the JTAG dataline? Get a FET probe, and examine the waveform as the data enters the IC. Also check the clock line for clean transitions. \$\endgroup\$ – analogsystemsrf Dec 20 '18 at 18:16
  • \$\begingroup\$ Is there a continuous ground plane on that board, or is it a 2-layer with whatever ground pour could be managed? \$\endgroup\$ – TimWescott Dec 20 '18 at 18:30
1
\$\begingroup\$

"@analogsystemsrf When I probed the lines I didn't see much noise or coupling at all. Pretty clean looking to me. In fact, with the probes in place the programming worked better than without."

It sounds like your programming lines might be improperly terminated and that you've got some ringing on them originating from an impedance mismatch somewhere. Probing signals like that can often hide/fix the issue.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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