Hello
Can somebody answer me question?
I want to build one simple program using two can bus controller incorporated in LPC2119 mcu. It is simple "can gateway". On one channel speed 125 kbit and second 500kbit. Basic idea is to send all frames from CAN1 to CAN2 and viceversa. I tried to use RL-CAN library like this: I make bypass filtering of can messages by using ptrcan_af->AFMR = 0x00000003; 1. rx frame from CAN1 CAN_receive(2, &msg_in, 20) 2. tx frame on CAN2 3. rx frame from CAN2 4. rx frame on CAN1
The problem is when I receive message on can1 and send on can2 I receive the same message on can2. When another message come to can2 I have problem with synchronization and sometimes are strange data when messages arrives to fast.
Is possible to not recive on same CAN messages that was previously sended?
Anybody has idea how to make it simple? Maybe without RL-can? in fact it is simple program...
Regards
thanks while(1) for your replays
I solved problems, it was simple:)
I just changed: ptrcan->CANCMR = 0x30; /* Startself transmission */ to: ptrcan->CANCMR = 0x21; /* Start transmission without loop-back*/
btw. in org keil project there was ptrcan->CANCMR = 0x20; which doens't send any frame also I do it with fullcan bypass mode and no problem