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.

CAN IO使用问题

Other Parts Discussed in Thread: TMS570LS0332, HALCOGEN

我使用TMS570LS0332的CAN接口用作普通IO使用,在程序仿真和调试时,都能正常工作,但是脱离仿真调试状态,上电测试时程序就不能用了,请问是什么原因?还有程序确实下载到FLASH中了;

CAN初始化函数

void canInit(void)
{

canREG1->TIOC = (uint32)((uint32)1U << 18U )

| (uint32)((uint32)1U << 17U )
| (uint32)((uint32)0U << 16U )
| (uint32)((uint32)0U << 3U )
| (uint32)((uint32)1U << 2U )
| (uint32)((uint32)0U << 1U );

canREG1->RIOC = (uint32)((uint32)1U << 18U )
| (uint32)((uint32)1U << 17U )
| (uint32)((uint32)0U << 16U )
| (uint32)((uint32)0U << 3U )
| (uint32)((uint32)1U << 2U )
| (uint32)((uint32)0U <<1U );

}

CAN 主函数

void main(void)
{
/* USER CODE BEGIN (3) */
canInit();
canIoSetDirection(canREG1,1,1);
canIoSetPort(canREG1,1,1);
while(1)
{

canIoSetPort(canREG1,0,0);
delay_s();
canIoSetPort(canREG1,1,1);
delay_s();
}
/* USER CODE END */
}