Posted by : Anonymous Sunday, 13 January 2013


Assignment 

Read carefully the C-language program in your course handouts (page 127-129). In this program, you are told how to set various serial port parameters. Based on the knowledge you gain here, answer the following by writing appropriate C-language instruction with single line comments to achieve stated task.


S.No.TaskC-Language Instruction with single line comments
1Write a single line of code to set the com pointer variable to COM port 3.
2Write a single line of code to set the size of Word Length to 8-bits to be used in serial communication for data transmission.
3Write a single line of code to set the size of Stop bits equals 3 in serial port communication.
4Write a single line of code to turn ON the parity bit and use Even parity.
5In the following piece of code, the Baud rate being used is 1200. Modify it in a way such that we shall have Baud Rate of 2400.

outportb ((*com)+3,inport((*com)+3)|0x80);
outportb ( (*com),0x60);
outportb( (*com) +1, 0x00);

Leave a Reply

Subscribe to Posts | Subscribe to Comments

- Copyright © virtual university of pakistan - Skyblue - Powered by Blogger - Designed by Johanes Djogan -