Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B

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

Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B

2,440 Views
suma_success
Contributor II

Kindly let me know about how to create a delay of 1 minute  using timer interrupts. With prescalar 128 , we get about 2 ms delay!

0 Kudos
Reply
5 Replies

2,314 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Suma

I suggest you take use of processor expert component to set up interrupt period:

pastedImage_1.png

after generating code, take a look at the generated TimerInt initialization code.

Have a nice day,

Jun Zhang

0 Kudos
Reply

2,314 Views
suma_success
Contributor II

I cannot see the components in processor expert as I have trial version of codewarrior. Is there any method to set delay of 1 sec using timers in  main.c ?

Also , if I use RTI and Timer interrupts in the same program , what would be the priority?

Best Regards,

Suma

On Tuesday, April 21, 2020, 01:25:50 PM GMT+4, ZhangJennie <admin@community.nxp.com> wrote:

#yiv4620443481 * #yiv4620443481 a #yiv4620443481 body {font-family:Helvetica, Arial, sans-serif;}#yiv4620443481 #yiv4620443481 h1, #yiv4620443481 h2, #yiv4620443481 h3, #yiv4620443481 h4, #yiv4620443481 h5, #yiv4620443481 h6, #yiv4620443481 p, #yiv4620443481 hr {}#yiv4620443481 .yiv4620443481button td {}

|

NXP Community

|

Re: Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B

reply from ZhangJennie in CodeWarrior for MCU - View the full discussion

Hi Suma

I suggest you take use of processor expert component to set up interrupt period:

https://community.nxp.com/servlet/JiveServlet/downloadImage/2-1301113-310648/pastedImage_1.png

 

after generating code, take a look at the generated TimerInt initialization code.

 

Have a nice day,

Jun Zhang

Reply to this message by replying to this email, or go to the message on NXP Community

Start a new discussion in CodeWarrior for MCU by email or at NXP Community

Following Re: Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B in these streams: Inbox

This email was sent by NXP Community because you are a registered user.

You may unsubscribe instantly from NXP Community, or adjust email frequency in your email preferences

0 Kudos
Reply

2,314 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI Suma

The lower interrupt vector number, the higher priority. Thus RTI has higher priority.

the timer setting depends on the external clock. what's your external clock? 16M? let me know, I will generate code and send to you.

Jun Zhang

0 Kudos
Reply

2,314 Views
suma_success
Contributor II

Thanks a ton.System clock is 48MHz and Bus clock is 24MHz for Timers Oscillator clock is 8MHz for RTI . Warm Regards,Suma

Sent from Yahoo Mail on Android

On Thu, 23 Apr 2020 at 2:23 pm, ZhangJennie<admin@community.nxp.com> wrote:

#yiv4078291584 * #yiv4078291584 a #yiv4078291584 body {font-family:Helvetica, Arial, sans-serif;}#yiv4078291584 #yiv4078291584 h1, #yiv4078291584 h2, #yiv4078291584 h3, #yiv4078291584 h4, #yiv4078291584 h5, #yiv4078291584 h6, #yiv4078291584 p, #yiv4078291584 hr {}#yiv4078291584 .yiv4078291584button td {}

|

NXP Community

|

Re: Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B

reply from ZhangJennie in CodeWarrior for MCU - View the full discussion

HI Suma

The lower interrupt vector number, the higher priority. Thus RTI has higher priority.

the timer setting depends on the external clock. what's your external clock? 16M? let me know, I will generate code and send to you.

 

Jun Zhang

Reply to this message by replying to this email, or go to the message on NXP Community

Start a new discussion in CodeWarrior for MCU by email or at NXP Community

Following Re: Generate delay of 1 minute using Timer /RTI interrupts in MC9S12DG256B in these streams: Inbox

This email was sent by NXP Community because you are a registered user.

You may unsubscribe instantly from NXP Community, or adjust email frequency in your email preferences

0 Kudos
Reply

2,314 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Suma, 

If Oscilator source is 8MHz. it's not possible to generate 1ms interrupt.see below setting. see below setting, I set the divide register to maximum, the maximal interval is 131.072ms

pastedImage_1.png

Thanks,

Jun Zhang