ARM Technical Support Knowledge Articles

SIMULATING CAN ON THE C167C DEVICES

Applies to: uVision Debugger

Answer


Information in this article applies to:


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

Article last edited on: 2004-06-29 08:18:44

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential