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
  • I just figured it out, thanks to using DIR VTREG command.

    I noted that the registers that were displayed using the DIR VTREG were:

    CANID =
    CANL =
    CANIN =
    etc...
    

    Whereas the application notes/discussion articles referred to the registers as:

    CAN0ID =
    CAN0L =
    CAN0IN =
    etc...
    

    I don't know if this is due to the fact that I'm using the C51 toolset, instead of C166 toolsets as given in the examples, or if its to do with the C515C.

    But I'm simulating CAN messages now!!!

    Thanx

    Stewart

Reply
  • I just figured it out, thanks to using DIR VTREG command.

    I noted that the registers that were displayed using the DIR VTREG were:

    CANID =
    CANL =
    CANIN =
    etc...
    

    Whereas the application notes/discussion articles referred to the registers as:

    CAN0ID =
    CAN0L =
    CAN0IN =
    etc...
    

    I don't know if this is due to the fact that I'm using the C51 toolset, instead of C166 toolsets as given in the examples, or if its to do with the C515C.

    But I'm simulating CAN messages now!!!

    Thanx

    Stewart

Children
No data