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.

TMS320F28069M: TMS320F28069M Watchdog Issue

Part Number: TMS320F28069M
Other Parts Discussed in Thread: TMS320F28069, C2000WARE

Hello,

I am working with a custom board that includes a TMS320F28069 microcontroller. We tried to implement the Watchdog using the TI functions but it doesnt work. The microcontroller is constantly being reset by Watchdog.

These are the functions that we are using:

WDOG_BASE_ADDR = 0x00007022;

// initialize the watchdog driver
obj->wdogHandle = WDOG_init((void *)WDOG_BASE_ADDR,sizeof(WDOG_Obj));

WDOG_setPreScaler((void *)WDOG_BASE_ADDR, WDOG_PreScaler_OscClk_by_512_by_64);
WDOG_setCount((void *)WDOG_BASE_ADDR, 10);
WDOG_enable((void *)WDOG_BASE_ADDR);

WDOG_clearCounter((void *)WDOG_BASE_ADDR);

Debugging the code, these are the main points that we are seeing that  are not working properly:

1- WDOG_init

Retuning NULL comparing "sizeof(WDOG_Obj) < sizeof(WDOG_Obj)". 

2- WDOG_setPreScaler

Writing the same value of the WDCR in the WDKEY register.

 

3- WDOG_setCount

Not writting the value set (10) on the WDCNTR register.

4- WDOG_clearCounter

Not executing  this step wdog->WDKEY = 0x55. I think this happen due to the Compiler Optimization Level -> 2- GLobal Optimizations. The point is that we cannot deactivated the Optimization due to not enough space in the flash.

Not writting the register wdog->WDKEY = 0xAA. 

Due to the values 0x55 and 0xAA are not written in the WDKEY register the microcontroller resets.

Do you have any advice?

Thank you in advance

 

  • It is likely your writes are not going through to the intended register locations. Table 1-14. PLL, Clocking, Watchdog, and Low-Power Mode Registers on page 69 of SPRUH18H gives the addresses of the registers. Using the Expressions window, ensure your writes are happening correctly.

    You can run the example at C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f2806x\examples\c28\watchdog to verify correct WD operation. 

    If you are new to C2000, please review the workshop at https://training.ti.com/c2000-f2806x-microcontroller-workshop?context=1137791-1137782.  This self-paced workshop provides an excellent introduction to the basics of C2000 MCUs and the process of writing and running your first example. Many questions can be answered by reviewing the workshop material. Good introductory videos about CCS are available at https://www.youtube.com/user/CodeComposerStudio.  I hope this helps. Thank you for being a C2000 customer.

  • Hi Hareesh,

    Thanks for your answer.

    If you see the images attached in the previous thread, the register locations are the correct ones. Such was the case the case that if we dont execute WDOG_enable((void *)WDOG_BASE_ADDR) the microcontroller does not reset or if we change  WDOG_PreScaler_OscClk_by_512_by_64 value to another (WDOG_PreScaler_OscClk_by_512_by_16), the WDCR register changes as you can see in the image below.

    The problem is that simultaneously the WDKEY register takes the same value of the WDCR register. Apart from that, executing the WDOG_clearCounter function does not write to the WDKEY registers.

    Thank you in advance

  • The TRM says the below in Table 1-45 (page 105 of SPRUH18H):

    Reads from WDKEY return the value of the WDCR register.

    Please modify the example in C2000ware to your requirement, run it successfully and compare it with your application code to ascertain where it goes wrong. C2000ware example is a tested example and uses a simple bit-field approach. One more area to check is whether EALLOW is enabled.

  • Reads from WDKEY return the value of the WDCR registe

    We solved the issue. We had to denominate volatile the WDOG Register Structure and the compiler execute both 0x55 and 0xAA steps.

    Thanks for your help.