Hardware Reference
In-Depth Information
V
CC
(5 V)
R
1
8
HCS12
4
7
V
OUT
R
2
3
IRQ
555
Timer
6
2
1.44
f
=
(
R
1
+ 2
R
2
)
C
C
R
1
= 6.2 k
Ω
R
2
= 150 k
Ω
1
5
C
= 4.7
μ
F
0.01
μ
F
Figure L6.1
■
HCS12 IRQ pin interrupt circuit
The lab procedure is as follows:
Step 1
Connect the IRQ pin of the demo board to a debounced switch that can generate a clean
negative-going pulse. A debounced switch is available on the SSE256 demo board.
Step 2
Enter the main program and IRQ service routine, assemble them, and then download them
to the single-board computer. Remember to enable the IRQ interrupt in your program.
Step 3
Pulse the switch 10 times. If everything works properly, you should see the D-Bug12
monitor prompt after 10 pulses applied to the IRQ pin.
L6.3
RTI Interrupts
and
LED fl ashing
. Write a C (or assembly) program to fl ash the LEDs on
your demo board with the following patterns:
1. Turn on all LEDs for about 0.4 s and turn them off also for about 0.4 s.
2. Repeat step 1 three more times.
3. Turn on one LED at a time from left to right with each LED turned on for about 0.4 s.
4. Repeat step 3 three more times.
5. Turn on one LED at a time from right to left with each LED turned on for about 0.4 s.
6. Repeat step 5 three more times.
7. Turn LEDs driven by pins RB7 and RB0 on and off four times. The on-time and off-time
are each about 0.4 s.
8. Turn LEDs driven by pins RB6 and RB1 on and off four times. The on-time and off-time
are each about 0.4 s.
9 . Turn LEDs driven by pins RB5 and RB2 on and off four times. The on-time and off-time
are each about 0.4 s.
10. Turn LEDs driven by pins RB4 and RB3 on and off four times. The on-time and off-time
are each about 0.4 s.
11. Turn LEDs driven by pins RB3 and RB4 on and off four times. The on-time and off-time
are each about 0.4 s.
Search WWH ::
Custom Search