Yahoo Groups archive

Lpc2000

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

Thread

interrupt lost (all)

interrupt lost (all)

2005-11-29 by ualbe

Hi,
I'm working with gcc, winidea editor and keil2130 development board.
I'm a problem on isr.
There are four isr: two for CAN reception, one for CAN error and one 
for timer 0 elapsed count.
can driver is CANAll1.10
Each IRQ flag works fine but the program flow doesn't jump into isr.
Can someone help me?
I'm a new user and I'm not very expert on ARM irq managment.



thanks in advance

Ubertelli Alberto

Re: [lpc2000] interrupt lost (all)

2005-11-29 by Ake Hedman, eurosource

Your initialization code should

1.) Select the CANIRQ as IRQ (not FIQ).
2.) Enable the interrupt on a specific pos.
3.) Set the IRQ routine address.
4.) Enable the CAN interrupt.

Sample for I2C below

// initialize the interrupt vector
VICIntSelect &= ~VIC_BIT (VIC_I2C0 );    // I2C selected as IRQ
VICVectCntl2 = VIC_ENABLE | VIC_I2C0;
VICVectAddr2 = (uint32_t)I2CISR;            // address of the ISR
VICIntEnable = VIC_BIT( VIC_I2C0 );        // I2C interrupt enabled

Cheers
/Ake

ualbe wrote:

> Hi,
> I'm working with gcc, winidea editor and keil2130 development board.
> I'm a problem on isr.
> There are four isr: two for CAN reception, one for CAN error and one
> for timer 0 elapsed count.
> can driver is CANAll1.10
> Each IRQ flag works fine but the program flow doesn't jump into isr.
> Can someone help me?
> I'm a new user and I'm not very expert on ARM irq managment.
>
>
>
> thanks in advance
>
> Ubertelli Alberto
>
>
>
>
>
> SPONSORED LINKS
> Microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg> 
> 	Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ> 
>
> 8051 microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "lpc2000
>       <http://groups.yahoo.com/group/lpc2000>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>


-- 
 ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org



[Non-text portions of this message have been removed]

Re: interrupt lost (all)

2005-11-29 by ualbe

Dear Ake,
I tested your VIC sequence but it still doesn't work.
I'm reading my code but It seem correct.
Here it is an example
thanks

Alberto

static init(void)
{
    // Init Vector Interrupt Controller
    VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
    VICIntSelect = 0x00000000L;
    
    // Install Default IRQVec
    VICDefVectAddr = (unsigned long) DefaultISR; // set interrupt 
vector
    
    // Initialisation of CAN interfaces
    // CAN interface 1, use IRQVec0, at 125kbit
    CANAll_Init(1,0,CANBitrate125k_60MHz); 
    
    // CAN interface 2, use IRQVec1, at 125kbit
    CANAll_Init(2,1,CANBitrate125k_60MHz); 
    
    // Set CAN Err ISR to IRQVec2
    CANAll_SetErrIRQ(2);
    
    // Initialize Timer Interrupt
    T0MR0 = 5999; // 100 microseconds = 6.000-1 counts
    T0MCR = 3; // Interrupt and Reset on MR0
    T0TCR = 1;  // Timer0 Enable
    
    // Set Timer0 ISR to IRQVec3
    VICVectAddr3 = (unsigned long) Timer0ISR; // set interrupt vector
    VICVectCntl3 = 0x20 | 4;  // use it for Timer 0 Interrupt
    VICIntEnable = 0x00000010;  // enable Timer0 Interrupt

}

void Timer0ISR (void) 
{
  gTimerTick++;
  T0IR = 1; // Clear interrupt flag
  VICVectAddr = 0xFFFFFFFF; // Acknowledge Interrupt
}

Re: [lpc2000] Re: interrupt lost (all)

2005-11-29 by Ake Hedman, eurosource

Alberto,

as far as I can see this looks OK. You never set up the prescaler 
divider for the timer but I don't remember the default for it so that 
may be OK.  Have you checked that the timer is actually running?

/Ake.

ualbe wrote:

> Dear Ake,
> I tested your VIC sequence but it still doesn't work.
> I'm reading my code but It seem correct.
> Here it is an example
> thanks
>
> Alberto
>
> static init(void)
> {
>     // Init Vector Interrupt Controller
>     VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
>     VICIntSelect = 0x00000000L;
>    
>     // Install Default IRQVec
>     VICDefVectAddr = (unsigned long) DefaultISR; // set interrupt
> vector
>    
>     // Initialisation of CAN interfaces
>     // CAN interface 1, use IRQVec0, at 125kbit
>     CANAll_Init(1,0,CANBitrate125k_60MHz);
>    
>     // CAN interface 2, use IRQVec1, at 125kbit
>     CANAll_Init(2,1,CANBitrate125k_60MHz);
>    
>     // Set CAN Err ISR to IRQVec2
>     CANAll_SetErrIRQ(2);
>    
>     // Initialize Timer Interrupt
>     T0MR0 = 5999; // 100 microseconds = 6.000-1 counts
>     T0MCR = 3; // Interrupt and Reset on MR0
>     T0TCR = 1;  // Timer0 Enable
>    
>     // Set Timer0 ISR to IRQVec3
>     VICVectAddr3 = (unsigned long) Timer0ISR; // set interrupt vector
>     VICVectCntl3 = 0x20 | 4;  // use it for Timer 0 Interrupt
>     VICIntEnable = 0x00000010;  // enable Timer0 Interrupt
>
> }
>
> void Timer0ISR (void)
> {
>   gTimerTick++;
>   T0IR = 1; // Clear interrupt flag
>   VICVectAddr = 0xFFFFFFFF; // Acknowledge Interrupt
> }
>
>
>
>
>
>
> SPONSORED LINKS
> Microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg> 
> 	Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ> 
>
> 8051 microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "lpc2000
>       <http://groups.yahoo.com/group/lpc2000>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>


