Discussion group dedicated to the Philips LPC2000 family of ARM MCUs
UART0 LPC2148 - RBR Interrupt - sb_gustavo - Sep 27 2:35:52 2007
Hi friends,
I need to use the LPC2148 UART0 data RX interruption (RBR interrupt
or RDA), however the interruption is not happening.
The software below doesn't work.
I'm using the compiler of the IAR Workbench.
Please, help me!
#include
#define green 0x00400000
int data;
__irq void uart0 (void);
int main(void)
{
int cont, delay;
/* Clock - APB e PLL */
VPBDIV = 0x00;
/* IO´s */
IO0DIR = 0x826FFD5D;
IO1DIR = 0x010E0000;
PINSEL0 = 0x00001505;
PINSEL1 = 0x15004000;
PINSEL2 = 0x00000000;
/* UART0 - 9600bps */
U0LCR = 0x83;
U0DLL = 0x27;
U0DLM = 0x00;
U0LCR = 0x03;
U0FCR = 0x07;
U0IER = 0x01; // enable RDA interrupt
/* Interrupt*/
VICProtection = 0; // disable protection
VICIntEnClear = 0xFFFFFFFF; // disable all interruptions
VICIntSelect &= 0xFFFFFFBF; // IRQ
VICVectAddr0 = (unsigned)&uart0;
VICVectCntl0 = 0x20 | 6;
VICIntEnable = 0x00000040; // enable
while(1)
{
blah....
blah....
blah....
}
}
__irq void uart0 ()
{
data = U0RBR; // receives data
IO0SET = green;
U0THR = data; // send to computer *It doesn't happen*
VICVectAddr = 0x0;
}

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )
Re: UART0 LPC2148 - RBR Interrupt - Joel Winarske - Sep 27 3:37:42 2007
sb_gustavo wrote:
> Hi friends,
>
> I need to use the LPC2148 UART0 data RX interruption (RBR interrupt
> or RDA), however the interruption is not happening.
> The software below doesn't work.
> I'm using the compiler of the IAR Workbench.
>
> Please, help me!
I don't see you enabling interrupts for starters.
somewhere before your while(1) place:
__enable_interrupt();
It may require
#include
for IAR4
#include for IAR5
I have a IAR UART example here targeting LPC2148:
http://www.indyelectronics.com/code.lpc214x.peripherals.iar.zip
Joel

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )Re: UART0 LPC2148 - RBR Interrupt - sb_gustavo - Oct 4 17:32:23 2007
--- In l...@yahoogroups.com, "Joel Winarske"
wrote:
>
> sb_gustavo wrote:
> > Hi friends,
> >
> > I need to use the LPC2148 UART0 data RX interruption (RBR
interrupt
> > or RDA), however the interruption is not happening.
> > The software below doesn't work.
> > I'm using the compiler of the IAR Workbench.
> >
> > Please, help me!
> I don't see you enabling interrupts for starters.
>
> somewhere before your while(1) place:
> __enable_interrupt();
>
> It may require
> #include for IAR4
> #include for IAR5
> I have a IAR UART example here targeting LPC2148:
> http://www.indyelectronics.com/code.lpc214x.peripherals.iar.zip
> Joel
>
Joel,
I made the alteration what you recommended.
The interruption is happening, but it isn't executing the function
uart0.
What can be the problem?

(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )