
— 34 —
IX. Optimization and Performance
The transfer time of a typical CAN single-frame with a full payload length of 8 bytes is about 520
microseconds. Device does not waste any CPU resources handling CAN bus data link layer communications,
those are offloaded to CAN controller hardwar
e.
D
elay between message reception and transmission — for messages that do not match any filter — is within
100 microseconds — even if maximum number of filters (20) is used.
Of the 100 total microseconds, only 40 microseconds are used for the comparison with filters (program
execution). The rest of the time is spent processing interrupts of the CAN controller, placing the received
message into the program input queue, removing messages from the program output queue and then
handing it over to the CAN controller to send.
The runtime (for messages matching a filter) of Example 2 is 240 microseconds, and
of Example 9 — 515 microseconds. The total delays in the Device are 300 and 575 microseconds respectively.
Device has a software queue for 100 inbound and 100 outbound messages, with a maximum lifetime of
messages in the queue of 50 milliseconds. The device’s performance is sufficient for practical applications,
even in highly loaded networks. As long as egregious programming errors are avoided, no overload issues
should occur.
1. Use hardware filters
One of the most common Bridge use cases is data filtering between two network segments. Usage of
hardware filters shown in Example 7 below is extremely effective.
Example 7.
FW_CAN1_TO_CAN2=ON
FW_CAN2_TO_CAN1=ON
CAN1_HARDWARE_FILTER_1=0x00000000, 0x00FFFFFF
match(CAN2,0x1FD0A00,0x1FFFF00)
{
# some required processing here...
}