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.

CCS/TMS570LS0432: How to wakeup cpu from sleep using CAN message

Part Number: TMS570LS0432

Tool/software: Code Composer Studio

Hi 

While reading reference manual for Tms570ls0432 I found the we can wakeup the cpu from Low power mode using using 

GIO interrupt,
CAN message,
SCI message

here i want to wakeup my controller from CAN message send by other controller .

But inside the DCAN module reference manual there is nothing explained about it . 

How to wakeup controller from CAN message and what type of CAN message is required to wakeup ?

Thanks .

  

 

  • Hello Indrajit,

    I think the process is identified in the following two sections of the TRM.

    In this section it is stating that you need to enable interrups for the DCAN ES register so you get the interrupt for the status update. In addition, you then need to clear the CAN_INIT bit. When the DCAN module is in this state you then need to put the module into power down mode using the PSPWRDWNCLR register bit associated with the DCAN module responsible for wakeup which enables the bus activity detection circuit. Once powered down via the PCR, the detectino circiut will remain powered and detect activity on the CAN bus for the wakeup sequence to begin. As noted, the first message during the wakeup sequence will be lost.

    The VIM funnels all of the wake up interrupts into a single wake_int to the GCM. In order to be certain that only the source that you want will wake up the device, you can enable or disable the wakeup from each potential interrupt source using the WAKEENASET and WAKEENACLR registers.

  • Thanks , I got it . I will go through these two section of TRM . 

    Thank you very much !!

  • Hi I read these two section .
    I have one more doubt .
    If we program the micro controller to go for sleep mode after detecting valid condition like GIO interrupt it will come out of sleep mode but after that from where it will start executing instruction.

    Below i have written program to go for sleep mode , but it is not working . I mean it is going into sleep mode but after gpio interrupt it is not working . I don't know whether this is correct or not .
    Please help me .

    int main(void)
    {
    /* USER CODE BEGIN (3) */
    gioInit();
    _enable_IRQ();

    #ifdef SLEEP
    sleep();
    #endif

    int i=0;
    while(1)
    {
    gioPORTA->DSET = (uint32)1U << 2;
    for(i=0;i<100000;i++);
    gioPORTA->DCLR = (uint32)1U << 2;
    for(i=0;i<100000;i++);
    }

    /* USER CODE END */

    }


    /* USER CODE BEGIN (4) */
    void sleep()
    {
    flashWREG->FBAC = (0x0F << 8) | (0x0F);
    flashWREG->FBFALLBACK = 0x00000000U
    | (uint32)((uint32)SYS_SLEEP << 14U)
    | (uint32)((uint32)SYS_SLEEP << 0U);
    flashWREG->FPAC1 = 0x00;

    systemREG1->GHVSRC = 0x00000000;
    systemREG1->VCLKASRC= 0x00000000;
    systemREG1->RCLKSRC = 0x00000300;

    systemREG1->CSDIS = (uint32)((uint32)1U << 1U)
    |(uint32)((uint32)1U << 3U)
    |(uint32)((uint32)1U << 4U)
    |(uint32)((uint32)1U << 5U);

    systemREG1->CDDIS = 0x0
    | (uint32)((uint32)1U << 0U)
    | (uint32)((uint32)1U << 1U)
    | (uint32)((uint32)1U << 2U)
    | (uint32)((uint32)1U << 3U)
    | (uint32)((uint32)1U << 4U)
    | (uint32)((uint32)1U << 9U);
    asm( " NOP");
    asm( " NOP");
    asm( " NOP");
    asm( " WFI");
    asm( " NOP");
    asm( " NOP");
    asm( " NOP");

    }




    Thank you .
  • Hello,

    You need to disable all the clock sources and all the clock domain:
    systemREG1->CSDIS = 0xCF;
    systemREG1->CDDIS = 0x26F;
  • Hello Indrajit,

    Please add one statement before CSDIS and CDDIS:

    asm( " DSB");

    This is to ensure that all the instructions before this instruction complete.
  • Thank you very much it help me lot .

    As you said you need to disable all clock source using 

    systemREG1->CSDIS = 0xCF;

     But this line is not disabling internal two clocks .

    when i disabled internal two clocks also then it is not working otherwise with 

    this

    systemREG1->CSDIS = 0xCF; 

    configuration it is working properly .

    Thanks.