Hi again Emmanuel!
Ok, I updated the header, and now the initialization seems to work (at least, the right register are changed as it should me).
I wrote this code to transmit 8byte data
Code:void can_tx(){ unsigned int n,status;MCF_CAN_MBUF_CODE(0) = MCF_CAN_TX_INACTIVE; //MB0 is inactive // Configure MB0 for TXMCF_CAN_MBUF_ID(0) = 0x18FF001E; // MB0 = TX, Ext. ID // CAN ID =0x18FF001E, Data Frame // IDE = 1 & SRR = 1; // RTR = 0;// Copy Tx data bytes to the message bufferMCF_CAN_MBUF_BYTE(0,0) = 0x22;MCF_CAN_MBUF_BYTE(0,1) = 0x22;MCF_CAN_MBUF_BYTE(0,2) = 0x11;MCF_CAN_MBUF_BYTE(0,3) = 0x11;MCF_CAN_MBUF_BYTE(0,4) = 0x66;MCF_CAN_MBUF_BYTE(0,5) = 0x66;MCF_CAN_MBUF_BYTE(0,6) = 0x99;MCF_CAN_MBUF_BYTE(0,7) = 0x99;MCF_CAN_MBUF_CTRL(0) = 0x68;MCF_CAN_MBUF_CODE(0) = MCF_CAN_TX_TRONCE;status = MCF_CAN_IFLAG;n=0;while((status & 0x0001)!=1) // polling{if(n++>0x6000)break;status = MCF_CAN_IFLAG; } }
at the other end of the cable I have a Can-Pci interface in my pc which (I hope) should work well and monitor Can activity.
I tried the code but it doesn't seem to work...
Is it correct or I'm still missing something? Do you also have a test code for tx-rx?
Simone