Peripheral Simulation
For Atmel T89C51CC01 — CAN 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.
CAN Channels Dialog
CAN 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.
CAN configuration #1 Dialog
The CAN1 Configuration dialog shows the CAN Channel 1
configuration details.
CAN Configuration #2 Dialog
The CAN2 Configuration dialog shows the CAN Channel 2
configuration details.
CAN0Bx VTREG
Data Type: unsigned char
The CAN0Bx VTREGs contains the eight bytes of the CAN message.
CAN0B0 is the first byte, CAN0B1 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.
CAN0ID VTREG
Data Type: unsigned long
The CAN0ID 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.
CAN0IN VTREG
Data Type: unsigned char
The CAN0IN 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:
CAN0IN=2; // Input a 29-bit ID message
CAN0L VTREG
Data Type: unsigned char
The CAN0L 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.
CAN0OUT VTREG
Data Type: unsigned char
The CAN0OUT 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.
CANTIMING VTREG
Data Type: float