Greetings,
I am using the F28335 and I am having and issue with transmitting from GPIO 28/29 to 18/19 using SCIA and SCIB. I am able to send a message from that is received by GPIO 28 and then passed along to GPIO 18. When I do this the message is passed along but a <null> is attached to the message.
you can see what the oscilloscope shows too here:
It works correctly going the other way from the SCIB to SCIA. I believe that the issue lies in the buffer and that it is not being cleared out properly. This is the code being used. If I use this command in the code:
tx_buff_b[Console_Flags.bit.b_tx_index] = SciaRegs.SCIRXBUF.bit.RXDT;
I will be able to receiver the correct message but only a portion of whats in the buffer.
Is there a way to clear the buffer?
interrupt void SCIRXINTA_ISR(void) // SCI-A
{
Uint16 i,len;
command[length] = SciaRegs.SCIRXBUF.bit.RXDT;
SciaRegs.SCIRXBUF.bit.RXDT = ~SciaRegs.SCIRXBUF.bit.RXDT;
// To receive more interrupts from this PIE group, acknowledge this interrupt
PieCtrlRegs.PIEACK.all = PIEACK_GROUP9;
SciaRegs.SCIFFRX.bit.RXFFINTCLR = 1;
//check if <CR><LF> was received
if(command[length] == 0x0A)//new line (n)
if(command[length-1] == 0x0D){//Return (r)
len = strlen(command);
Msg_Flags.bit.scia_rx_rdy = 1;
for(i=0;i<70;i++){
command[i+length-1]=0;
}
length = 0xFFFF; //reset the length counter
}
if(Console_Flags.bit.b_en == 1){
Console_Flags.bit.b_tx_index = ~Console_Flags.bit.b_tx_index;
tx_buff_b[Console_Flags.bit.b_tx_index] = command[length];
Console_Flags.bit.b_tx_pend = 1;
}
length++;
if(length > 70){
length = 0;
}
}