CANNY 7.3 Echo. CAN Scheduled Asynchronous Transmitter Driver

General Description

The CAN Asynchronous Transmission Driver allows sending CAN messages with predefined parameters and a user-defined transmission periodicity (with a resolution of 1 ms), independently of the functional diagram. This driver can be used for both CAN interfaces (CAN0 and CAN1) of the controller. Asynchronous operation, in cases where it is critical, allows for more stable message transmission periodicity compared to transmission from the functional diagram.

Users have access to 16 buffers for asynchronous CAN message transmission with individual settings for the CAN interface number, identifier, data, and message transmission period.

To activate the asynchronous transmission driver for the desired CAN interface, you must:

  • Configure the CANx interface settings.
  • Enable the asynchronous transmission driver for CANx using the corresponding register.

The CAN Asynchronous Transmission Driver can be used in conjunction with the standard CAN driver.

Driver Registers

Below is a description of the valid values for the registers that control the operation of the CAN Asynchronous Transmission Driver.

General Configuration Registers for the CAN Asynchronous Transmission Driver.

The CAN Scheduled Asynchronous Transmitter Driver Common registers.
Register Expected Values
CANSATX CAN0 Scheduled Asynchronous Transmitter Enable Register
CANSATX CAN1 Scheduled Asynchronous Transmitter Enable Register
≥ 1 = enable the driver for the specified CAN interface;
0 = disable the driver for the specified CAN interface.
CANSATX CAN0 Scheduled Asynchronous Transmitter Update Register
CANSATX CAN1 Scheduled Asynchronous Transmitter Update Register
≥ 1 = apply new CAN synchronous transmission driver settings (See note);
0 = do not update CAN synchronous transmission driver settings.

Note: New settings for the CAN Scheduled Asynchronous Transmitter Driver will be applied starting from the diagram cycle following the cycle in which a non-zero value was written to the Update Register of the CANx Scheduled Asynchronous Transmitter Driver.

The registers for CAN asynchronous transmission buffers are used to place data in the corresponding buffer for asynchronous transmission.

Registers for CAN Asynchronous Transmission Buffers.
Register Expected values
CANSATX Buffer X Linked CAN Interface Number Register 0 = apply the appropriate buffer to send messages to the controller via the CAN0;
1 = apply the appropriate buffer to send messages to the controller via the CAN1.
CANSATX Start Delay Register Buffer X CAN, ms 0…65535 = value of the message sending start delay of the corresponding buffer from the moment of its activation, ms.
CANSATX Period Register Buffer X CAN, ms 1…65535 = value of the message sending period of the corresponding buffer, ms;
0 = no send messages of the corresponding buffer.
CANSATX Transmit Data Register Buffer X CAN IDL 0…0xFFFF = value of the lower part of the CAN message identifier of the corresponding buffer.
CANSATX Transmit Data Register Buffer X CAN IDH 0…0x1FFF = value of the upper part of the CAN message identifier of the corresponding buffer.
CANSATX Transmit Data Register Buffer X CAN IEFBRL 0…0xXX40 = зvalue equal to the number of data bytes in the transmitted CAN message on the specified interface (see table 5) with service bits of information about special message features, where 0xXX is:
- bit 15 - IDE - extended message ID format flag;
- bit 14 - ESI - error counter overflow flag;
- bit 13 - FDF - CAN-FD message flag;
- bit 12 - BRS - CAN-FD baud rate switching usage indicator;
- bit 11 - RRS - remote data request flag.
CANSATX Transmit Data Register Buffer X CAN D1:D0

CANSATX Transmit Data Register Buffer X CAN D63:D64
0…0xFFFF = values of the corresponding data bytes of the CAN message of the corresponding buffer, two bytes per register.

Note: The maximum length of a CAN message is 64 bytes (in CAN FD mode), which corresponds to 0x40 in hexadecimal format.

CAN FD Message Data Byte Values.
Parameter List of permitted values
Number of data bytes in a CAN FD message 0; 1; 2; 3; 4; 5; 6; 7; 8; 12; 16; 20; 24; 32; 48; 64.

The operation of the CAN Scheduled Asynchronous Transmitter Driver is controlled using a special register.

Diagnostic register for the CAN Scheduled Asynchronous Transmitter Driver.
Register Return Values
CANSATX Buffer X Data Sent Register 1 = data from the specified asynchronous transmission buffer was successfully sent;
0 = Data from the specified asynchronous transmission buffer has not been sent.

Note: The value “1” in the CANSATX Buffer X Data Sent Register appears after each successful data transmission for one diagram execution cycle (if the transmission period of the specified buffer is greater than the duration of the diagram execution cycle).

Examples

Example Asynchronous Transmission of Static Data to the CAN0 Bus.

Example of a functional diagram for asynchronous transmission of messages to CAN0.

The controller executes the diagram, using the CAN Scheduled Asynchronous Transmitter Driver, to send two messages with static data to the CAN0 interface. The transmission period for the message from buffer 1 (ID=0x010) is 10 ms, and the transmission period for the message from buffer 2 (ID=0x050) is 50 ms. The transmission of the message from buffer 2 starts with a delay of 5 ms after the driver is activated.

Example Asynchronous Transmission of Dynamically Changing Data to the CAN0 Bus.

Example of a functional diagram for asynchronous transmission of dynamically changing data to the CAN0 bus.

The controller executes the diagram, using the CAN Scheduled Asynchronous Transmitter Driver, to send messages to the CAN0 interface every 10 ms. The data in these messages (bytes D6:D7) changes every 250 ms.

Example Joint Operation of the CAN Driver and the CAN Scheduled Asynchronous Transmitter Driver.

Example of a functional diagram showing the joint operation of the CAN driver and the CAN Scheduled Asynchronous Transmitter Driver.

The controller executes the diagram, receiving a message via the CAN0 interface with ID=0x020, where byte D0 equals 0x01. Upon receiving this message, it activates the transmission of a message with ID=0x050 using the CAN Scheduled Asynchronous Transmitter Driver.

SEE ALSO