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
16550 UART Initialization Routine
Started by ●July 31, 2008
Reply by ●August 1, 20082008-08-01
On Jul 31, 3:11 pm, Eric <ericjohnholl...@hotmail.com> wrote:> 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, > > EricHi 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 by ●August 1, 20082008-08-01
On Aug 1, 10:44 am, "dkel...@hotmail.com" <dkel...@hotmail.com> wrote:> On Jul 31, 3:11 pm, Eric <ericjohnholl...@hotmail.com> wrote: > > > > > 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 > > 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?? > DwightHi I missed one. Why are you setting MCR to 0 ??? Dwight