CAN总线编程时为什么在执行发送报文命令后需要一段时间的延时?如下所示:
if((n&0x40) == 0x40) /*设置判断远程桢*/ { ah = n&0x0f; REG_TxBufinf = 0x80 + ah; REG_TxBuffer1 = 0x00; REG_TxBuffer2 = 0x00; REG_TxBuffer3 = 0x11; REG_TxBuffer4 = 0x08; REG_TxBuffer5 = counter; counter++; REG_TxBuffer6 = 0x02; REG_TxBuffer7 = 0x03; REG_TxBuffer8 = 0x04; REG_TxBuffer9 = 0x05; REG_TxBuffer10 = 0x06; REG_TxBuffer11 = 0x07; REG_TxBuffer12 = 0x08; REG_COMMAND = 0x01;//报文发送命令
delay1(290);//延时时间 为什么一定要有延时时间? |