Keil Logo

Simulation

Programs you create with the RL-CAN Real-Time Library CAN Driver may be tested using the simulation capabilities of the µVision® IDE. Simulation allows you to test your CAN application before target hardware is ready.

Follow these steps to test an RL-CAN example application using the µVision Simulator.

  1. Copy the example from \Keil\ARM\Boards\Keil\MCB2100\RL\CAN\CAN_Ex1 or from \Keil\ARM\Boards\Keil\MCB2100\RL\CAN\CAN_Ex2 directory to any directory you want to use.
  2. Select and load the project file CAN_Ex1.uv2 or CAN_Ex2.uv2 into µVision . This file is located in the folder copied in step 1. In µVision, use Project — Open Project...

    Open Project Menu

    Select Project File
  3. Select the target Simulator.

    Simulator Drop-down
  4. Click on Debug — Start/Stop Debug Session on the menu bar or click the toolbar button to run the simulation.

    Debug Menu
  5. New windows appear as shown below. These windows show the device peripheral functionality.

    Toolbox, Analog/Digial Converter, and I/O Port 2 Windows
  6. Click on Debug — Run to start the simulation.

    Debug Menu
  7. The communication messages display in the CAN Communication window.

    CAN Communication Window
  8. Click on the Analog sweep 0 .. 3.3V button, on the Toolbox window, to start the analog value changing by rising from 0 V to 3.3 V and lowering from 3.3 V to 0 V. You can stop the analog value change by clicking on Analog sweep STOP.

    Analog Inputs Dialog
  9. Click on the button CAN loopback ON, on the Toolbox window, to enable simulation of the hardware connection (loopback) between the CAN 1 and CAN 2 ports.

    Click on CAN loopback OFF to turn off the simulation of the loopback connection between the CAN ports.

  10. After enabling the loopback in the previous step, you can watch changes in the General Purpose Input/Output 1 (GPIO 1) window on bits 23 .. 16, according to analog input value.

    GPIO Window
  11. Stop the simulation before exiting µVision by clicking on Debug — Stop on the Debug menu.

    Debug Menu
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.