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.

Proper configuration of 5438a USART w/ 24 MHz clock



Dear all,

I'm trying to properly configure a 5438a UART w/ a 24 MHz external quartz. Unfortunately, the family manual has suggestions settings up to 20 MHz (pages 17 and 18 SLAU208).

My actual sequence of instructions setting the serial is reported below, but I'm not sure it's completely correct, since I'm experiencing some seldom byte loss in transfering a stream of information to a PAN1321 Bluetooth Module @ 115200 bps.

- - - - - - - - - - -

  UCA1CTL1 = UCSWRST;
  UCA1CTL0 = 0;
  UCA1CTL1 |= UCSSEL__ACLK; // use ACLK as baud rate clock - ACLK is 24MHz divided by 2
 
  // Set up for 115200 baud (12000000 / 115200) = 104
  UCA1BR0 = 104;
  UCA1BR1 = 0;
  UCA1MCTL = UCBRS_1;     //see pag. 17 USCI Operation- UART Mode
 
  UCA1CTL1 &= ~UCSWRST;      

- - - - - - - - - - -

Is there anything wrong or that could be better implemented?

Thanks a lot

Paolo

  • Paolo Meriggi said:
    UCA1MCTL = UCBRS_1;     //see pag. 17 USCI Operation- UART Mode

    I'd try without modulation, i.e. without the line above.

    Also, are you sure that bytes are totally lost? UART peer could need some inter-byte and/or inter-message delay to have the time to decode/execute/respond.

    Regards,

    Peppe

**Attention** This is a public forum