Vic Usage Notes - Philips LPC2119 User Manual

Arm-based microcontroller
Hide thumbs Also See for LPC2119:
Table of Contents

Advertisement

Philips Semiconductors
ARM-based Microcontroller

VIC USAGE NOTES

If user's code is runing from the on-chip RAM and an aplication uses interrupts, interrupt vectors must be re-mapped to flash
address 0x0. This is necessary because all the exception vectors are located at addresses 0x0 and above. This is easily achieved
by configuring MEMMAP register (located in System Control Block) to User RAM mode. Application code should be linked such
that at 0x4000 0000 the Interrupt Vector Tabe (IVT) will reside.
Although multiple sources can be selected (VICIntSelect) to generate FIQ request, only one interrupt service routine should be
dedicated to service all available/present FIQ request(s). Therefore, if more than one interrupt sources are classified as FIQ the
FIQ interrupt service routine must read VICFIQStatus to decide based on this content what to do and how to process the interrupt
request. However, it is recommended that only one interrupt source should be classified as FIQ. Classifying more than one
interrupt sources as FIQ will increase the interrupt latency.
Following the completion of the desired interrupt service routine, clearing of the interrupt flag on the peripheral level will propagate
to corresponding bits in VIC registers (VICRawIntr, VICFIQStatus and VICIRQStatus). Also, before the next interrupt can be
serviced, it is necessary that write is performed into the VICVectAddr register before the return from interrupt is executed. This
write will clear the respective interrupt flag in the internal interrupt priority hardware.
In order to disable the interrupt at the VIC you need to clear corresponding bit in the VICIntEnClr register, which in turn clears
the related bit in the VICIntEnable register. This also applies to the VICSoftInt and VICSoftIntClear in which VICSoftIntClear will
clear the respective bits in VICSoftInt. For example, if VICSoftInt=0x0000 0005 and bit 0 has to be cleared,
VICSoftIntClear=0x0000 0001 will acomplish this. Before the new clear operation on the same bit in VICSoftInt using writing into
VICSoftIntClear is performed in the future, VICSoftIntClear=0x0000 0000 must be assigned. Therefore writing 1 to any bit in Clear
register will have one-time-effect in the destination register.
If the watchdog is enabled for interrupt on underflow or invalid feed sequence only then there is no way of clearing the interrupt.
The only way you could perform return from interrupt is by disabling the interrupt at the VIC(using VICIntEnClr).
Example:
Assuming that UART0 and SPI0 are generating interrupt requests that are classified as vectored IRQs (UART0 being on the
higher level than SPI0), while UART1 and I
setup:
VICIntSelect = 0x0000 0000(SPI0, I2C, UART1 and UART0 are IRQ => bit10, bit9, bit7 and bit6=0)
VICIntEnable = 0x0000 06C0(SPI0, I2C, UART1 and UART0 are enabled interrupts => bit10, bit9, bit 7 and bit6=1)
VICDefVectAddr = 0x...
VICVectAddr0 = 0x...
VICVectAddr1 = 0x...
VICVectCntl0 = 0x0000 0026(interrupt source with index 6 (UART0) is enabled as the one with priority 0 (the highest))
VICVectCntl1 = 0x0000 002A(interrupt source with index 10 (SPI0) is enabled as the one with priority 1)
After any of IRQ requests (SPI0, I2C, UART0 or UART1) is made, microcontroller will redirect code execution to the address
specified at location 0x00000018. For vectored and non-vectored IRQ's the following instruction could be placed at 0x18:
LDR pc,[pc,#-0xFF0]
This instruction loads PC with the address that is present in VICVectAddr register.
In case UART0 request has been made, VICVectAddr will be identical to VICVectAddr0, while in case SPI0 request has been
made value from VICVectAddr1 will be found here. If neither UART0 nor SPI0 have generated IRQ request but UART1 and/or
2
I
C were the reason, content of VICVectAddr will be identical to VICDefVectAddr.
Vectored Interrupt Controller (VIC)
2
C are generating non-vectored IRQs, the following could be one possibility for VIC
(holds address at what routine for servicing non-vectored IRQs (i.e. UART1 and I2C) starts)
(holds address where UART0 IRQ service routine starts)
(holds address where SPI0 IRQ service routine starts)
LPC2119/2129/2292/2294
85
Preliminary User Manual
January 08, 2004

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2129Lpc2292Lpc2294

Table of Contents