I require to use CAN communication, my setup is a custom f28035 board with a IXXAT USB-to-CAN device and monitoring in the PC.
So was trying to use the sample code, ecan_back2back available in Controlsuite. I am not receiving any packets though there is a clock in both pins.
Verified the connection up to the CAN transceiver by setting GPIO30 & GPOI31 as output, toggled, all fine.
I need 250KBPS, but now trying 1MBPS as available in the sample.
1. The sample program, does it transmit anything out to the pin or (as the name suggests back2back,) internal only?
2. How to change the baudrate to 250KBPS?
/* The following block is only for 60 MHz SYSCLKOUT. (30 MHz CAN module clock Bit rate = 1 Mbps See Note at end of file. */
ECanaShadow.CANBTC.bit.BRPREG = 1;
ECanaShadow.CANBTC.bit.TSEG2REG = 2;
ECanaShadow.CANBTC.bit.TSEG1REG = 10;
ECanaShadow.CANBTC.bit.BRPREG = 7; // (1+1)*4 -1 for 250kBPS?
Tried STM = 0 and 1,
ECanaShadow.CANMC.bit.STM = 0;//1;
Still nothing on transmit.
Please help me to make it working.
Thanks
Joy