10

I'm working on an MSP430 design and I'm very intrigued by the Spy-Bi-Wire two-wire programming interface. From what I read it is very similar in terms of functionality to JTAG and even looks better in some cases (less wires of course, but also speed, etc).

Is there anything that JTAG is capable of that I would be missing out on by using Spy-Bi-Wire (debugging, breakpoints, flash programming) and not including the standard 4-pin JTAG on my PCB?

stevenvh
  • 145,145
  • 21
  • 455
  • 667
Joel B
  • 3,477
  • 2
  • 29
  • 37

2 Answers2

12

Spy-Bi-Wire is JTAG - the physical layer is just different. JTAG is a set of commands over a serial interface. The main problem is the chip you're debugging. The chip you're debugging has to have the support for the fancy features - not just your JTAG. And indeed, in TI's own documentation for the JTAG interface on MSP430 it spells out how its chips don't fully implement all JTAG commands (section 3.2, pg 67):

Only the BYPASS instruction is supported. There is no support for SAMPLE, PRELOAD, or EXTEST instructions.

Here's the fun part: since Spy-Bi-Wire is just serial communication, all of the actual cool features have to be implemented on the MSP430. For instance, the number of hardware breakpoints you have? Determined by the processor, not the JTAG you're using. Most MSP430's have two, some have eight.

Kevin Vermeer
  • 19,989
  • 8
  • 57
  • 102
AngryEE
  • 8,669
  • 20
  • 29
  • How could I not be able to fix a bricked chip if I can program the flash via Spy-Bi-Wire? Does Spy-Bi-wire not allow flash programming? – Joel B Apr 05 '12 at 13:59
  • 1
    SBW can forcibly erase the flash on bricked chips. It can write your program or change a value at a specific address in flash too – jsolarski Apr 05 '12 at 14:05
  • That's good to know - I thought it required higher voltages and was only able to forcibly wipe the chip if the chip was assisting. I think perhaps that functionality might not be in all SBW devices? I'm wondering mainly about the implementation on the MSP430 Launchpad. – AngryEE Apr 05 '12 at 14:07
  • 1
    I honestly don't know about the chips with both SBW and JTAG but I think it is one of the functions of SBW. If you look at the TI document you posted, it states "1.2.1.3 2-Wire Spy-Bi-Wire (SBW) JTAG Interface The core JTAG logic integrated into devices that support 2-wire mode is identical to 4-wire-only devices. The fundamental difference is that 2-wire devices implement additional logic that is used to convert the 2- wire communication into the standard 4-wire communication internally. In this way, the existing JTAG emulation methodology of the MSP430 can be fully utilized." – jsolarski Apr 05 '12 at 15:27
  • 1
    As for the launch pad it is a fully capable SBW programmer – jsolarski Apr 05 '12 at 15:29
  • @jsolarski - So you have full program and debug capability with the SBW on the launchpad? – Joel B Apr 05 '12 at 15:59
  • Yes - that is the case. The only question I had was whether it could rescue a bricked chip and jsolarski seems to say yes. – AngryEE Apr 05 '12 at 16:18
  • @AngryEE - Thanks for coming back and editing this. Great answer and great document. I don't think I would have stumbled upon that one. – Joel B Apr 05 '12 at 16:33
  • SBW on the launchpad can't burn the security fuse, so you'd need separate programmer for that if you plan to do this – kenyee Feb 05 '13 at 14:36
  • The link to TI appears to be broken. @Angry, if you're still there, do you remember the title or other searchable information about the document you linked? – The Photon Dec 15 '14 at 19:33
2

I develop custom MSP430 solution that run on Teradyne ICT

My opinion, SbW is certainly not faster. It takes 3 clock cycles to accomplish 1 bit by JTAG. Then, somebody had a really bad idea to have the RESET line carry the data. Then the the RESET usually has at least 1nF capacitance, which makes it even slower to charge and discharge.

The SbW is fine for very tiny flash, like the Value Series MSP430G, having only a few K of flash to program. But for the MSP430F5XX and 6XX, you better provide connectivity to the entire JTAG set and dedicate those pins for programming, otherwise you will regret using the SbW.