Hardware Reference
In-Depth Information
Inputs
Qn Flip-Flops
Outputs
Operating
Mode
PL
CE
CP
D S
D0-D7
Q0
Q1-Q6
Q7
Q7
Parallel
load
L
L
X
X
X
X
X
X
L
H
L
H
L-L
H-H
L
H
H
L
Serial
shift
H
H
L
L
1
h
X
X
L
H
q0-q5
q0-q5
q6
q6
q6
q6
Hold
H
H
X
X
X
q0
q1-q6
q7
q7
Table E10.4 Function table of the 74HC165
The 74HC165 can be cascaded. To cascade, the Q7 output is connected to the DS input of its
adjacent 74HC165. All 74HC165s should share the same shift clock SC. Suppose we want to
use two 74HC165s to interface with two DIP switches so that four hex digits can be read in by
the HCS12. Describe the circuit connection and write an instruction sequence to read the data
from these two DIP switches.
E10.5 Suppose you are going to use four 74HC595s to drive four seven-segment displays using
the circuit shown in Figure 10.10. Write an instruction sequence to display the number 1982 on
these four seven-segment displays.
E10.6 Write a program to display the number 1, 2, . . . , 8 on the eight seven-segment displays
in Figure 10.12. Display one digit at a time and turn off the other seven digits. Each digit is dis-
played for 1 s. Perform this operation continuously.
E10.7 Write the C language version of the program for Example 10.8.
E10.8 The Microchip TC77 is a small-footprint digital temperature sensor with a 13-bit resolution.
This device uses a single pin for temperature I/O, which one would need to use the SPI bidirectional
mode to read the temperature. The data sheet of this device is included in the complementary CD
(it can also be downloaded from the Microchip website, http://www.microchip.com ). Describe the
circuit connection of this chip and the HCS12. Write a program to confi gure the TC77 to continu-
ous conversion mode, read the temperature once every second, and display the temperature on the
LCD. The block diagram and the pin assignment of the TC77 are shown in Figure E10.8.
TC77
Internal
diode
temperature
sensor
V DD
Manufacturer
ID register
CS
1
5
V DD
CS
SI/O
SCK
Serial
port
interface
13-bit
sigma delta
ADC
V SS
TC77
2
SCK
3
4
SI/O
Configuration
register
Temperature
register
Figure E10.8 Pin assignment and block diagram of the TC77
 
Search WWH ::




Custom Search