-- 
 ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org



[Non-text portions of this message have been removed]

Re: interrupt lost (all)

2005-11-29 by clodic_pascal

CAN controller go in error if no other node.
Be sure your interrupt service routine is not a 'while (1) {} '

--- In lpc2000@yahoogroups.com, "ualbe" <ualbe@y...> wrote:
Show quoted textHide quoted text
>
> Dear Ake, 
> yes, the timer runs! I have no idea!
> 
> thanks Alberto
>

Re: [lpc2000] Re: interrupt lost (all)

2005-11-29 by Ake Hedman, eurosource

ualbe wrote:

> Dear Ake,
> yes, the timer runs! I have no idea!
>
> thanks Alberto
>
>

Do you get the same result with

  T0MCR = 1; // Interrupt and Reset on MR0

Also are  the global IRQ flag  enabled?

 /Ake

-- 
 ---
Ake Hedman (YAP - Yet Another Programmer)
eurosource, Brattbergavägen 17, 820 50 LOS, Sweden
Phone: (46) 657 413430 Cellular: (46) 73 84 84 102
Company home: http://www.eurosource.se      
Kryddor/Te/Kaffe: http://www.brattberg.com
Personal homepage: http://www.eurosource.se/akhe
Automated home: http://www.vscp.org

Re: [lpc2000] Re: interrupt lost (all)

2005-11-29 by Richard Duits

