Hi,
I have a RM46L852 MCU connected via an ADM3053 transceiver to a PEAK PCAN USB adapter (baud rate = 500 kBit/s). I'm using HALCoGen with the following settings:
I've generated the code and imported it in uVision. This is my example main function to receive data that I send via my PCAN USB adapter:
void main(void)
{
unsigned char rx_data[12] = {0,0,0,0,0,0,0,0,0,0,0,0}; /* 1st 4 bytes will be ID */
gioInit();
canInit();
while(!canIsRxMessageArrived(canREG1, canMESSAGE_BOX2));
canGetData(canREG1, canMESSAGE_BOX2, rx_data);
while(1) {}
}
Unfortunately I never receive any message from the PCAN USB adapter, so the program gets stucked at the first while loop. Sending data also doesn't work.
If I send a message with the PCAN View tool to the RM46 I receive a "BUSHEAVY" error (only error frames are sent I think, normally this error occurs if there is a physical problem). I have an oscillator between the transceiver and the RM46 and it is showing the following output if I try to send a message to the RM46:
The top signal is CAN1RX, the bottom signal is CAN1TX. If I send a message from the RM46 to the PEAK USB adapter I see nothing on the oscillator, there seems to be no output at all from the CAN1RX pin of the RM46.
If I call the "canIsMessageBoxValid" function from can.c it says that both messageboxes 1 and 2 are NOT valid, but I have no idea why.
For me it seems to be a software configuration mistake in HALCoGen, but I'm not sure what I did wrong. Do you have any ideas why I can't get the CAN messaging to work?
Thanks in advance,
Timm