This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CAN Simulation for the 8051 - Incomming messages

Hi I've been trying to simulate receiving an incomming message from the CAN bus. I have followed the application notes AP147 and 167, and I have viewed discussion topics on this subject.

I have included an ini file (project options > debug) with the following code to simulate a CAN signal:

 CAN0ID = 0x196;     //CANID
 CAN0L  = 1; //Data length
 CAN0B0 = 0x01; //Data
 CAN0IN = 1;    //11bit Identifier

But I get errors messages after each line.

*** error 34, line 9 : undefined identifier

does anyone have any suggestions?

Stewart

Parents
  • The Infineon C515C has just one CAN channel. The debug command DIR VTREG shows the available registers:

            :
           CANID:  ulong, value = 0x00000000
            CANL:  uchar, value = 0x00
           CANB0:  uchar, value = 0x00
           CANB1:  uchar, value = 0x00
           CANB2:  uchar, value = 0x00
           CANB3:  uchar, value = 0x00
           CANB4:  uchar, value = 0x00
           CANB5:  uchar, value = 0x00
           CANB6:  uchar, value = 0x00
           CANB7:  uchar, value = 0x00
           CANIN:  uchar, value = 0x00
          CANOUT:  uchar, value = 0x00

    The CAN peripheral registers have just the name CANID, not CAN0ID as it is the case with devices where multiple CAN channels exist.

Reply
  • The Infineon C515C has just one CAN channel. The debug command DIR VTREG shows the available registers:

            :
           CANID:  ulong, value = 0x00000000
            CANL:  uchar, value = 0x00
           CANB0:  uchar, value = 0x00
           CANB1:  uchar, value = 0x00
           CANB2:  uchar, value = 0x00
           CANB3:  uchar, value = 0x00
           CANB4:  uchar, value = 0x00
           CANB5:  uchar, value = 0x00
           CANB6:  uchar, value = 0x00
           CANB7:  uchar, value = 0x00
           CANIN:  uchar, value = 0x00
          CANOUT:  uchar, value = 0x00

    The CAN peripheral registers have just the name CANID, not CAN0ID as it is the case with devices where multiple CAN channels exist.

Children
No data