Advertisement

04.02.2003 at 04:11PM PST, ID: 20572293
[x]
Attachment Details

Serial IO programming in C on 16450/16550 UART

Asked by cpe_student in C Programming Language

Tags: uart, c, programming

the task is:

a) using the BIOS 14h serial port services, write a program in C (inline ASM when necessary) to read a char from the
   keyboard,send it to the COM2 port,recieve back from COM2, and echo it to the screen.
   I am OK as far as reading the char from the keyboard and echoing to the screen.The part I am hung up on is what is
   the sequence of events necessary to prepare the UART,send the data,and recieve the data. I have a table of the
   registers in the UART and I have a loopback plug for the COM2 port.

b) in only C, send a char to COM2,read the char from COM2 using polling, and then echo it to the screen using memory
   mapped IO. I have written programs in ASM to write to the screen using memory mapped IO, but I don't understand how
   to translate the assembly into C code.

c) same as above but write an ISR to read from the COM2 port.You must specifically enable the COM2 interrupt.
   My understanding is that bit 3 in the Interrupt Mask Register of the PIC must be cleared in order to
   enable the COM2 interrupt. Beyond that I am confused about what to do with the UART and in what order to do it.

   I am ok on how to get and save an ISR from the IVT and replace it with my own.

Any help in understanding how the UART works and how to program it would be great.

CpE student

Start Free Trial
 
Loading Advertisement...
 
[+][-]04.02.2003 at 06:55PM PST, ID: 8258406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.02.2003 at 07:34PM PST, ID: 8258547

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Tags: uart, c, programming
Sign Up Now!
Solution Provided By: honey_hamster
Participating Experts: 3
Solution Grade: A
 
 
[+][-]04.02.2003 at 07:44PM PST, ID: 8258589

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.16.2004 at 08:59PM PDT, ID: 10847685

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]04.21.2004 at 12:42PM PDT, ID: 10882046

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32