Hardware Reference
In-Depth Information
Start
Perform reset initialization
Perform key-wake-up initialization
Enable key-wake-up interrupt
Start a timer
Yes
User service request?
Service the request
No
No
Timer times out?
Yes
Enter low-power mode
(execute stop or wai instruction)
Yes
after servicing the interrupt
Key-wake-up interrupt?
No
I mplemented
in hardware
Stay in low-power mode
Figure 7.43 Logic flow of embedded applications that incorporate key-wake-up feature
Example 7.10
Write an instruction sequence to configure the Port P upper four pins for the key-wake-up
feature. Program Port P so that pins PP7,PP4 generate an interrupt whenever there is a falling
edge applied to any one of these four pins.
Solution:
#include
“c:\miniide\hcs12.inc”
bclr
DDRP,$F0
; configure PP<7:4> pins for input
bset
PERP,$F0
; enable PP7 , PP4 pins' pull device
Search WWH ::




Custom Search