16550 UART Initialization Routine

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
16550 UART Initialization Routine

I'm having a little trouble trying to get my 16550 to Receive
Characters. I can get it to transmit Bytes, but it will not receive
bytes.

My Initialization Routine is as follows:
LCR=0x80; // Set Baud Rate Divisor Latch to 1
DLM=0x00; // Set Baud Rate divider
DLL=0x1b;
LCR=0x03; // Set Divisor Latch to 1 and 8bit word length
MCR=0x00;
FCR=0x07; //Enable FIFOs and Reset the RX & TX FIFO. Set FIFO trigger
level to 1 byte
IER=0x0F; // Enable all Interrupts

THR=0x30; // This transmits "0" ASCII character

when I read the RBR register I always get 0x00 when I know I sent
characters to the port.

Any thoughts would be helpful.

Thanks,

Eric

Re: 16550 UART Initialization Routine
Quoted text here. Click to load it


Hi
 You enable interrupts?? Why if you intend to read the port. It might
be that the interrupt routine is reading your input before you get
there.
Also, are you waiting long enough for the loopback?
 Are you even looking at a loop back? Why would you expect
a sent character to be in the receive buffer??
Dwight

Re: 16550 UART Initialization Routine
Quoted text here. Click to load it


Hi
 I missed one. Why are you setting MCR to 0 ???
Dwight

Site Timeline