Hi folks,
I have the TX and RX working well on the launchpad for integer values, but as soon as I try receiving strings of data, things go bizarre. I'm sending "123" from an Arduino at 9600baud 1stop, no parity and what I'm receiving is usually like: rxdata[0] = '.' rxdata[1] = '.' and rxdata[3] = '.'
If I parse out the periods, I will actually receive the "123" data but the numbers bounce around the array. I would expect 1 to be in rxdata[0] etc.
Here's how I've configured my SCIA:
// SCI stop bit, parity, loopback, char bits, idle/address mode
SCI_setNumStopBits(obj->sciaHandle, SCI_NumStopBits_One);
//SCI_setParity(obj->sciAHandle, SCI_Parity_Odd);
SCI_disableParity(obj->sciaHandle);
SCI_disableLoopBack(obj->sciaHandle);
SCI_setMode(obj->sciaHandle, SCI_Mode_IdleLine);
SCI_setCharLength(obj->sciaHandle, SCI_CharLength_8_Bits);
// TX enable, RX enable, RX ERR INT disable, SLEEP, TXWAKE (SCICTL1 = 0x03)
SCI_disableRxErrorInt(obj->sciaHandle);
SCI_disable(obj->sciaHandle);
SCI_disableTxWake(obj->sciaHandle);
SCI_disableSleep(obj->sciaHandle);
SCI_enableTx(obj->sciaHandle);
SCI_enableRx(obj->sciaHandle);
//SCI_enableTxFifo(obj->sciaHandle);
//SCI_enableTxFifoEnh(obj->sciaHandle);
// TXINT disable, RXINT enable, TXEMPTY, TXRDY (SCICTL2 = 0x03)
//SCI_enableRxInt(obj->sciAHandle);
SCI_enableRxInt(obj->sciaHandle);
//SCI_setRxFifoIntLevel(obj->sciaHandle, SCI_FifoLevel_1_Word);
SCI_disableTxInt(obj->sciaHandle);
// SCIH-SCIL BAUD - SCI_BAUD = (LSPCLK/(SCI_BRR*8)) - 1
SCI_setBaudRate(obj->sciaHandle, SCI_BaudRate_9_6_kBaud);
// Reset SCI
SCI_enable(obj->sciaHandle);
// enable SCI interrupt
PIE_enableInt(obj->pieHandle, PIE_GroupNumber_9, PIE_InterruptSource_SCIARX);
// enable CPU interrupt
CPU_enableInt(obj->cpuHandle, CPU_IntNumber_9);
In the main.c file:
interrupt void sciaRXISR(void)
{
int i;
for(i = 0; i<3 ; i++)
{
rxdata[i] = SCI_Read(halHandle->sciaHandle);
if (rxdata == '.')
{i--;}
}
Every function is using char data types.
Any tips on how to handle strings or arrays through SCI non FIFO?
-Jim