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.

COM port connection issues with ez430-RF2500

Other Parts Discussed in Thread: MAX232

Hi,

I am trying to set up the UART (USCI_A0) on the msp430 to talk to the computer over the com port.  I have set up the UART like in examples i've looked at and it is exactly the same as the example code that comes with the ez430-RF2500 (the sensor monitor project).  However, every time I try to connect to the com port though a hyperterminal like TeraTerm or Termite, it errors that it cannot connect to the com port.  I'm sure I have the com settings correct (9600 baud, 8bits, 1stop, no parity, no flow control).  Here is my init code:

BSP_Init();

//init UART

P3SEL = 0x30; //put uart function on the pins

UCA0CTL1 |= UCSSEL_2; //select the UART clock

UCA0BR0 = 0x41;

UCA0BR1 = 0x03; // 9600bps means 833 on the timer

UCA0MCTL = UCBRS_2;

UCA0CTL1 &= ~UCSWRST; //starts the UART

IE2 |= UCA0RXIE;// | UCA0TXIE; // enable uart interrupts

SMPL_Init(sRxCallback);

__bis_SR_register(GIE);

 

Thanks for any advice you can offer,

Tony

  • Anthony Dipasquale said:
    However, every time I try to connect to the com port though a hyperterminal like TeraTerm or Termite, it errors that it cannot connect to the com port.

    This has nothing to do with the port settings or the MSP code. It's an error on the PC/Windows side

    It simply means that the com port is either not there (then it shouldn't be offered by the program) or already used by a different application (e.g. a sync program for a PDA that runs in the background?)

  • Hi Jens-Michael,

    Thanks for the quick response.  I have checked the COM port every time in my device manager and its always present.  I also don't know of any program that could be using the COM port running in the background.  I am using Win 7 64bit.  Do you know of a way to check if the COM port is in use?

    I was able to get the COM port to connect once last night.  I changed the clock divider from 0x341 (what is recommended in the datasheet and examples) to 0x365.  I was just playing around but it did connect once.  However, all I saw through the hyperterminal was garbage.  So the next thing I'm going to do is put it under an oscilloscope and make sure the wave form matches up with the timing and data i'm sending.  I'm hoping the issue is that i'm not actually configuring the device to 9600, but I don't know why the data sheet would be wrong.  Maybe my oscillator isn't at 8Mhz.  I will also try a different computer to see if my computer is the problem.

    Thanks,

    Tony

  • Anthony Dipasquale said:
    Do you know of a way to check if the COM port is in use?

    By trying to use it in HyperTerm :) (well, there are some shareware programs which check and maybe even can tell which program is actually using them)

    Anthony Dipasquale said:
    I also don't know of any program that could be using the COM port running in the background.

    Some of these helper tools an services which are silently installed when you install a driver for some specific hardware (such as cellphoone/PDA, photo printer, whatever) have a habit of grabbing every port available and scanning it, jsu tnot not miss the millisecond when you attach the device. Often they will even block each other from fulfilling their job.

    Anthony Dipasquale said:
    However, all I saw through the hyperterminal was garbage.

    Until this, it was a purely Windows-related problem. For opening the port, it is not necessary that there is anything connected to the port at all. Now why the garbage: I don't know. There are many possible reasons.
    Is it a real serial port or a virtual port (through USB or even through the FET)? If it is a real one, how did you connect the device to the PC? You'll need a level shifter. The MSP uses TTL-like signals while the PC expects V.24 signals. TTL is 0V/3..5V while V.24 is 3..12V/-12..-3V (yes, inversed, negative voltage for high level) and considers 0V (GND) as invalid. Usually an MAX232 or one of its brothers is used for doing the level shifting.

    Well, I just checked the RF2500 users guide and It seems that you're probably using the Backchannel application UART, which is a bit tricky. It's rather a serial connection between the FET and the target board. The FET itself will then forward the data through USB to the PC USB driver which in turn will present it as freshly received serial port inputon a virtual serial port. This port may be in use if the debugger is running. Also, the number of the vitual COM port may change and it' spossible that HyperTerm ahs problems connecting to a COM port with a numbe rabove a certain number. At least some programs I knwo of do have these problems (seen with Olimex AVR programmer and AVR studio)
    Since the FET cannot be reprogrammed, the baudrate is fixed to 9600Bd.

    Anthony Dipasquale said:
    I'm hoping the issue is that i'm not actually configuring the device to 9600, but I don't know why the data sheet would be wrong.  Maybe my oscillator isn't at 8Mhz.

    That's always a possibility. Or you configured the clock module wrong and the UART (the SMCLOK) is running on half frequency. There ar emany possibilities. Looking at what really is through an Oscilloscope is often a really good idea (as long as one does not forget that Oscilloscopes cannot detect open/high impedacne signals)  :)

  • So this morning I tried using my Win 7 32bit machine and it worked immediately.  Then I switched back to my 64bit machine and it also worked immediately.  I did not change anything from last night.  This leads me to think you were right about another program holding onto the com port.  I'm going to try to recreate the issue again later today to see what the problem was.

  • So everything works fine now.  Not sure what was causing the problem but you were probably right with a hidden program locking up the port.

    Thanks for the help,

    Tony

  • For record, I faced similar issue. Installing 64bit drivers resolved my problem. http://austinblackstoneengineering.com/how-to-energia-on-windows-for-stellaris-launchpad/

**Attention** This is a public forum