Interfacing SR73 Radar with AT90CAN128 via 250KBps CANBUS

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We trying to connect SR73 Radar having CAN baud rate 250Kbps with AT90CAN128 MCU and sending the data to UART. For this project we are using MicroC pro for AVR. 
But unable to receive correct frame ID and data from the radar using 8MHz crystal and 250K UART baud rate.
The radar is sending CAN frame ids 0x0000060b and  0x0000060a along with data.
We have used the CANculator tool to get the values SJW, BRP, PSREG1, PSREG2, PROPSEG and tried the use crystals like 8MHz and 10Mhz. But none of these are useful to get correct frame IDs and data from the Radar.
The following is our source code. Please let us know what we are doing wrong.

For 8 MHz crystal we have set the register values like

const unsigned int SJW = 1;
const unsigned int BRP = 2;
const unsigned int PHSEG1 = 5;
const unsigned int PHSEG2 = 2;
const unsigned int PROPSEG = 8;
const unsigned int CAN_CONFIG_FLAGS = _CAN_CONFIG_SAMPLE_ONCE & _CAN_CONFIG_STD_MSG;

 

For 10Mhz crystal the values are

const unsigned int SJW = 1;
const unsigned int BRP = 2;
const unsigned int PHSEG1 = 8;
const unsigned int PHSEG2 = 3;
const unsigned int PROPSEG = 8;

const unsigned int CAN_CONFIG_FLAGS = _CAN_CONFIG_SAMPLE_ONCE & _CAN_CONFIG_STD_MSG;

 

and used the following function in the init section

CANInitialize(SJW, BRP, PHSEG1, PHSEG2, PROPSEG, CAN_CONFIG_FLAGS);

 

But the receive frame IDs and data are not proper.

Please help us to solve the issue.

Attachment(s):