We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, i am using the AT89C51CC01 controller with integrated can and the can driver supplied together with the Keil App Note 167 Problem: Sending and receiving messages with extended IDs works ok, in simulated and real, but i have to switch to standard identifiers with 11 bit message length and so I modified some parts of the can_drv.c The simulator shows me, that my device is sending standard messages, but i have a problem with incoming messages and would like to simulate them using the SendInfo command in the debugger.ini How do I tell the SendInfo command only to use standard identifiers? - because the Simulator shows me that SendInfo is using extended identifiers
/* * Send Information on any ID */ FUNC void SendInfo (unsigned long id, // message ID unsigned char len, // message length unsigned char val) { // 1. value byte CAN0ID = id; // Set VTREG that keeps next ID CAN0L = len; // Set VTREG with message length CAN0B0 = val; // Set the data registers // CAN0B1 = val+1; // CAN0B2 = val+2; // CAN0B3 = val+3; // CAN0B4 = val+4; // CAN0B5 = val+5; // CAN0B6 = val+6; // CAN0B7 = val+7; CAN0IN = 2; // Send message to simulated controller }
Change CAN0IN=2 to CAN0IN=1 to simulate incoming messages with 11-bit identifiers. See App Note 147 for details of the meaning of all these CAN... virtual registers. Furthermore, what is the common way of receiving can messages with different lengths and ids, if there are not enough messagebuffers free for each type? - Configuring one messageobject with a weak filter and accept the canerror about the length? What makes you think you would get CAN errors about the length of incoming messages? I don't know the CAN controller implementation you're using, but I'd be very surprised if it even looked at the length setting for a message center on receiving a message, or if it does, you couldn't turn off such a "feature".