Jump to content
hawwwran

TTL UART and FTDI - what is what and for what?

Recommended Posts

It's important to recognize that the TEST/RESET 2-wire Spy-Bi-Wire programming protocol has nothing at all to do with the TX or RX pins. Think of it as its own uniquely separate communications channel. One that is only understood by the microcontrollers in the Emulator section of the launchpad (and understood by your MSP430G2553 as a way to program & debug it)--no FTDI or CP2102 will ever talk that SBW protocol.

 

Sent from my Galaxy Note II with Tapatalk

 

Share this post


Link to post
Share on other sites

I know that, I use it that way, I even splitted the board for that purpose, but it's not effective. I can buy those devices above for about $2 each, that would be much better solution. And as a note, you don't actually need to connect the TXD and RXD to programm it.

 

- Ok, so I cannot use those devices above, because they are not programmers with JTAG/SBW capability. I can use them for fine PC to MSP serial communication.

- Now question about the first red one from sparkfun... What are those CTS and DTR pins good for when they do not provide JTAG?

Share this post


Link to post
Share on other sites

So this is where the rabbit hole gets deeper..... :smile:

 

Some MCUs can be programmed over a asynchronous UART using what's called a "Serial Bootloader", or "Bootstrap Loader" (BSL) as TI likes to call it.  On Atmel AVR microcontrollers like those used with the Arduino, if there is a bootloader present (and the "fuse bits" on the AVR is configured to use it) then it runs first thing upon RESET.  An FTDI or CP2102 can use its DTR or CTS line to "pulse" the RESET line on the microcontroller and then immediately perform UART communication with the bootloader stub executing on the microcontroller, thus allowing you to reprogram it (it's physically the bootloader code doing the rewriting of the flash upon receipt of the new code coming over the UART).

 

The TI MSP430 can do this, but typically you don't see it in the lower-end chips like the Value Line.  I think the G2553 might technically be capable of using a BSL but I've not seen anyone do it.  It's more common in chips with more flash, such as the MSP430F5xxx series chips.  On these, I believe the RESET and/or TEST line has to be driven in some custom sequence to activate the BSL (otherwise the MCU just resets normally without executing the BSL code), then an FTDI or CP2102 can reprogram it over the UART pins.  The DTR/CTS pins can be used to drive that custom sequence.  Also in many cases the UART pins used for BSL are not the same as the general application UART pins too.  The BSL will have custom code to run a special timer-based software UART on different pins.  Because of the special "sequence" needed (and sometimes totally separate pins from the hardware UART your application will use) you don't see too many folks bothering with this.  But it's common to see the BSL implemented in a wide variety of chips because it's the most economical way for engineers to reprogram firmware "in the field" or for providing an application that the end-user can use to reprogram their chips.

Share this post


Link to post
Share on other sites

Now it makes complete sense. Which means that for me (with MSP430G2553) both devices we are talking about are the same for me, only pins TXD and RXD are useful for me for serial communication, but for the programming stuff I have to use the Launchpad's top part as I use it now. OK, that's not problem. I just like to know stuff. Thank you

Share this post


Link to post
Share on other sites

No prob... I think TI's LaunchPad having a full JTAG FET is one of the coolest things, since you can halt & examine memory/etc.  For the Atmel chips (I think I counted 4 ways to program them BTW) you have to use their debugWIRE interface for JTAG-style debugging which is an abomination since it requires setting fuse bits to enable that, and then you can't disable it for normal operation without using High Voltage Programming (one of the more obscure of the 4 ways to reprogram the AVR) to reset the fuse bit.

 

Whereas with the TI chips, there are 2 lines dedicated to this (RESET & TEST) and no strings attached.  This alone was a compelling reason for me to forget about my old Arduino equipment :grin:

Share this post


Link to post
Share on other sites

I think TI's LaunchPad having a full JTAG FET is one of the coolest things, since you can halt & examine memory/etc.  

 

It even works with non-value line chips that support 2-wire JTAG, which is really handy.  I'm using it right now to debug an F5172 and it is working like a charm.  I started with MSP's and briefly looked into making an arduino clone before seeing how big of a headache programming/debugging was.  Now I've found that TI has port mapping on some chips, PIC's are even starting to lose some favor with me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×