Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | UART0 LPC2148 - RBR Interrupt

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 )