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.

Transmit and Receive at different baud rates

Other Parts Discussed in Thread: MSP430F2272

Hello:

I am trying to transmit and receive at different baud rates to different devices using the same UART for msp430f2272.

I have a transmitter circuit transmitting at a baud rate of 9600 from MSP1 to MSP2, when MSP2 receive data from MSP1 I want to transmit to another device at a different baud rate. 

In the code for MSP2 (receiver circuit) , I am waiting inside the main method for the Rx Interrupt to fire. Once I go to the Rx Interrupt subroutine which means I received data correctly from MSP1, then I want to transmit to the other device with different baud rate. So in order to do this I configure the UART again with different baud rate and transmit, but I want to make sure that if my Rx Interrupt gets fired again I should recognize it and transmit accordingly. 

My idea is to have this while loop inside the main method for MSP2

  while (!(IFG1 & UCA0RXIFG)) // waiting to receive a new character at a baud rate of 9600 from MSP1
  {                                                    //meanwhile Transmit at 4800 baud rate to another device
uart_device_confi // configure at baud rate of 4800
tx_a(); //transmit at 4800 baud rate
uart_config(); // check with baud rate 9600 if RX is ready?
 }	

Is this the correct approach to transmit and receive at different baud rates using the same UART peripheral? 	

Thank you 
Berny
  • Berny Pazos said:
    ... In the code for MSP2 (receiver circuit) , I am waiting inside the main method for the Rx Interrupt to fire. Once I go to the Rx Interrupt subroutine which means I received data correctly from MSP1, then I want to transmit to the other device with different baud rate. So in order to do this I configure the UART again with different baud rate and transmit, but I want to make sure that if my Rx Interrupt gets fired again I should recognize it and transmit accordingly. ...

    After the UART finishes transmitting at the new baudrate, you need to re-configure it to receive at the old baudrate again. But transmitting takes time; during that time, the UART cannot receive at the old baudrate.

  • Using the same USCI hardware module, you can only have one baudrate at the same time.
    So if you switch to baudrate #2 for sending, after you received on baudrate #1, then you're deaf during sending until you switch the baudrate back.

    You'll need an MSP with two USCI modules (some MSPs have up to 4) or use a software (timer-controlled) UART for one of the connections (preferrably the slower one)

**Attention** This is a public forum