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.

CC1110 UART Baud Rate Issue

I'm trying to set the baud rate on a CC1110 to 115200 but it always comes out at 57600.  I am using a 27MHz crystal and have adjusted U1BAUD to 24 from the suggested 34 for a 26MHz crystal.  I've also checked and the PARTNUM register reads back 0x01.  Below is the code.  I can make it go to 115200 by changing U1GCR to 13 but I don't know why the speed seems to be 1/2 of what I think it should be.

while ((U1CSR & U1CSR_ACTIVE) != 0) { } // Ensure we're not active when baud is changed
U1BAUD = 24; // BAUD will be set to 115,200 for now
U1GCR = 12;
U1UCR = U1UCR_STOP; // Single 'hi' stop bit
U1CSR = U1CSR_MODE | U1CSR_RE; // Enable UART1 as RS-232

for (i=0; i<=MRFI_MAX_FRAME_SIZE; i++)
txmsg.frame[i] = 0x00;
PKTLEN = txmsg.frame[0] = PACKET_LENGTH; // length
txmsg.frame[ 1] = flashDeviceAddr[ 0]; // My unique ID num
txmsg.frame[ 2] = flashDeviceAddr[ 1];
txmsg.frame[ 3] = flashDeviceAddr[ 2];
txmsg.frame[ 4] = flashDeviceAddr[ 3] | GATEWAY_FLAG;
U1DBUF = 0x55; // Dummy character just to get the RS-232 queue moving

  • Hi

    Have you made sure that your system clock runs on the crystal frequency and not crystal frequency/2. If you have not change CLKCON.TICKSPD the system clock runs on crystal freq./2 and. The F in the baud rate formula is the system clock freq. and not the crystal freq.

    BR

    Siri

  • I thought I did but you are correct.  I found that you have to set CLKCON.OSC to 0 before trying to set CLKCON.CLKSPD to 000.  Even though I was doing CLKCON=0xA0, CLKSPD would be 001 if OSC was 1.