This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Xtal needed in msp430g2xx1_ta_uart9600.c pgm ?



From the TI code examples, I downloaded this nice 9600B s/w UART code into my xtal--equipped G2231 Launchpad, and communication with my CryptoTerm terminal works fine (at room temperature and stable voltage). The info in the file states the need for the 32Khz xtal, but I really can't find anything in the code which calls for the crystal (LFXT1S is selected on PUC as this xtal, but no where is it used -- the TAClk is chosen as SMClk, which is DCO-derived). So then I tried another G2231 Launchpad that doesn't have the xtal loaded, and it doesn't work !!  I tried swapping chips but it's the board (i.e. it needs the crystal). Am I missing something obvious? Why is the xtal needed? Thanks for any help (also, is it less power consuming to design without the xtal? i.e use the VLO? I know the literature raves about how low power the xtal circuit is, but assuming cost isn't an issue, which low freq osc configuration is lowest power - the xtal or the VLO-only? Take this UART code as an example application... thanks).

  • Are you sure that the timer runs from SMCLK and not ACLK? ACLK per default runs from XT1 after power-up.
    I don't know the demo, so I cannot check.

    VLO is of no use for most applciaitons. It is a "at least something is clocking somehow" oscillator. Neither its frequency nor its stability is anywhere in a usable range, except for a misty 'sooner or later' timer clocking. But if that's enough, it draws least current of all.

    Surely, not having an XTAL consume sless power than having one. :) But those watch crystals don't draw much (my watch is running for years with a tiny battery - and it has such a crystal as clock source).

    The highspeed crystals are a different thing, as current consumption increases squared to the crystal frequency (plus some more influences)

  • Hi, I should have included a pointer to the file. For anyone reading this, the file I'm referring to to answer my query is at the following link where you'll  click on MSP430G2xx1 and you'll download the slac463a.zip - inside the C folder, scroll down to the msp430g2xx1_ta_uart9600.c file (implements a 9600B s/w UART).  The link is: http://www.ti.com/mcu/docs/mcusplash.tsp?contentId=128826#CE   The question again is about the need for a crystal (The AClk may be use it by default, but AClk is not used in the code that I could see).  Thanks !

  • I downloaded these examples (in my older LaunchPad examples file, the 9600Bd demo was missing, only the XT1-based 2400Bd demo was there).

    You're right, the 9600Bd demo is based on 1Mhz SMCLK and does not use nor reference ALCK or XT1 at all. So it should be unimportant whether XT1 is equipped or not. On the contrary, thsi demo uses P2.6 and P2.7 for outputting the received data, which are the XT1 pins by default. The software will turn these pins into I/O pins and throw out the upper two received bits. So having the XT1 equipped is actually a problem, as this is driving the crystal with digital I/O.

    However, on the LaunchPad without the XTAL mounted, are there also R28/R29 missing? Those two will connect the two port pins to teh breakout connector. But then, the software should basically work (send to HyperTerm, and receive except for the upper two bits).

    What else may be: there might be different versions of the FET firmware. The LaunchPad without the crystal may be an old version which has a FET firmware that doesn't implement the backchannel UART at all. I'm jus tguessing here, but this could be an explanation.

    Or, there has been some PCB update. The newer G chips with hardware UART have the UART pins twisted to the original software UART. So teh connection between MSP and FET needs to be twisted too. Maybe your second LaunchPad is configured for hardware UART. Check the jumper field between MSP and FET (on the doitted line). I don't have the latest schematics, so i cannot tell for sure. But it might be a pure coincidence that it doesn't work on the board without XT1 and has nothign to do with the XT1 itself.

    In the code, the reference to XT1 is IMHO a typical copy/paste error form the original XT1-based 2400Bd demo. And of course confusing.

  • Thank you. The problem is somewhere in the 2nd board's emulator section and not worth debugging.  I lifted the Xtal on the 1st board, and the s/w UART works fine.  Sorry for any inconvenience. Can this post be closed? Thanks. 

**Attention** This is a public forum