Hello,
I am using the Devkit MPC5744P and the Model Based Design Toolbox 3.0.0
The reference manual informs that the eTimer0 supports watchdog timer by configuring the registers WDTOL and WDTOH.
I want to get the watchdog interrupt event, but I couldn't implment it using the eTimer interrupt handler as show below:
Can you help me on it?
Regards, Rafael
Hello rafael.barbosa@chassisbrakes.com,
We currently do not support the Watchdog timeout-interrupt. We can consider adding support for that in a future release.
Until then, if you really need this functionality, you can achieve this with custom code insertion.
From the interrupt vector table I understand that this sis available only for Etimer 0 Channel 0 so you need to create a custom block to implement this ETIMER0_WTIF_IRQHandler function as void function.
The SDK offers the support to enable interrupt source using the following call:
ETIMER_DRV_EnableInterruptSource(0, ETIMER_INTDMA_WDFIE_MASK, 0);
You can set and disable the watchdog using:
ETIMER_DRV_SetWatchdog(constuint16_t instance, constuint16_t channel, constuint32_t watchdog);
ETIMER_DRV_DisableWatchdog(constuint16_t instance, constuint16_t channel);
Tell me if you encounter difficulties if you start implementing this.
Hope this helps,
Marius
Hello Marius,
Thank you for the reply.
Besides the configuration, how can I implement the Interrupt Service Routine for this eTimer watchdog?
Regards, Rafael
Hello rafael.barbosa@chassisbrakes.com,
For implementing the ISR eTimer watchdog, you have two options depending on your needs:
1. If you need to trigger a subsystem you can add an S-Function. For this you will need to attach an .tlc file. You can be inspired by our etimer_mpc574x_isr_handler.tlc. All your handler definition will be in the Start tlc. function. If you need more clarification please write me here.
2. If you don't need to trigger a subsystem, you can simply add your code using from the Simulink Coder toolbox, the following "System Start" block. and you add your definition there.
Hope this helps,
Marius
Hello rafael.barbosa@chassisbrakes.com,
Any time. If you encounter any difficulties in implementing the S-function, feel free to reply here.
Best Regards,
Marius