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.

MSP430FG438 Uart Problem

Hi to everyone,

I resolved my problems with the uart protocol, but one other rised up. I setted up my micro with this routine:

When from the RXBUF0 it receieves the letter G, it starts smpling from the adc. My problem is that it do that

indefenetevly, unless I send another character to RXBUF0. I want to know if there is some command that after

a certain amount of time it stops sending the adc data. There is a way to clear the letter G from the RXBUF0?

Thank you all very much!!! I need this so badly!!

Antonio

  • Reading the content from RXBUF doesn't clear it.
    You may implicitely write 0 to RXBUF, if you want. Maybe this will overwrite the content (I never tried, but IIRC the register is R/W). But the 'right' thing to to is to check the RXIFG flag, it is set when a new byte has been received adn cleared when you read RXBUF.

    Note that any possible value you could write to RXBUF (to mark it read) is a valid biinary value that could have been received as well. So the RXIFG bit is the only safe way to detect whether a new byte has arrived. It is not necessary to set the RXIE bit in order to get the RXIFG bit working. The IE bit is only blocking/enabling the execution of the interrupt. The IFG bits are always set and cleared according to their function.

**Attention** This is a public forum