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.

TMS320F28027F: About 28027F serial port receiving interrupt

Genius 3095 points

Part Number: TMS320F28027F
Other Parts Discussed in Thread: C2000WARE

Dear team:

Below is my program:

unsigned char Msg_Tx_Buf[10] = {0x55, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

interrupt void sciARxISR(void)
{
HAL_Obj *obj = (HAL_Obj *)halHandle;
float temp = 0;
unsigned char loop = 2;

Msg_Rx_Buf[ ++RX_Data_counter] = halHandle->sciAHandle->SCIRXBUF;
PIE_clearInt(obj->pieHandle,PIE_GroupNumber_9);

if((RX_Data_counter == 0) & (Msg_Rx_Buf[0] != 0xAA))
{
RX_Data_counter = 0;

return;
}
if((RX_Data_counter == 1) & (Msg_Rx_Buf[1] != 0x55))
{
RX_Data_counter = 0;
return;
}
if(RX_Data_counter >= 9)
{
//第一步:清零操作
RX_Data_counter = 0;
SCI_disableRxInt(halHandle->sciAHandle);
SCI_disableRx(halHandle->sciAHandle);

for( ; loop < 9; loop ++)
{
Rx_Num_Check += Msg_Rx_Buf[loop];
}

if((Msg_Rx_Buf[0] == 0xAA) & (Msg_Rx_Buf[1] == 0x55) & Msg_Rx_Buf[9] == (Rx_Num_Check & 0x00FF)) //检查校验和
{

Rx_Num_Check = 0;
Rx_Flag = 0;


SCI_TxMsg(Msg_Tx_Buf, 10);
}
SCI_enableRx(halHandle->sciAHandle);
SCI_enableRxInt(halHandle->sciAHandle);

}
} // end of sciARxISR() function

This is my interrupt program. This program receives ten data and then processes it. During debugging, it is found that it will be abnormal when receiving more than ten or less data. When sending more than ten data to the DSP at one time, the data from the host computer sent by the DSP is different from the data in the Msg_Tx_Buf. There is no operation on the Msg_Tx_Buf in the program.

When sending more than ten data for several times, the receiving interrupt can no longer enter, but other interrupts are normal. In other interrupts, the host computer can receive the sending data, and the received data is consistent with the content in Msg_Tx_Buf.

What causes this?

Best regards

  • F.F.,

    Check your configuration code for initializing the SCI.  As a reference, compare your initialization code to the example code in C2000Ware:

    C:\ti\c2000\C2000Ware_<version>\device_support\f2802x\examples\structs

    Also, double check your SCICCR register for using either Idle-line mode or Address-bit mode.

    In general, we do not review or debug user code, but we will provide assistance to you with specific issues relating to our devices and development tools. This includes clarifying the behavior of any bit, register, or features when designing with our devices. Please note that all peripherals have example code in C2000Ware. We suggest comparing your code to the example code to determine where the problem may exist. It is recommended to follow standard and logical debugging techniques. Please continue to debug your code and feel free to use this forum to ask specific questions. The more specific the question, the better we can assist you.

    I hope this helps. If this answers your question, please click the green "Verified Answer" button. Thanks.

    - Ken