Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Interrupt Handline

2004-11-07 by microbit

Hi Robert,

I went through the same "wondering".
I noticed that the VICVectAddr gets reset after the vector to weak
irq_handler. I just copped out and replaced

>   ldr pc, [pc, #irq_handler_address - . - 8]

with the classic :

ldr    pc, [pc , # -0xFF0]

That sets up VIC to directly vector to your IRQ handler address programnmed
in.

PS : Don;t forget to update your bootloader checksum in vector table when
you change it !

-- Kris


----- Original Message -----
From: "Robert Wood" <robert.wood@...>
To: <lpc2000@yahoogroups.com>
Sent: Sunday, November 07, 2004 11:17 PM
Subject: [lpc2000] Interrupt Handline


> Hi folks,
>
> I'm struggling to understand how to handle interrupts for the 2294. I can
see
> that when I get an interrupt, the processor jumps off to the following
line
> of code in the startup assembly file:
>
>   ldr pc, [pc, #irq_handler_address - . - 8]
>
> This then jumps off to the following line of code:
>
> irq_handler:
>   b irq_handler
>
> There is a comment that these are defined as weak variables and can be
> redefined in user code. So, at the moment, it's quite easy to see that
when
> there's an interrupt the program just gets stuck on this line of code. It
> seems obvious that I then have to redirect this code to the appropriate
> interrupt handler. I would have thought that I need to read the
VICVectAddr
> which should contain the address of one of the registers VICVectAddr0 to
> VICVectAddr15. I assume that the program would jump to that VICVectAddrX
> register and then from there to the user code which has been written to
deal
> with the interrupt.
>
> What I'm not clear about is how to replace this line of code:
>
> irq_handler:
>   b irq_handler
>
> To something like:
>
> irq_handler:
>   b (VICVectAddr)
>
> In other words, when I get to the line of code
>
> irq_handler:
>
> Then jump to the location pointed to be the contents of VICVectAddr. I
assume
> that if I can set that up, the compiler will sorted out jumping to
wherever
> VICVectAddrX points to.
>
> Am I basically correct in my assumptions, or way off line?!
>
> Many thanks,
>
> Rob
>
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
>
>
>
>
>
> --------------------------------------------------------------------------
------
> Yahoo! Groups Links
>
>   a.. To visit your group on the web, go to:
>   http://groups.yahoo.com/group/lpc2000/
>
>   b.. To unsubscribe from this group, send an email to:
>   lpc2000-unsubscribe@yahoogroups.com
>
>   c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.