Hello! I'm trying to understand hardware UART for a project.
I have managed a print function, but I cannot, for the life of me, understand how to store received characters.
I have tried, with the help of another :
static volatile uint8_t cmd=0;
// Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
// save RXed char before sending it back..
cmd = UCA0RXBUF;
UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
}
It doesn't seem to work out at all.
Say I press a character on the keyboard, UCA0RXBUF is where it is stored, right?
SO in theory, I should be able to pull that up, right?
It doesn't seem to work.
This is for an MSP430 LaunchPad