Homework #10: Serial Communications Interface

• Read Chapter 24 of Almy’s Designing with Microcontrollers: The 68HCS12.
• You can skip the section called "Buffered I/O in C" on pages 244-245.
• Turn in answers to the following Questions, checking yourself against the answers given below for selected questions:
• Chapter 24 (page 250): Questions 1, 2, 3, 5, 6. Note the typo in Question 6: "byts" should be "bytes."
• Q1: When no data is being transmitted over a serial line using the RS232 standard, the logic level on the line is __________ (binary 0 or binary 1?) and this condition is called __________ (mark or space?).
• Q2: Which one of the following statements is true about start bits under the RS232 standard?
a.) We have the option of using no start bits, one start bit, or two start bits.
b.) We have the option of using no start bits or one start bit.
c.) We have the option of using one start bit or two start bits.
d.) We must use one start bit.
• Q3: Which one of the following statements is true about start bits under the RS232 standard?
a.) Start bits are always binary 1.
b.) Start bits are always binary 0.
c.) Start bits are sometimes binary 1 and sometimes binary 0.
• Q4: Which one of the following statements is true about stop bits under the RS232 standard?
a.) We have the option of using no stop bits, one stop bit, or two stop bits.
b.) We have the option of using no stop bits or one stop bit.
c.) We have the option of using one stop bit or two stop bits.
d.) We must use one stop bit.
• Q5: Which one of the following statements is true about stop bits under the RS232 standard?
a.) Stop bits are always binary 1.
b.) Stop bits are always binary 0.
c.) Stop bits are sometimes binary 1 and sometimes binary 0.
• Q6: Which one of the following statements is true about parity bits under the RS232 standard?
a.) We have the option of using no parity bits, one parity bit, or two parity bits.
b.) We have the option of using no parity bits or one parity bit.
c.) We have the option of using one parity bit or two parity bits.
d.) We must use one parity bit.
• Q7: Which one of the following statements is true about parity bits under the RS232 standard?
a.) Parity bits are always binary 1.
b.) Parity bits are always binary 0.
c.) Parity bits are sometimes binary 1 and sometimes binary 0.
• Q8: a.) Draw a diagram, similar to the ones on page 229 of the textbook, showing the sequence of bits transmitted if we send the ASCII character "R" with even parity and with one stop bit. b.) Calculate the overhead due to framing. In other words, what percentage of the bits transmitted are start bits or stop bits? Show your calculation.
• Q9: As in the previous question, assume we are using even parity and one stop bit. Find the time required to transfer 10,000 ASCII characters if we transmit at a speed of 9600 bits per second. Show your calculation.
• Q10: a.) What is the name of the bit that must be set to 1 to enable transmission using serial communications interface SCI1? b.) In which register is that bit located?
• Q11: With a bus clock frequency of 24 MHz, what hex values should be loaded into the SCI1BDH and SCI1BDL registers to achieve a baud rate of 19,200 for SCI1? Give your answer as two hex values, one to be loaded in SCI1BDH and the other to be loaded into SCI1BDL. Show your calculation.
• Q12: When transmitting a data byte using SCI1, your program must place the data byte into which register?
• Q13: a.) What is the name of the bit that is set to 1 when SCI1’s transmit data register is empty? b.) In which register is that bit located?
• Q14: a.) What is the name of the bit that is set to 1 when SCI1’s receive data register is full? b.) In which register is that bit located?
• Q15: When receiving a data byte using SCI1, your program must read the data byte from which register?
• Chapter 24 Question 5: Store $01 into SCIBDH and$38 (or $39) into SCIBDL. • Q1: binary 1; mark • Q3: b • Q5: a • Q7: c • Q9: 10.4 seconds • Q11: Store$00 into SCIBDH and \$4E into SCIBDL.