We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi !
From official doc for this device I cannot find the VICVectCntl definition : http://www.keil.com/dd/docs/datashts/philips/lpc23xx_um.pdf
I see this register in Blinky Example code but dont't kown howto to handle it ?
Thanks for response.
I did use a code without settings this register and that works. note : In the interrupt ISR I have to set VICAddress to any value conforming to user manual (chap 6.5.11) but in fact this is the register 'VICVectAddr'
Please refer to the below URL.
http://www.keil.com/forum/15990/
Read Per Westermark's post at 25-Nov-2009 04:38 GMT
Looks like code copied from a LPC21xx chip. They had a VICVectCntXX register that mapped what peripherial that was connected to each of the positions on the VIC. Expected value was 0x20 + the interrupt channel, where the 0x20 was to enable the slot. You controlled the priority of the different devices by selecting slot 0..15 and then you had to configure what device that used the slot.
The LPC23xx has hard-coded indexing, so this register is now actually renamed to VICVectPriorityXX (but not renamed by Keil...) and instead of selecting a VIC slot to control priority, you now use the hard-coded slot for the device but configures the priority for the slot (interrupt source). Expected value is the priority as a value 0..31.
Right. Thanks for the link. I post here my code if it helps.
//! User timer1 interrupt routine static T_PISR pTimerUserRoutine = NULL ; //! Initialize timer 0 /*! Does nothing as TIMER0 is reserved for OS */ void timer0_init() { // Do nothing } //! routine called when TIMER1 TC match T1MR0 void T1_MR0_ISR (void) __irq { // Call user defined function (*pTimerUserRoutine)() ; T1IR |= 0x1; /* Reset MR0 interrupt flag */ VICVectAddr = 0; /* Acknowloedge interrupt - necessary - */ } //! Initialize timer 1 /*! Timer 1 will be used for periodic loop It will generate interrupt and call our routine \param timeout : value to set, unit O.1ms \param pIsr : pointer to our PISR function. if NULL no interrupt is set. \note : timer is disabled after calling this function */ void timer1_init(unsigned int timeout, T_PISR pIsr) { timer_disable(1) ; timer_reset(1) ; T1CTCR &= 0xFC ; /* bits 1:0 Select Timer Mode */ T1PR = 0 ; /* Increment Prescaler at each cycle*/ T1MCR |= (1 << 1) ; /* bit1 Reset on MR0 Match */ T1MR0 = (timeout * 1200) ; /* timeout * 1E-4 * 12E6 */ if (pIsr != NULL) { T1MCR |= 1 ; /* Generate interrupt on match */ pTimerUserRoutine = pIsr ; VICVectAddr5 = (unsigned long)T1_MR0_ISR ; /* Set Interrupt Vector */ VICIntEnable |= (1 << 5) ; /* Enable Timer1 Interrupt */ VICIntSelect &= ~(1 << 5) ; /* Enable Timer1 Interrupt */ VICVectPriority5 = 0 ;/* Set it to the most priority 0-15 */ // VICVectCntl5 = 15; /* I see it in example code but not documented & work whitout */ } }