Make sure the startup code has the instruction at address 0x18:
ldr    pc, [pc, #-4080]

Richard Duits.



ualbe wrote:
Show quoted textHide quoted text
> Dear Ake,
> I tested your VIC sequence but it still doesn't work.
> I'm reading my code but It seem correct.
> Here it is an example
> thanks
>
> Alberto
>
> static init(void)
> {
>     // Init Vector Interrupt Controller
>     VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
>     VICIntSelect = 0x00000000L;
>    
>     // Install Default IRQVec
>     VICDefVectAddr = (unsigned long) DefaultISR; // set interrupt
> vector
>    
>     // Initialisation of CAN interfaces
>     // CAN interface 1, use IRQVec0, at 125kbit
>     CANAll_Init(1,0,CANBitrate125k_60MHz);
>    
>     // CAN interface 2, use IRQVec1, at 125kbit
>     CANAll_Init(2,1,CANBitrate125k_60MHz);
>    
>     // Set CAN Err ISR to IRQVec2
>     CANAll_SetErrIRQ(2);
>    
>     // Initialize Timer Interrupt
>     T0MR0 = 5999; // 100 microseconds = 6.000-1 counts
>     T0MCR = 3; // Interrupt and Reset on MR0
>     T0TCR = 1;  // Timer0 Enable
>    
>     // Set Timer0 ISR to IRQVec3
>     VICVectAddr3 = (unsigned long) Timer0ISR; // set interrupt vector
>     VICVectCntl3 = 0x20 | 4;  // use it for Timer 0 Interrupt
>     VICIntEnable = 0x00000010;  // enable Timer0 Interrupt
>
> }
>
> void Timer0ISR (void)
> {
>   gTimerTick++;
>   T0IR = 1; // Clear interrupt flag
>   VICVectAddr = 0xFFFFFFFF; // Acknowledge Interrupt
> }
>
>
>
>
>
>
> SPONSORED LINKS
> Microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g> 
> 	Microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg> 
> 	Pic microcontrollers 
> <http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ> 
>
> 8051 microprocessor 
> <http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A> 
>
>
>
> ------------------------------------------------------------------------
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "lpc2000
>       <http://groups.yahoo.com/group/lpc2000>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        lpc2000-unsubscribe@yahoogroups.com
>       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>

Re: interrupt lost (all)

2005-11-29 by Zdravko

Also make sure that all of your ISRs have at the end write to
VICVectAddr. Including your DefaultISR. If not VIC may stall untill
hardware reset of the device. 

--- In lpc2000@yahoogroups.com, Richard Duits <yahoo@r...> wrote:
>
> Make sure the startup code has the instruction at address 0x18:
> ldr    pc, [pc, #-4080]
> 
> Richard Duits.
> 
> 
> 
> ualbe wrote:
> 
> > Dear Ake,
> > I tested your VIC sequence but it still doesn't work.
> > I'm reading my code but It seem correct.
> > Here it is an example
> > thanks
> >
> > Alberto
> >
> > static init(void)
> > {
> >     // Init Vector Interrupt Controller
> >     VICIntEnClr = 0xFFFFFFFFL; // Disable all Ints
> >     VICIntSelect = 0x00000000L;
> >    
> >     // Install Default IRQVec
> >     VICDefVectAddr = (unsigned long) DefaultISR; // set interrupt
> > vector
> >    
> >     // Initialisation of CAN interfaces
> >     // CAN interface 1, use IRQVec0, at 125kbit
> >     CANAll_Init(1,0,CANBitrate125k_60MHz);
> >    
> >     // CAN interface 2, use IRQVec1, at 125kbit
> >     CANAll_Init(2,1,CANBitrate125k_60MHz);
> >    
> >     // Set CAN Err ISR to IRQVec2
> >     CANAll_SetErrIRQ(2);
> >    
> >     // Initialize Timer Interrupt
> >     T0MR0 = 5999; // 100 microseconds = 6.000-1 counts
> >     T0MCR = 3; // Interrupt and Reset on MR0
> >     T0TCR = 1;  // Timer0 Enable
> >    
> >     // Set Timer0 ISR to IRQVec3
> >     VICVectAddr3 = (unsigned long) Timer0ISR; // set interrupt vector
> >     VICVectCntl3 = 0x20 | 4;  // use it for Timer 0 Interrupt
> >     VICIntEnable = 0x00000010;  // enable Timer0 Interrupt
> >
> > }
> >
> > void Timer0ISR (void)
> > {
> >   gTimerTick++;
> >   T0IR = 1; // Clear interrupt flag
> >   VICVectAddr = 0xFFFFFFFF; // Acknowledge Interrupt
> > }
> >
> >
> >
> >
> >
> >
> > SPONSORED LINKS
> > Microprocessor 
> >
<http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g>

> > 	Microcontrollers 
> >
<http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg>

> > 	Pic microcontrollers 
> >
<http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ>

> >
> > 8051 microprocessor 
> >
<http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A>

> >
> >
> >
> >
------------------------------------------------------------------------
> > YAHOO! GROUPS LINKS
> >
> >     *  Visit your group "lpc2000
> >       <http://groups.yahoo.com/group/lpc2000>" on the web.
> >        
> >     *  To unsubscribe from this group, send an email to:
> >        lpc2000-unsubscribe@yahoogroups.com
> >       <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>
> >        
> >     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> >       Service <http://docs.yahoo.com/info/terms/>.
> >
> >
> >
------------------------------------------------------------------------
> >
>

Re: interrupt lost (all)

2005-11-30 by ualbe

Hi,
at the address 0x18 I have only a jump to start code.
I tried to insert the instruction ldr pc, [pc, #-4080]
but the behavior doesn't change.
Here is the my vector table: 

.global _start
  B	_start         /* RESET INTERRUPT */
  B _start
  B	_start             /* UNDEFINED INSTRUCTION INTERRUPT */
  B	_start             /* SOFTWARE INTERRUPT */
  B	_start             /* ABORT (PREFETCH) INTERRUPT */
  B	_start             /* ABORT (DATA) INTERRUPT */
  B	_start             /* RESERVED */
  LDR     PC, [PC, #-0x0FF0]     /*B	_start*/
  B	_start		       /* FIQ INTERRUPT */
              
.end

Alberto Ubertelli

Re: interrupt lost (all)

2005-11-30 by Zdravko

Actually now you have LDR PC, [PC, -0x0FF0] at address 0x1C not 0x18.
Or may be you post wrong code. 
If it does not help be sure that you correctly map the Exeptions
Vector Table.  

--- In lpc2000@yahoogroups.com, "ualbe" <ualbe@y...> wrote:
Show quoted textHide quoted text
>
> Hi,
> at the address 0x18 I have only a jump to start code.
> I tried to insert the instruction ldr pc, [pc, #-4080]
> but the behavior doesn't change.
> Here is the my vector table: 
> 
> .global _start
>   B	_start         /* RESET INTERRUPT */
>   B _start
>   B	_start             /* UNDEFINED INSTRUCTION INTERRUPT */
>   B	_start             /* SOFTWARE INTERRUPT */
>   B	_start             /* ABORT (PREFETCH) INTERRUPT */
>   B	_start             /* ABORT (DATA) INTERRUPT */
>   B	_start             /* RESERVED */
>   LDR     PC, [PC, #-0x0FF0]     /*B	_start*/
>   B	_start		       /* FIQ INTERRUPT */
>               
> .end
> 
> Alberto Ubertelli
>

Re: interrupt lost (all)

2005-12-01 by ualbe

hi,
i changed start up code and linker script and now I intercept a Timer0
interrupt request but I don't succeed to clear flag and service the 
following request.

Albert

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.