eTimer0 watchdog interrupt for MBD Toolbox - MPC5744P

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

eTimer0 watchdog interrupt for MBD Toolbox - MPC5744P

1,041 Views
rafael_barbosa
Contributor IV

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.

pastedImage_1.png

I want to get the watchdog interrupt event, but I couldn't implment it using the eTimer interrupt handler as show below:

pastedImage_2.png

Can you help me on it?

Regards, Rafael

abhishek.kumar@chassisbrakes.com‌ 
mariuslucianandrei

5 Replies

922 Views
mariuslucianand
NXP Employee
NXP Employee

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

922 Views
rafael_barbosa
Contributor IV

Hello Marius, 

Thank you for the reply.

Besides the configuration, how can I implement the Interrupt Service Routine for this eTimer watchdog?

Regards, Rafael

0 Kudos
Reply

922 Views
mariuslucianand
NXP Employee
NXP Employee

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.

pastedImage_1.png

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.

pastedImage_2.png

Hope this helps,

Marius

922 Views
rafael_barbosa
Contributor IV

Hello mariuslucianandrei‌,

Thank you for this clarification.

Rafael

922 Views
mariuslucianand
NXP Employee
NXP Employee

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

0 Kudos
Reply