我在DSP28335 的开发板上测试回环程序,把0-15邮箱用来,16-31用来接收,下面是循环程序
for(;;)
{
ECanbRegs.CANTRS.all = 0x0000FFFF; // Set TRS for all transmit mailboxes
while(ECanbRegs.CANTA.all != 0x0000FFFF ) {} // Wait for all TAn bits to be set..
ECanbRegs.CANTA.all = 0x0000FFFF; // Clear all TAn
MessageReceivedCount++;
//Read from Receive mailboxes and begin checking for data */
for(j=0; j<16; j++) // Read & check 16 mailboxes
{
mailbox_read(j); // This func reads the indicated mailbox data
mailbox_check(TestMbox1,TestMbox2,TestMbox3); // Checks the received data
}
if(MessageReceivedCount > 100)
{
if(ErrorCount == 0)
{
asm(" ESTOP0"); // OK
}
else
{
asm(" ESTOP0"); // ERROR
}
}
}
我发现程序运行时停在 asm(" ESTOP0"); // OK 这句,意思是接收的数据错误为0,系统停止,但是当我想看CANTX和CANRX端输出的波形时,把下面判断的部分删除,即保留
for(;;)
{
ECanbRegs.CANTRS.all = 0x0000FFFF; // Set TRS for all transmit mailboxes
while(ECanbRegs.CANTA.all != 0x0000FFFF ) {} // Wait for all TAn bits to be set..
ECanbRegs.CANTA.all = 0x0000FFFF; // Clear all TAn
MessageReceivedCount++;
//Read from Receive mailboxes and begin checking for data */
for(j=0; j<16; j++) // Read & check 16 mailboxes
{
mailbox_read(j); // This func reads the indicated mailbox data
mailbox_check(TestMbox1,TestMbox2,TestMbox3); // Checks the received data
}
}
这时候引脚上却测不到波形,请问是为什么呢? |