Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the voltage levels and drive strength for the HCS12 family that are dis

ID: 2081970 • Letter: C

Question

Consider the voltage levels and drive strength for the HCS12 family that are discussed in section 7.6 of the textbook. a. How much current can each output source or sink? b. What is the highest voltage that can be input and still be considered a logic 0? Consider the following keyboard wiring: a. How are the three registers DDRT, PERT, and PPST programmed for the keypad to work correctly? b. Write assembly-language code to program the four registers. c. What pattern is written out on PORTT to read the middle column of keys? d. What pattern is read back when the "8" key is pressed? Answer the following questions about RS232 and the HCS12 SCI (UART) a. In RS-232, what gets transmitted first - the LSB or the MSB? b. In RS-232, is MARK a logic 1 or a logic 0? c. In RS-232, is a START bit MARK or SPACE? d. For an E clock of 20 MHz, what baud-rate register setting gives a baud rate of approximately 9600 bits per second? e. For the baud-rate register setting you calculated, what is the exact baud rate that you obtained? f. Which bit is polled to determine if there is a character ready to be received?

Explanation / Answer

Q.3. Answer

In RS-232, whenever the serial port sends a logical one (1) a negative voltage is effected on the transmit pin.

Whenever the serial port sends a logical zero (0) a positive voltage is effected.

A)>>

Example:

Assume we want to send the letter ‘A’ over the serial port. The binary representation of the letter ‘A’ is 01000001.

Remembering that bits are transmitted from least significant bit (LSB) to most significant bit (MSB), the bit

stream transmitted would be as follows for the line characteristics 8 bits, no parity, 1 stop bit, 9600 baud.

LSB (0 1 0 0 0 0 0 1 0 1) MSB

The above represents (Start Bit) (Data Bits) (Stop Bit)

B) >>

When no data is being sent, the serial port’s transmit pin’s voltage is negative (1) and is said to be in

a MARK state . i.e is in RS-232 MARK is logic 1.

C) >>

The serial port can also be forced to keep the transmit pin at a positive voltage (0) and is said to be

the SPACE or BREAK state, thats why in RS-232 MARK is START bit

D)>>

Here clock frequency is 20MHz

Clock_per_bit = 20MHz/9600 = 208.33 ~ 208

>Thus 208 clock ticks required for each bit transmission, in order to get 9600 baud rate

>To get 9600 bout rate we have to store counter value of 208 in registers

E)>>

Here we calculated Clock per bit required for boud rate counter i.e. 208 ( 11010000 or xD0 ) clock counts per bit.

that count value we have to store in bout rate register.

F)>>

Clear To Send (CTS), asserted by modems if they can receive data.

Request To Send (RTS), asserted by terminals when they want to send data.