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.

Problems with UART connection CC2540

Other Parts Discussed in Thread: CC2540

Hello, 

we are students using the cc2540 as a part of our senior design. 

We are trying to get connection with the UART ports. We have checked all the different approaches we have found in the web site. 

But we have nothing. 

Could somebody help us to get connection trough UART ports? 

We are using the HAL_UART, but we have no results. 

Thanks.

 

James & Francisco

  • Hi,

    It would be easier to help you if you could be a bit more specific.  Where/when do you "have nothing"?

    You should be able to find everything you need in chapter 17 of the CC2540 User Guide (swru191). A possible approach, using interrupt triggered RX/TX, would in general terms be set up as follows:

    • Set system clock frequency
    • Configure pins for peripheral use (controlled by USART controller)
    • Configure the USART controller for UART (parity bit, hw flow control, stop bits etc.)
    • Enable USART RX/TX and global interrupts

    A very general reply, but hope it helps!

    Cheers,
    ABO 

  • I will pass on what was suggested to me that worked.  Use the Accelorometer as a guide to setting up the UART.  In the new demo source code, CDA3000.c, you can find the setup.  Either disable the CS enable (set enable to 1 so the acc. doesn't affect the signal) or what I did that worked really well was to remap the UART port to a different location.  The cc25xx data sheet has a full list of the setup variables to remap the3 port.  I put it on the debug port, so that with one connector I can power the Keyfob, tie grounds, and bring data over.  Note that if you are trying to interface with a 5v chip without level adjuster, you must have 3.3v on your battery (and if you want full duplex, then you have to protect the CC2540 from 5v.

     

    Hope this helps!  I don't really know how to program C++ yet, so this is a good simple way to get going fast. The acc isn't enabled by default so either change that to initalize during startup, or once in a link send 0x01 to Char_UUID: 0x021  After you have it initialized, all you have to do is call spiWriteByte(data);

     

     

    Francisco Kaiser said:

    Hello, 

    we are students using the cc2540 as a part of our senior design. 

    We are trying to get connection with the UART ports. We have checked all the different approaches we have found in the web site. 

    But we have nothing. 

    Could somebody help us to get connection trough UART ports? 

    We are using the HAL_UART, but we have no results. 

    Thanks.

     

    James & Francisco