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
There is a possible solution to not receive the same message and that is tu use different ID's from both controllers. In this way you can not disable the filter.
I want to send and receive all can frames with all ID.
When I use CAN_rx_object (0, 0, 0x21, STANDARD_FORMAT) it will only receive msg with CAN ID 0x21.
How can I make send and receive all frames with all ID with filtering and without receiving TX messages that I send?
I think this is the way the NXP has implemented CAN controllers and if filter allows receiving ID that are transmitted will also be received. So this is the limitation of CAN controller implementation on NXP chips. But, you can just ignore the received message that you sent, and also you can change interrupt handlers and ignore the received messages on low level so that throughput would not be decreased.
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
Hi Michael, I am experiencing problem getting CAN controllers of LPC2119 to transmit or receive messages at all. At least you manage to send out a CAN message successfully.
My LPC2119 controller fails to send any message with the Keil example BlinkyCAN, which works perfectly on my LPC2129 controller though. Acc. to datasheet and manual, both LPC2129 and LPC2119 shares exactly the same archtecture except for its flash memory size.
Can you send me your code; I like to see how you manage to get your LPC2119 to send out CAN messages.
Regards, Allan