FlexCAN and can packet timing

Status
Not open for further replies.

computerjlt

New member
Hello everyone.


I'm working on a project that will send out CAN messages and respond to messages on a bus in a car. timing is fairly critical as some messages happen very often some not so much.

Is there an easier way with FlexCAN (or any other library) to time these without having to closely time the loop making things extremely complicated? for instance with one ecm function, weather its on or off sends 4 different packets in order repeating indefintaly at 20ms per packet. if the ecm doesn't see these in order or the timing is too far out it stops listening. i'm able to successfully replay these with kvaser hardware on a computer and i've got the teensy to do so similar on a bench. i'm just looking for an easier way to time the messaging without using any delays or convoluted code.

Also is there more reading available for flexcan or other can libraries that isn't just a few vague sentences on the github? I'm having to figure out some of the syntax and such by reading other projects code and just guess and testing on a lot of this.
 
This thread has been unanswered so if you are still working on the project, the flexcan controller on teensy supports up to 16 mailboxes, 32 (2x16) on a Teensy 3.6 (if you run them in parallel).

The nice thing about them is you get interrupts which happen when receiving specific mailbox frames when applying filters to your mailbox. You could still use FIFO for ordinary canbus traffic, with the flexcan MRP flag set, a mailbox interrupt will fire allowing your sketch to quickly process that frame as fast as possible.
 
Status
Not open for further replies.
Back
Top