16550 UART Initialization Routine

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

Reply to
Eric
Loading thread data ...

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

Reply to
dkelvey

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

Reply to
dkelvey

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.