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.

Trouble with serial application for EZ430-RF2560

Other Parts Discussed in Thread: CC2560

Hello.

I've recently accquired and EZ430-RF2560 kit and I'm having some trouble using Windows hyperterminal to send/receive characters.

I'm using the software downloaded from (http://focus.ti.com/docs/toolsw/folders/print/mt-bt-sdk.html) and I noticed it has already implemented the UART initialization as well as UART interrupts (as it can be seen in hal_usb.c file).

When I open the Hyperterminal, I configure the connection properly, but when I type a character it doesn't activate the RX interrupt (in special the line:)

halUsbReceiveBuffer[bufferSize++] = UCA1RXBUF;

The program then freezes and when I try to proceed with the debug process, it tells me that CPU is OFF (low power mode), and interrupts are disabled.

Can anyone please help me?

  • Bernardo,

     

    My understanding is that RX is not enabled for the UART and you will have to enable it yourself and handle it. I haven't checked it myself but soon will. The application sends the device to sleep when no data is being received from the Bluetooth side.

    Another suggestion is to use Putty instead of Hyperterminal, which has been known to cause issues and make things difficult.

    http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

     

    Gustavo

  • Hello again.

    So, I checked the code and I'm sure that the functions that initialize the UART are being called. Also, I'm aware that the device enters sleep mode after a few seconds of no activity, byt like I said, when I try to send a character, it freezes and the debug log says its CPU is OFF, not sleeping. 

    I still haven't tried to use Putty, though. As soon as I try, I'll post the results here.

  • I've tested the application using Putty and the same happened. When I send a character to the device, it freezes and remains that way until I plug it again on the USB port.

  • Have you made any modifications to the software itself?

    I will try and test a similar scenario to see how it goes.

    Gustavo

  • No I didn't. But I noticed that the halUsbInit function uses USCI A3 and the interruption vector uses USCI A1. Can this be the source of the problem?

  • You are correct. There are 2 UARTs being used in the application. One for the HCI interface with the CC2560 and the other with the USB to UART converter.

     

    Gustavo

     

  • I've changed the lines

     

    #pragma vector=USCI_A1_VECTOR

    __interrupt void USCI_A1_ISR(void)

     

    to

     

    #pragma vector=USCI_A3_VECTOR

    __interrupt void USCI_A3_ISR(void)

    and everything seems to be working. However, I now want to change USCI_A3 to USCI_A0 in order to use pins P3.4 and P3.5 to send and receive data, but I'm having some trouble in doing it. Can you please tell me exactly what I have to do?

     

  • Bernardo,

    Is this your own hardware or the experimenter board? USCI_A3 is not connected in the MSP430 Experimenter board. For you to be able to use USCI_A0, you can follow the code examples for the MSP430F5xxx in slac166. Another way is to copy the code you currently use and change the name of the registers from UCA1CTL1 to UCA0CTL1 for all registers.

     

    Then change the definitions of the usb_hal.h to use P3.4 and P3.5:

     

    #define USB_PORT_OUT      P3OUT
    #define USB_PORT_SEL      P3SEL
    #define USB_PORT_DIR      P3DIR
    #define USB_PORT_REN      P3REN
    #define USB_PIN_TXD       BIT4
    #define USB_PIN_RXD       BIT5

     

     

    Gustavo

  • It is the EZ430-RF2560 kit, not my own hardware. Look at hal_usb.c file. It uses UCA3 registers all over the code.

    But I'll try to make the changes you've listed above. Thanks.

  • Bernardo,

     

    I don't undertand. You want to use UCA0 instead of UCA3? That's not possible for the UART Connection unless you physically connect to them.

    The EZ430-RF2560 uses Pins 10.5 and 10.4 as TXD and these belong to UCA3. It's not possible to change this without changing the hardware. To use P3.4 and P3.5, you would need to physically connect to those pins.

  • Ah, now I get it.

    Soon I intend to attach some wires to the kit in order to use pins 3.4 and 3.5.