Part Number: LAUNCHXL-F280039C
Other Parts Discussed in Thread: C2000WARE
Hi Team,
1) After configuring can as DCAN for polling reception (without interruption), the 500ms task scans CAN data using the following task functions:
void 500msTask(void)
{
rxFIFO1st.num = MCAN_RX_FIFO_NUM_1;
MCAN_getRxFIFOStatus(MCAN_MSG_RAM_BASE, &rxFIFO1st);
if(rxFIFO1st.fillLvl != 0)
{
MCAN_readMsgRam(MCAN_MSG_RAM_BASE, MCAN_MEM_TYPE_FIFO, 0, MCAN_RX_FIFO_NUM_1, &rxMsg1);
}
}
BUF_NUM = 4;
Send 4 can data at a time, rxFIFO1st.fillLvl = 4, after 4 reads using MCAN_readMsgRam, rxFIFO1st.fillLvl = 0. But why is the rxFIFO1st.fillLvl value not updated after sending can data again? The 500ms task is modified as follows:
void 500msTask(void)
{
rxFIFO1st.num = MCAN_RX_FIFO_NUM_1;
MCAN_getRxFIFOStatus(MCAN_MSG_RAM_BASE, &rxFIFO1st);
if(rxFIFO1st.fillLvl != 0)
{
MCAN_readMsgRam(MCAN_MSG_RAM_BASE, MCAN_MEM_TYPE_FIFO, 0, MCAN_RX_FIFO_NUM_1, &rxMsg1);
MCAN_writeRxFIFOAck(MCAN_MSG_RAM_BASE, MCAN_RX_FIFO_NUM_1, 0);
}
2) What is the meaning of each segment in the MCAN_RXF1C register? What will happen to the corresponding section data after reading through the MCAN_readMsgRam function?
Could you help check this case? Thanks.
Best Regards,
Cherry