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.

CC2541 UART problem

Other Parts Discussed in Thread: CC2541

Hello,

I am running UART program in "CC2541_43_44_45_Peripherals_Software_Examples".

I set 14.4 kbps with

#define UART_BAUD_M 216
#define UART_BAUD_E 8

and didn't change default parameters as follows.

// Initialise bitrate = 14.4 kbps.
U0BAUD = UART_BAUD_M;
U0GCR = (U0GCR & ~U0GCR_BAUD_E) | UART_BAUD_E;

// Initialise UART protocol (start/stop bit, data bits, parity, etc.):
// USART mode = UART (U0CSR.MODE = 1)
U0CSR |= U0CSR_MODE;

// Start bit level = low => Idle level = high (U0UCR.START = 0).
U0UCR &= ~U0UCR_START;

// Stop bit level = high (U0UCR.STOP = 1).
U0UCR |= U0UCR_STOP;

// Number of stop bits = 1 (U0UCR.SPB = 0).
U0UCR &= ~U0UCR_SPB;

// Parity = disabled (U0UCR.PARITY = 0).
U0UCR &= ~U0UCR_PARITY;

// 9-bit data enable = 8 bits transfer (U0UCR.BIT9 = 0).
U0UCR &= ~U0UCR_BIT9;

// Level of bit 9 = 0 (U0UCR.D9 = 0), used when U0UCR.BIT9 = 1.
// Level of bit 9 = 1 (U0UCR.D9 = 1), used when U0UCR.BIT9 = 1.
// Parity = Even (U0UCR.D9 = 0), used when U0UCR.PARITY = 1.
// Parity = Odd (U0UCR.D9 = 1), used when U0UCR.PARITY = 1.
U0UCR &= ~U0UCR_D9;

// Flow control = disabled (U0UCR.FLOW = 0).
U0UCR &= ~U0UCR_FLOW;

// Bit order = LSB first (U0GCR.ORDER = 0).
U0GCR &= ~U0GCR_ORDER;

When I set my terminal as follows,

14.4kbps, Data bits = 8, Parity=none, Stop bits = 1, Handshanking = nong

I am supposed get this message

"Texas Instruments LPRF!"

But I got this,

"뷢H믢???E%jr$??e쀳<0>"

I can't guess what is wrong.

Could you advice please?

Best Regards,

YS

  • Hello Yeonsik,

    1. Check to make sure you have a secure ground connection between the controller and the PC.

    2. Change the baud rate to something higher or lower. Try using the 115.2 with UART_BAUD_E 11.

    3. Have you tried all the UART setup ( DMA, ISR and Polling ) ?  Do you get the same results?

    4. Is this code being used in conjunction with the BLE stack?

    Thanks,

  • Dear Greenja,

    Tried other speeds lower or higher but the same results.

    I checked the ground level and it looks OK.

    And TX signal shape looks OK as well.

    Something strange is RX signal shows -0.8V DC level (with no signal).

    Is it normal? or something fish is going on?

    Thanks.

    YS

  • How are you connecting the UART to the PC? The voltage levels are not compatible, you have to go from TTL to RS232.

    Also, try using another terminal program.

  • Dear Greenja,

    As you advised, I checked my hardware connection and I found problem.

    After I fix that, it works OK now.

    Thank you very much for your valuable advice.

    I really appreciate it.

    BR,

    YS

  • Dear Yeonsik Yu,

    I am trying to connect CC 2541 to external MCU using UART of CC 2540.I think u have done similar thing.Could u please help me out on how to make these connections.I want to know what pins you are using on CC 2541 to do this.

    If possible please provide the schematic of these connections.

    Thanks in advance.