Yahoo Groups archive

Lpc2000

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

Thread

IRQ - I don't know what me do. HELP!!! PLZ

IRQ - I don't know what me do. HELP!!! PLZ

2005-07-24 by alexmotin

Hello.

I have a big problem!

I use IAR 4.10B LPC2119 and i want to use IRQ UART1
I did it so:



  InstallHandler((unsigned int *)0x18, (unsigned int)
IRQ_ISR_Handler);
  VICIntEnable |= 0x80; 
  U1IER = 0x01;        
  __enable_interrupt();

where 

unsigned int InstallHandler(unsigned int *vector, unsigned int 
function)
{
  unsigned int vec, old_vec;

  vec = ((function - (unsigned int)vector - 8) >> 2);

  old_vec = *vector;
  vec |= 0xEA000000; /* add opcode for B instruction */
  *vector = vec;

  old_vec &= ~0xEA000000;
  old_vec = ( old_vec << 2 ) + (unsigned int)vector + 8;
  
  return(old_vec);
}



I have try a lot of kind to do it. But ARM always jump to 0x14 when 
happend interrupt.

If anybody know what to do, tell me please.

It will be very big hppy for me? becouase i have try to do it ll 
week.

Re: [lpc2000] IRQ - I don't know what me do. HELP!!! PLZ

2005-07-25 by Mike Nelson

Alex:

Do not modify the default IRQ handler as you have
shown below.  The default IRQ handler reads the
vector from the Vectored Interrupt Controller of
the ARM processor (VIC) to get the vector to your
UART1 interrupt service function.

You need to study how the VIC works and modify
its registers according to your needs.

Regards:

Mike Nelson

--- alexmotin <alexmotin@...> wrote:

> Hello.
> 
> I have a big problem!
> 
> I use IAR 4.10B LPC2119 and i want to use IRQ UART1
> I did it so:
> 
> 
> 
>   InstallHandler((unsigned int *)0x18, (unsigned
> int)
> IRQ_ISR_Handler);
>   VICIntEnable |= 0x80; 
>   U1IER = 0x01;        
>   __enable_interrupt();
> 
> where 
> 
> unsigned int InstallHandler(unsigned int *vector,
> unsigned int 
> function)
> {
>   unsigned int vec, old_vec;
> 
>   vec = ((function - (unsigned int)vector - 8) >>
> 2);
> 
>   old_vec = *vector;
>   vec |= 0xEA000000; /* add opcode for B instruction
> */
>   *vector = vec;
> 
>   old_vec &= ~0xEA000000;
>   old_vec = ( old_vec << 2 ) + (unsigned int)vector
> + 8;
>   
>   return(old_vec);
> }
> 
> 
> 
> I have try a lot of kind to do it. But ARM always
> jump to 0x14 when 
> happend interrupt.
> 
> If anybody know what to do, tell me please.
> 
> It will be very big hppy for me? becouase i have try
> to do it ll 
> week.
> 
> 
> 
> 
> 



		
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html

Re: IRQ - I don't know what me do. HELP!!! PLZ

2005-07-25 by genie_23432

--- In lpc2000@yahoogroups.com, "alexmotin" <alexmotin@y...> wrote:
> Hello.
> 
> I have a big problem!
> 
> I use IAR 4.10B LPC2119 and i want to use IRQ UART1
> I did it so:
> 
> 
> 
>   InstallHandler((unsigned int *)0x18, (unsigned int)
> IRQ_ISR_Handler);
>   VICIntEnable |= 0x80; 
>   U1IER = 0x01;        
>   __enable_interrupt();
> 
> where 
> 
> unsigned int InstallHandler(unsigned int *vector, unsigned int 
> function)
> {
>   unsigned int vec, old_vec;
> 
>   vec = ((function - (unsigned int)vector - 8) >> 2);
> 
>   old_vec = *vector;
>   vec |= 0xEA000000; /* add opcode for B instruction */
>   *vector = vec;
> 
>   old_vec &= ~0xEA000000;
>   old_vec = ( old_vec << 2 ) + (unsigned int)vector + 8;
>   
>   return(old_vec);
> }
> 
> 
> 
> I have try a lot of kind to do it. But ARM always jump to 0x14 when 
> happend interrupt.
> 
> If anybody know what to do, tell me please.
> 
> It will be very big hppy for me? becouase i have try to do it ll 
> week.

Had the same issue a little while ago (new at this ARM stuff also).  
The interrupt handler install function is only if you are running 
your interrupt vector table from RAM.  So either adjust your MEMMAP 
to reflect this or run the vector table from Flash.  If running from 
flash just place the following line before the interrupt service 
routine:

#pragma vector = 0x18

Has worked for me so far although I am having other issues with IAR 
(or setup).

Re: IRQ - I don't know what me do. HELP!!! PLZ

2005-07-27 by alexmotin

> Had the same issue a little while ago (new at this ARM stuff also).  
> The interrupt handler install function is only if you are running 
> your interrupt vector table from RAM.  So either adjust your MEMMAP 
> to reflect this or run the vector table from Flash.  If running from 
> flash just place the following line before the interrupt service 
> routine:
> 
> #pragma vector = 0x18
> 
> Has worked for me so far although I am having other issues with IAR 
> (or setup).

Hello!
I debug my programs in RAM and use MEMMAP = 0x02;
I have try to use #pragma vector = 0x18 and 0x40000018
And when i read memory from 0x18 and 0x40000018 it always was some 
stuff

i have try to debug it in flash but it was terrible - i don t 
understand how IAR tune for it:(

Re: [lpc2000] Re: IRQ - I don't know what me do. HELP!!! PLZ

2005-07-28 by 42Bastian Schick

alexmotin <alexmotin@...> schrieb am Wed, 27 Jul 2005 20:40:16 -0000:

Read up the LPC manual concerning VIC.
Then declare your routine as interrupt and enter its address into
vectaddrN in the VIC and enable it.
Don't expect the IDE to do it for you.

-- 
42Bastian Schick

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.