Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
Real Time Interrupt - "mr.mattyg" - Jul 21 22:01:55 2008
Hi Guys,
i'm programming a MC9S12DP512.
just wondering if someone can confirm something for me... don't have
any hardware with me right now to test things out, but need to modify
some code.
i'm adding a real time interrupt into my program to use for an alarm
clock. i need to sometimes enable and disable this interrupt. i
don't really ever need to change the rate at which it interrupts. is
it true that when i re-enable the interrupt (RTIE = 1 in CRGINT) i
should also write my desired timeout period to RTICTL in order to
reset the timeout clock?
basically my question is what happens if i disable the interrupt
halfway through the timeout period, then re-enable the interrupt
somewhere down the line. on my first interrupt after re-enabling,
will i get the full desired period, or half the timeout period?
thanks guys,
matt
------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )
Re: Real Time Interrupt - nixknacks - Jul 22 0:38:18 2008
My first instinct wants me to say that you will get a full timeout
period upon re-enabling. If I have time, I can test this out for you.
I have an MC9S12DP512 in my lab, however, I'm trying to finish my
Senior Design project by the end of the week. Unlikely I will be able
to test for you. Could definitely do that on Monday though :)
--- In 6...@yahoogroups.com, "mr.mattyg"
wrote:
>
> Hi Guys,
>
> i'm programming a MC9S12DP512.
>
> just wondering if someone can confirm something for me... don't have
> any hardware with me right now to test things out, but need to modify
> some code.
>
> i'm adding a real time interrupt into my program to use for an alarm
> clock. i need to sometimes enable and disable this interrupt. i
> don't really ever need to change the rate at which it interrupts. is
> it true that when i re-enable the interrupt (RTIE = 1 in CRGINT) i
> should also write my desired timeout period to RTICTL in order to
> reset the timeout clock?
>
> basically my question is what happens if i disable the interrupt
> halfway through the timeout period, then re-enable the interrupt
> somewhere down the line. on my first interrupt after re-enabling,
> will i get the full desired period, or half the timeout period?
>
> thanks guys,
> matt
>
------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )Re: Real Time Interrupt - Edward Karpicz - Jul 22 1:40:35 2008
"mr.mattyg" wrote:
> Hi Guys,
>
> i'm programming a MC9S12DP512.
>
> just wondering if someone can confirm something for me... don't have
> any hardware with me right now to test things out, but need to modify
> some code.
>
> i'm adding a real time interrupt into my program to use for an alarm
> clock. i need to sometimes enable and disable this interrupt. i
> don't really ever need to change the rate at which it interrupts. is
> it true that when i re-enable the interrupt (RTIE = 1 in CRGINT) i
> should also write my desired timeout period to RTICTL in order to
> reset the timeout clock?
That's weird question. The answer is no, you don't have to reinit RTICTL
every time you disable then reenable RTIE. Is RTI counter enabled and
counting, or is it stopped depends on RTICTL, but not on RTIE.
>
> basically my question is what happens if i disable the interrupt
> halfway through the timeout period, then re-enable the interrupt
> somewhere down the line. on my first interrupt after re-enabling,
> will i get the full desired period, or half the timeout period?
RTI timer doesn't depend on the state of RTIE. Every time RTI timer reaches
timeout value, RTIF flag gets set, timer is reset and starts counting new
timeout period. So if I understood your question, then the answer is you'll
get full desired period. However keep in mind that if you disable RTIE for
too long, then you may lose RTI timout events.
Regards
Edward
>
> thanks guys,
> matt
> ------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )