Timers and ATD
Timers and ATD
Features Covered
Timers
Input Capture
ATD
Features Not Covered
Pulse Accumulator
OC7 Data Output
Timer Modes
Set to 1 to enable
Clock counts in TCNT
Creating a regular time interrupt 1
Clock prescale @ 8MHz
Resolution = 125ns X Prescale Factor
Max Duration = 125ns X Prescale Factor X (2^16)
Interrupt Triggering
Timer7IRQ
Signal
-Buffer Conditioning
+
Source
For Low Frequency Signals 0~5V
Add a resistor to protect HC12 in case
input goes above 5V or less than ground.
<1K
R
68HC12
Powering On the ATD
4 Or 8 Conversions
Divide Conversions between registers?
Run Continuously?
Which Ports to run conversion on
•Sample Values
$70 -Continuously do one conversion on each ATD port
$67 -Continuously do 8 conversion sequences on port 7
Getting the Results
• Read ADRnH to get 8 ( or 10 ) bits of ATD
data Most significant 8 bits in ADRnH,
lower two bits in ADRnL.
• If the flag in ATDSTAT is 1, the
conversion is complete.