Resetting Timer Unit used for Timer Interrupt

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

Resetting Timer Unit used for Timer Interrupt

787 Views
justusandjustic
Contributor III

I'm trying to use a timer to catch the end of a ModBus message.  ModBus has a minimum delay time between messages, so my goal was to have the interrupt period be the minimum delay time, and have the timer reset whenever a new character is received.  However, when I create a TimerInt component based off the TimerUnit component, the ResetCounter function because 'grayed-out'.  I know this is a common method for determining the end of a ModBus message, so how would I go about doing this with Processor Expert?

Tags (1)
0 Kudos
6 Replies

632 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Dear justusandjustice‌,

Could you let me know which MCU are you using?

Best Regards,

Alexis Andalon

0 Kudos

632 Views
justusandjustic
Contributor III

Thanks for the response.  The chip is S9KEAZN64MLC2.  The project is in Kinetis Design Studio with Processor Expert.

-Josiah

0 Kudos

632 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Dear Josiah,

In the description of this function there's the next note:

pastedImage_2.png

But I think if you use the SetPeriodTicks could be a good replace to this function.

Best Regards.

Alexis Andalon

0 Kudos

632 Views
justusandjustic
Contributor III

Alexis,

Yes, I had seen that note, but I didn't think that was applicable, because when I create the TimerUnit component, I am able to enabled the ResetCounter function, but when I attach a TimerInt component to that TimerUnit, I am no longer able to use that function.  Why would creating the Interrupt component disable that function?

As for using the SetPeriodTicks function, are you suggesting that I simply continually move the goal time forward instead of resetting the counter?  That might work.  I'll give that a try.

-Josiah

0 Kudos

632 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Josiah,

When you enable the interrupt the counter will be cleared when the interrupt is triggered, that's why this function disable the reset counter.

Best Regards,

Alexis Andalon

0 Kudos

632 Views
justusandjustic
Contributor III

I think I understand.  So the interrupt is triggered by the reset, so resetting it would also trigger the interrupt.  I want the interrupt to be triggered by the match, and then the counter to be reset, but that's not how it works, apparently.

Thanks for your help,

-Josiah

0 Kudos