Skip to main content
georgebown
Associate
Aug 16, 2010 4:51 PM UTC
Question

Disabling Systick to Enter Stop Mode

Posted on August 16, 2010 at 18:51

Disabling Systick to Enter Stop Mode

    This topic has been closed for replies.

    2 replies

    georgebown
    Associate
    May 17, 2011 12:02 PM UTC
    Posted on May 17, 2011 at 14:02

    Thanks very much for your help.

    swhite2
    Associate II
    May 17, 2011 12:02 PM UTC
    Posted on May 17, 2011 at 14:02

    I ran into the same (lack of a SysTick disable mechanism) so I wrote my own.

    FYI this function stops the SysTick counter (SysTick_CTRL_ENABLE_Msk) and interrupts (SysTick_CTRL_TICKINT_Msk).You could just stop the interrupt if you want to leave the counter going.

    //////////////////////////////////////////////////////////////////////////

    //

    //  FUNCTION NAME :

    //      stm32_systick_disable

    //

    //

    //  IMPLEMENTATION DESCRIPTION :

    //      See the 'STM32F10xxx Cortex-M3 programming manual.pdf' for details.

    //

    //

    //  IMPLICIT LOCAL INPUTS AND OUTPUTS :

    //      None

    //

    //////////////////////////////////////////////////////////////////////////

    void                                    stm32_systick_disable(void)

    {

        SysTick->CTRL &= ~(SysTick_CTRL_ENABLE_Msk | SysTick_CTRL_TICKINT_Msk);

    }