RTI Interrupt on MC9S08GB60

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

RTI Interrupt on MC9S08GB60

5,558 Views
glork
Contributor I
Hello All.
I've been using the 'GB60 for some time now (a really nice chip, by the way). For my previous applications I've used the main timer to provide the services of "heart-beat" interrupt (background timing, etc.) This works well.
In my new application the main timer is used for other things and isn't available for the heart-beat function so I tried to use the RTI sub-system. For some reason I can't get it to interrupt.

My application uses an external 10MHz clock-oscillator but I don't use that for the RTI. This is how I init the RTI:
; set rti for internal osc and 8mSec period
lda #$51
sta srtisc ; ack and set period
lda #$11
sta srtisc ; remove ack, enable irq

According to the doc I think that should do it, but it just never interrupts.

Any thoughts?
ron
Labels (1)
0 Kudos
7 Replies

429 Views
tonyp
Senior Contributor II
Although irrelevant to the problem you're having, I forgot to mention that in your example:
 
; set rti for internal osc and 8mSec period
lda #$51
sta srtisc ; ack and set period
lda #$11
sta srtisc ; remove ack, enable irq

the second write to SRTISC (lda #$11, sta srtisc) isn't necessary.  RTIACK is automatically cleared until next interrupt.  As the docs say writing 0 to the RTIACK bit has no meaning or effect.
 
0 Kudos

429 Views
glork
Contributor I
Hi Tonyp.
r.e. your second post; yeah, I got that too but I've learned to sometimes do something redundant rather than trust the doc too much.

I think my next test will be to use the external clock source (later today).
ron
0 Kudos

429 Views
alex_spotw
Contributor III
Hi GLork:

I had the same problem earlier this year. The issue is the the RTI doesn't work from the Internal Oscillator in Run Mode. It is clearly stated in the datasheet (page 67, if I'm not wrong). So it is not your code. It is the GT60.

Now, I'm using one of the TPM2Free interrupts that Processor Expert is able to configure. You can use the the RTI from the External Clock, but the max time is rather small (2.048ms with a 16MHz crystal).

Regards,

Alex

Message Edited by alex_spotw on 04-06-200608:35 AM

Message Edited by alex_spotw on 04-06-200608:36 AM

0 Kudos

429 Views
glork
Contributor I
Hello Alex.
Yes, you're exactly right ... my stupid. Section 5.7 page 67. Well, I have an external clock so I might as well use it.
ron

p.s. this is why this forum is so helpful.
0 Kudos

429 Views
peg
Senior Contributor IV

Yes,

and if we had a functional search facility here you might have found out even earlier!!!

I think I have found the main problem with these forums... they appear to be powered by a small battery. (see bottom right corner)

Sometimes they even have to take the forums offline to charge it up!

Peg

0 Kudos

429 Views
glork
Contributor I


peg wrote:

Yes,

and if we had a functional search facility here you might have found out even earlier!!!

I think I have found the main problem with these forums... they appear to be powered by a small battery. (see bottom right corner)

Sometimes they even have to take the forums offline to charge it up!

Peg






Hey Peg.
I like your idea of a good search utility although I have to admit that I'm not always bright enough to use one when its available.

As for the battery; I think freescale should use the new retro-battery. You can use the charge today that you're going to put in it next year (however if you forget to charge it next year it rips a hole in reality...very dangerous).
ron
0 Kudos

429 Views
tonyp
Senior Contributor II
Maybe you're resetting the RTI enable bits while trying to acknowledge it.
 
For example, instead of acknowledging with code like this:
 
RTI_Handler
 lda  SRTISC
 ora #RTIACK_
 sta SRTISC
 rti
you use code like this:
 
RTI_Handler
 lda #RTIACK_
 sta SRTISC
 rti
so that after the first call, it stops functioning.
 
Now, if that wasn't the problem, try to see what happens with the exact same code you have but using external clock.  This would catch a possible mask revision bug.
 
Just a thought.
 
0 Kudos