| ||||||||
Technical Support Support Resources Product Information | µVISION DEBUGGER: SIMULATING CAN ON THE C167C DEVICESInformation in this article applies to:
QUESTIONI notice that I can simulate the CAN controller on the C167C devices. How do I send CAN message to the chip in simulation mode? ANSWERYou 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 | |||||||
| ||||||||