
MOTOROLA
A-16
USING THE QSPI FOR ANALOG DATA AQUISITION
For More Information On This Product,
Go to: www.freescale.com
QSM
REFERENCE MANUAL
0000504C
0000504C
6146
600C
BSR.B
BRA.B
MOVE.W
CMP.W
BHI.B
BSR.B
The following code segment will control
a temperature using a 5 count deadband.
MOVE.W
SETPT,D0
SUBQ.W
#5,D0
CMP.W
TEMP,D0
BCS.B
OK1
BSR
HEATON
BRA
DOVOLTS
MOVE.W
SETPT,D0
ADDQ.W
#5,D0
CMP.W
EMP,D0
BHI.B
DOVOLTS
BSR
HEATON
The following code segment will measure voltage on
A/D channel 4 and scale the result into millivolts.
MOVE.W
#VREF,D0
load scale numerator (VREF = 5000 mV)
MULU.W
VOLTAGE,D0
multiply by A/D channel 4 conversion result
LSR.L
#8,D0
divide by 256
LSR.L
#2,D0
divide by 4 (total of divide by 1024)
CLR.W
D1
ADDX.W
D1,D0
round for maximum accuracy, result in D0
BSR.B
DISPV
display voltage on a digital readout
RTE
return from interrupt service routine
EQU *
dummy subroutines
EQU *
EQU *
EQU *
EQU *
RTS
0 Error(s)
0 Warning(s)
LOPRESS
CHKTEMP
generate fuel pressure warning
speeds up interrupt service routine
*
CHKRCV
00005050
00005054
00005058
303C 0145
B078 FD00
6202
#325,D0
FUELPSI,D0
CHKTEMP
constant for recovered fuel pressure
test if A/D pressure result is above minimum
*
0000505A
6138
PRESSOK
cancel fuel pressure warning
*
*
*
*
*
*
CHKTEMP
0000505c
00005060
00005062
00005066
3038 4000
5B40
B078 FD02
6508
get temperature setpoint
compute lower threshold
compare with A/D result
branch if actual temp. is above threshold
*
*
00005068
0000506c
00005070
00005074
00005076
0000507a
6100 002A
6000 001
3038 4000
5A40
B078 FD02
6204
activate heater
speeds up interrupt service routine
get temperature setpoint
compute upper threshold
compare with A/D result
branch if actual temp. is below threshold
OK1
*
0000507c
6100 0016
activate heater
*
*
*
*
*
*
DOVOLTS
00005080
00005084
00005088
0000508a
0000508c
0000508e
00005090
303C 1388
C0f8 FD04
E088
E488
4241
D141
6102
*
*
00005092
4E73
*
*
LOPRESS
PRESSOK
HEATON
HEATOFF
DISPV
00005094
00005094
00005094
00005094
00005094
00005094
4E75
*
*
=======
=======
Figure A-9 Use of QSPI to Control A/D Conversions 2 MHz A/D (Sheet 4 of 4)
F
Freescale Semiconductor, Inc.
n
.