| |||||
µVision® IDE µVision® Debugger | CAN Communications Simulation
The complexity of building a proper physical test environment can be very time-consuming. The µVision3 debugger simulates all aspects of a CAN environment and allows you to thoroughly test CAN applications in a fraction of the time required by traditional CAN test environments. Simulation capabilities include:
For example, the following debugger script sends a CAN message into the simulated microcontroller twice a second.
SIGNAL void sendCAN (float secs) {
while (1) {
CAN0ID = 0x4510; // CAN message ID
CAN0L = 2; // message length 2 bytes
CAN0B0 = (info & 0xFF); // message data byte 0
CAN0B1 = (info >> 8); // message data byte 1
CAN0IN = 2; // send CAN message with 29-bit ID
swatch (secs); // delay for specified time
info++; // increment info value
}
}
>sendCAN (0.5); // invoke sendCAN function
| ||||
| |||||