Civil Engineering Reference
In-Depth Information
3.2.1
Transmit Buffer
For offloading the CPU, a sufficiently large buffer memory is required, which in-
termediately stores the CAN messages ready for transmission until they are finally
transmitted by the CAN cell. For that purpose, most of the CAN cell implementa-
tions provide mailboxes into which the messages ready for transmission must be
written. If on top the transmission of messages is priority controlled by the control-
ler, a lot of software control is needed to know at what time actually a message
had been transmitted. IFI Advanced CAN does not make use of this method, but
applies a FIFO instead. The transmission of messages in the same sequence as the
CPU generates the messages is not only desired by many communication tasks but
also even much easier to handle. The number of messages which can be stored in
that FIFO can be controlled by a parameter between 30 and 254. Theoretically,
there is a case that due to a very busy CAN bus, a message never may be trans-
mitted because of always losing arbitration. A possible solution to that problem
would be to clear the FIFO and rewrite it with a different sequence. However, this
would imply that the user always had to know which messages are still waiting in
the queue. Even for this case, IFI Advanced CAN provides another way out. Any
message can be written into the FIFO in the normal way or a priority identification
may be assigned to the messages. Those messages are not written into the back of
the FIFO but into the front of the FIFO, while passing the queue. This architecture
avoids clearing the FIFO and memorizing the history by software. Therefore, three
functions are implemented:
• Removal of a message from the CAN cell, if it is not currently in the transmis-
sion process . That is to say, the bus is busy transmitting another message and
that message is waiting to be transmitted or that message had been interrupted
by an error frame and must be retransmitted. In both cases, that message can be
removed without corrupting any frames.
• The removed message must be written into the FIFO again as a not-yet-transmit-
ted message in order to guarantee that this message is not lost.
• The most important message is handed over to the CAN cell for transmission.
In order to make sure that this method is working smoothly even for more than one
message only, the FIFO buffer is switched into a last-in-first-out structure and iden-
tifications are assigned to all messages which are contained in the buffer. The iden-
tification enables the controller to recognize which messages still must be transmit-
ted. This concept enables the CPU to insert easily the messages into the buffer while
still maintaining control on the transmission. Each message ready for transmission
is written into the FIFO as a sequence of four addresses each 32 bits long containing
the following information:
• The addresses 2 and 3 reserve space for 8 data bytes.
• The address 1 contains the standard or the extended ID.
• The address 0 contains the data length code and the remote transmit bit as well
as an optional frame number. By this number, the controller knows whether
Search WWH ::




Custom Search