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.

Watchdog Handlers

Hi Everyone,

                         I'm using DEVKIT8000, I know how to initialise watchdog registers & and how  to change delay using WLDR reg, but I'm not getting how to use pre-scalar(i.e. WCLR reg), and one more thing is I want to stop the counter register of watchdog after it has reached certain point I want to know what is  the procedure to stop watchdog counter after initialisation. Please guide me in this issue.

   

Thanks & Regards,

Guru Charan

  • Hi Guru,

    If I understand your issue correctly there is some answers:

    • WCLR register prescaler configuration: PRE bit must be set to 1. PTV bits - Prescaler value: The timer counter is prescaled with the value 2PTV. Example: PTV = 3: counter increases value is started after 23 = 8 functional clock periods.
    • Watchdog Timer Start and Stop sequence (Using WDTi.WSPR Register):

    To disable the timer, follow this sequence:
    1. Write 0xXXXX AAAA in WDTi.WSPR.
    2. Write 0xXXXX 5555 in WDTi.WSPR.
    To enable the timer, follow this sequence:
    1. Write 0xXXXX BBBB in WDTi.WSPR.
    2. Write 0xXXXX 4444 in WDTi.WSPR.
    All other write sequences on WDTi.WSPR have no effect on the start/stop feature of the module.

    More detailed description you could find in the TRM chapter 16.4.3 WDTs Functional Description at the link below:

    http://www.ti.com/lit/ug/spruf98x/spruf98x.pdf

    BR

    Tsvetolin Shulev

  • Hi Tsvetolin Shulev,

                                         Thanks for  your replay, I have got how to disable Watchdog Timer its working fine, but I'm not getting how to set pre-scalar. Weather we can use both WLDR & WCLR reg simultaneously. If yes please suggest me how to use it that one.

    For WLDR I'm defining some value and calling that value in WCRR reg using writel function [writel(WD2_WLDR, &wd2_base->wcrr);], it s working great but I'm stuck in using pre-scalar setting[writel(WD2_WCLR, &wd2_base->wcrr);], I'm defining WCLR reg as 0x24(5th bit to set PRE & [4:2]bit as 001 for PTV as 2)  For pre-scalar I'm using same procedure used for WLDR. Please guide me in this issue sir.

    Thanks & Regards,

    Guru Charan

  • Hi Guru,

    There is a chapter in the TRM dedicated to the Prescaler Value/Timer Reset Frequency. Look at chapter 16.4.3.4 and pay attention on the tables and register descriptions. I could not paste the hole chapter in this post because it is possible to appears some issues with formatting and links. The configurations are not tested by me but seems very clearly described. I recommend you to search in the TRM for chapter 16.4.3.4 at the link below:

    http://www.ti.com/lit/ug/spruf98x/spruf98x.pdf

    BR

    Tsvetolin Shulev

  • Hi Tsvetolin Shulev,

                                         ok sure I'll go through it and I'll follow the procedure as you mentioned. Thank you for your replay, have a nice day... :)

    Thanks & Regards,

    Guru Charan

  • Hi Tsvetolin Shulev,

                                      I got how to set pre-scaler and it is working correctly, thank you for your guidance..... :)

    With Regards,

    Guru Charan