Assignment No. 05 CS609: System Programming |
Total Marks: 20
Due Date: EXPIRED |
||||||||||||||||||||
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.
Submission You are required to submit a single MS word file through LMS containing:
|
|||||||||||||||||||||
IDEA Solution
S.No. | Task | C-Language Instruction with single line comments |
1 | Write a single line of code to set the com pointer variable to COM port 3. | Outportb((* com)+3)
|
2 | Write a single line of code to set the size of Word Length to 8-bits to be used in serial communication for data transmission. |
Outportb((*com)+3),0x03);
|
3 | Write a single line of code to set the size of Stop bits equals 3 in serial port communication. | In serial communication we can’t sets stop bit to3. Only stop bit can be sets to 1 , 1.5 or2 through out |
4 | Write a single line of code to turn ON the parity bit and use Even parity. | Outportb((*com)+3,0×18);
|
5 | In 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);
|
Outportb((*com)+3,import((*com)+3)|0x80);
Outportb((*com),0x03); Outportb((*com)+1,0×00); |