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

Toolbox Usage

I was just going through the CAN code for MCB2300 provided by Keil and there i saw that the toolbox can enable/disable loopback. This was done using the CAN_Simulate.ini.
Im trying to do the same for my project on LPC1778.
What im not able to understand is what is CAN1OUT,CAN1B0,CAN1B1 etc in the .ini.
Any references for understanding how the .ini file was written,so that I can do the same for my project would be useful.

/*----------------------------------------------------------------------------*/
/* CAN_loopback_1_to_2() simulates loopback connection from CAN1 to CAN2 port */
/*----------------------------------------------------------------------------*/

signal void CAN_loopback_1_to_2 (void) {
  while (1) {
    wwatch(CAN1OUT);
    CAN2ID = CAN1ID;
    CAN2B0 = CAN1B0; CAN2B1 = CAN1B1; CAN2B2 = CAN1B2; CAN2B3 = CAN1B3;
    CAN2B4 = CAN1B4; CAN2B5 = CAN1B5; CAN2B6 = CAN1B6; CAN2B7 = CAN1B7;
    CAN2L  = CAN1L;
    CAN2IN = CAN1OUT;
  }
}

/*----------------------------------------------------------------------------*/
/* CAN_loopback_2_to_1() simulates loopback connection from CAN2 to CAN1 port */
/*----------------------------------------------------------------------------*/

signal void CAN_loopback_2_to_1 (void) {
  while (1) {
    wwatch(CAN2OUT);
    CAN1ID = CAN2ID;
    CAN1B0 = CAN2B0; CAN1B1 = CAN2B1; CAN1B2 = CAN2B2; CAN1B3 = CAN2B3;
    CAN1B4 = CAN2B4; CAN1B5 = CAN2B5; CAN1B6 = CAN2B6; CAN1B7 = CAN2B7;
    CAN1L  = CAN2L;
    CAN1IN = CAN2OUT;
  }
}

Parents
  • When the processor has full simulation, then you can do these nice things.

    When it doesn't have full simulation, then you can't.

    The LPC23xx has good simulation support, so you can write simulator scripts with virtual registers that corresponds with input/output of the different devices to let you create virtual hardware outside of the simulated processor.

Reply
  • When the processor has full simulation, then you can do these nice things.

    When it doesn't have full simulation, then you can't.

    The LPC23xx has good simulation support, so you can write simulator scripts with virtual registers that corresponds with input/output of the different devices to let you create virtual hardware outside of the simulated processor.

Children