Keil Logo

µVISION DEBUGGER: SIMULATING CAN ON THE C167C DEVICES


Information in this article applies to:

  • C166 Version 4.20
  • µVision Version 2.20

QUESTION

I notice that I can simulate the CAN controller on the C167C devices. How do I send CAN message to the chip in simulation mode?

ANSWER

You must write the CAN message data into VTREGs (Virtual Target Registers) in the debugger. Then you must initiate the message by writing to the CAN1IN VTREG. For example:

func void inject_CAN_message (unsigned long ID, unsigned char x) {

  CAN1L = 8;      /* 8-byte message */

  CAN1B0 = x;     /* Send message data 1,2,3,4,5,6,7,8 */
  CAN1B1 = ++x;
  CAN1B2 = ++x;
  CAN1B3 = ++x;
  CAN1B4 = ++x;
  CAN1B5 = ++x;
  CAN1B6 = ++x;
  CAN1B7 = ++x;

  CAN1ID = ID;    /* Set CAN message ID */

  CAN1IN = 1;     /* Trigger sending the message */
}

To send a message, you must invoke this debugger function. In the Command Window in the debugger, you may enter the following:

inject_CAN_message (0x0123, 1)

The message sent will be message ID 123h and the message data will be 01h, 02h, 03h, 04h, 05h, 06h, 07h, 08h.

SEE ALSO

Last Reviewed: Tuesday, June 29, 2004


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.