--- In lpc2000@yahoogroups.com, "mobilsiten" <petertholander@h...> wrote:
>
> I cant get this to work. I only want to turn on a led if I recive
> something on UART1.
> This is the code:
>
> void init_serial (void) // Initialize Serial Interface
> {
> unsigned dummy;
> unsigned short baud = 9600, baud_rate;
>
> PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */
>
> U1LCR = 0x0D3; /* 8 bits, no Parity, 1 Stop bit */
> U1IER = 0; /* Disable UART1 Interrupts */
>
> VICVectAddr0 = (unsigned long)ElsyIRQ;
> VICVectCntl0 = 0x20 | 7; /* UART1 Interrupt */
> VICIntEnable = 1 << 7; /* Enable UART1 Interrupt */
>
> baud_rate = UART_BAUD(baud);
> U1DLL = (signed char)(baud_rate); //LSB
> U1DLM = (signed char)((baud_rate) >> 8); //MSB
> U1LCR = 0x00000003; // DLAB = 0
>
> dummy = U1IIR; /* Read IrqID - Required to Get Interrupts Started */
> U1IER = 3; /* Enable UART1 RX and THRE Interrupts */
>
> }
>
> void ElsyIRQ (void)
> {
> IOSET1 = 0x000F0000; // Turn on LEDs
> VICVectAddr = 0x00000000;
> }
>
> Can someone please help me?
Hmm, very strange! Now it works without any changes....
Thanks anyway!Message
Re: UART Problem
2005-03-02 by mobilsiten
Attachments
- No local attachments were found for this message.