Peripheral Simulation
For Infineon C167CS-LM — CAN2 Controller
Simulation support for this peripheral or feature is comprised of:
- Dialog boxes which display and allow you to change peripheral configuration.
- VTREGs (Virtual Target Registers) which support I/O with the peripheral.
These simulation capabilities are described below.
CAN2 Channels Dialog
CAN2 Communication Dialog
The Controller Area Network (CAN) Controller Communication tab
displays the CAN communication activity on the CAN bus. The Message
number, States, Message Identifier, Message Direction, Channel, Data
Length and Data content are displayed for each message. To clear the
message display, double-click anywhere in the message display
area.
CAN2 Configuration Dialog
CAN2Bx VTREG
Data Type: unsigned char
The CAN2Bx VTREGs contains the eight bytes of the CAN message.
CAN2B0 is the first byte, CAN2B1 is the second byte, and so on.
-
When the simulated MCU transmits a CAN message, these VTREGs
contain the message data bytes.
-
To simulate a received CAN message, these VTREGs must be
initialized with the message data bytes.
CAN2ID VTREG
Data Type: unsigned long
The CAN2ID VTREG specifies the ID of the CAN message.
-
When the simulated MCU transmits a CAN message, this VTREG
contains the message ID.
-
To simulate a received CAN message, this VTREG must be
initialized with the message ID.
CAN2IN VTREG
Data Type: unsigned char
The CAN2IN VTREG specifies the type of CAN message the simulated
MCU will receive. The values 1-4 are used:
- 1: Message with 11-bit ID.
- 2: Message with 29-bit ID.
- 3: Message Request with 11-bit ID.
- 4: Message Request with 29-bit ID.
For example:
CAN2IN=2; // Input a 29-bit ID message
CAN2L VTREG
Data Type: unsigned char
The CAN2L VTREG specifies the length of the CAN message in
bytes.
-
When the simulated MCU transmits a CAN message, this VTREG
contains the number of bytes in the message.
-
To simulate a received CAN message, this VTREG must be
initialized with the number of bytes in the message.
CAN2OUT VTREG
Data Type: unsigned char
The CAN2OUT VTREG specifies the type of CAN message that was
transmitted by the simulated MCU. The values 1-4 are used:
- 1: Message with 11-bit ID was sent.
- 2: Message with 29-bit ID was sent.
- 3: Message Request with 11-bit ID was sent.
- 4: Message Request with 29-bit ID was sent.