Determining interrupt vector number of RTT

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Determining interrupt vector number of RTT

Post by RyoDC »

Hello again.

I had an ARM controller (AT91SAM7L512 if be precise).

It had a Real-Time Timer built-in, which can generate an interrupt request each period of time.

The problem is, documentation didn't specify nor the interrupt vector number, nor how these interrupt should be handled, and I want to handle those interrupt in my C code (and I didn't found anything useful in Google).

Any ideas where I should look at?
How do I try to build a Dreamcast toolchain:
Image
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has thanked: 0
Been thanked: 0

Re: Determining interrupt vector number of RTT

Post by Ex-Cyber »

See section 23 of the full datasheet. It seems to say that all "system peripherals" share the nIRQ line (vector 0x00000018 according to the ARM7TDMI TRM) and that the ISR must check the individual peripherals' status registers to find out which one caused the interrupt. It also describes some other requirements like reading specific registers on the interrupt controller to acknowledge the start/end of interrupt processing.
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: Determining interrupt vector number of RTT

Post by RyoDC »

So I must find that line then?
How do I try to build a Dreamcast toolchain:
Image
Ex-Cyber
DCEmu User with No Life
DCEmu User with No Life
Posts: 3641
Joined: Sat Feb 16, 2002 1:55 pm
Has thanked: 0
Been thanked: 0

Re: Determining interrupt vector number of RTT

Post by Ex-Cyber »

No, I mean that there's a vector assigned to that physical interrupt line, i.e. when nIRQ is asserted, the processor fetches the next instruction from 0x00000018. IIRC, a jump instruction is normally placed there to jump to the actual ISR code. Exactly how to do this depends on the toolchain, and I've only ever done C ISRs on a specific AVR compiler, so I wouldn't know the details.
"You know, I have a great, wonderful, really original method of teaching antitrust law, and it kept 80 percent of the students awake. They learned things. It was fabulous." -- Justice Stephen Breyer
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: Determining interrupt vector number of RTT

Post by RyoDC »

Got'ya. Anyway, thank you very much for you help, you've shed a light in these darkness.
How do I try to build a Dreamcast toolchain:
Image
Post Reply