This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS0332: LIN Wake up trigger

Part Number: TMS570LS0332
Other Parts Discussed in Thread: HALCOGEN,

Hi,

I  am using the LIN peripheral of the controller for communicating with the external slave device. The LIN of the controller is configured in the master mode. I am able to send and receive the data to/from LIN slave device.  I would like to generate the wake-up signal from TMS570LS0332 microcontroller to wake-up the external slave. I used the following function in the HalCoGen generated code to generate the wake-up signal.

void linSendWakupSignal(linBASE_t *lin)
{
/* USER CODE BEGIN (8) */
/* USER CODE END */

lin->TDx[0U] = 0xF0U;
lin->GCR2 |= 0x00000100U;

/* USER CODE BEGIN (9) */
/* USER CODE END */
}

I do not see any wake-up signal on the LIN bus. 

  • Hello Reddy,

    Does your LIN cluster has transceivers for LIN master and slave? I tested LIN1(master) and LIN2 (slave) on Launchpad without LIN transceivers, I can send wakeup signal from slave after the master txed a header.

    /*Send lin header including sync break field, sync field and identifier. */
    linSendHeader(linREG1, 0x23); //Master TX a header
    linSend(linREG2,&TEXT1[0]); //Slave send a response

    linSendHeader(linREG1, 0x23);
    linSendWakupSignal(linREG2);
  • Dear QJ Wang,

    I do have PHY on both LIN Master and LIN slave sídes. This time, I checked the signal at the LIN master TX ouput pin (i.e., directly at microcontroller output).  I used the following code to send the wake-up signal.

    linSendHeader(linREG, 0x23);

    linSendWakupSignal(linREG);

    I do not see any signal at the LIN Tx output of the microcontroller.   I have one more question related to your last response.

    linSendHeader(linREG1, 0x23);
    linSendWakupSignal(linREG2);

    In the code above, you mentioned that the slave responded with the wake-up signal. Why does slave do that? The LIN slave is in the sleep state. Is it not the master responsibility to send the wake-up signal? Please let me know your valuable comments

    Thanks & Best regards,

    Sreekanth challa

  • Hello Sreekanth,

    This is my setup for LIN test using TMS570LC43x launchpad. LIN1 is master, and LIN2 is slave. The 2 blue wires are used to connect TX and RX together, and yellow wire acts as the LIN bus.

    I did not put LIN2 (slave) to sleep mode.

  • Hello,

    I put the LIN2 (slave) to sleep mode, then LIN2 (slave) transmits a wakeup signal (0xF0) to the LIN bus:

    1. The wakeup signal is generated on LIN bus 

    2. The wakeup INT is generated in FLR register (bit 1)

    This is my code:

       /*Send lin header including sync break field, sync field and identifier. */

       linSendHeader(linREG1, 0x23);  //Master TX a header

       linSend(linREG1,&TEXT1[0]);    //Master send a response

       linSendHeader(linREG1, 0x23);  //Master TX a header

       linSend(linREG2,&TEXT1[0]);    //Slave send a response

       linSendHeader(linREG1, 0x23);

       linREG1->FLR |= LIN_WAKEUP_INT; //clear the wakeup bit

       linREG2->FLR |= LIN_WAKEUP_INT;

       linEnterSleep(linREG2);        //enter sleep mode

       linSendWakupSignal(linREG2);

  • Dear QJ Wang,

    Thanks a lot for the detailed answer. I have another quiery related to this. Let's say, Hecules micro controller is configured as LIN master. This sends the sleep frame on LIN bus to set all the slaves in sleep mode. As per LIN 2.1 specification, the master may force all slaves into sleep mode by sending a diagnostic master request frame (ID=60, 0x3C) with the first data byte equal to 0 and the remaining bytes set to 0xFF.
    Now i want to send wake-up signal to all slaves so that LIN peripheral of slave devices are ready for further communication. Now, i tried to use the linSendWakupSignal(linBASE_t *lin) function to send the wake-up signal on the CAN. It did not work.

    Based on your response, the following is my understading of wake-up signal in Hercules micro controller.
    " The micro controller can only generate the wake-up signal only if it is sleeping."

    Is this true?

    Thanks & Best regards,

    Sreekanth challa
  • Helo Sreekanth,

    It should be able to generate the wakeup signal at any time if it want to wakeup the sleeping nodes.
    1. the wakeup signal can be generated by master
    2. the wakeup signal can be generated by slave

    I will take more test after Christmas.