If i have to write an assembly language subroutine called Start, to initialise the Analog to Digital (ATD) ready to operate as required in Part 2 below for the MC68hc912D60A microprocessor.
Part 2.
Write an assembly language subroutine called TEMPIN that starts an 8 bit, left justified ATD conversion on channel 0, waits for the conversion to complete, reads the resulting data and returns the raw data reading in accumulator B. The raw data reading returned will be a positive number, $00 through to $A0 (decimal=160). This number is a measure of the temperature in steps of 0.25 C. For example an ATD value of $20 (decimal=32) equates to
32*0.25 = 8 C. Although larger numbers are possible from the ATD, the maximum range of values you can expect is 0 to 160 (0 - 40 C). Do not do any conversion in this routine
further into the task there are other sub routine called
- scale
-initialize timer
-delay
-split
-display
-main
Am i write by assembling the following code to initalise the
HC12
START
; INIILAISE THE ANALOG TO DIGITAL CONVERTER (ATD) T
TEMPIN EQU $0200 ;Memory location for temp in
SCALE EQU $0201 ;Memory for scale
INITMR EQU $0202 ;Memory to initalise timer
DELAY EQU $0203 ;Memory for timer delay
SPLIT EQU $0204 ;Memory for converting temperature
DISPLAY EQU $0205 ;Memory for digital display
PAD0 EQU $006F ;Memory location for temperature input
PORTT7 EQU $00AE ;Memory location for alarm
PORTT0 EQU $00AE ;Memory location for degrees c or f voltage
there is a diagram of the chip in the attachment where all the ports can been seen.
if anyone can provide me some information to whether i am correct or not that would be helpful.
thanks
Part 2.
Write an assembly language subroutine called TEMPIN that starts an 8 bit, left justified ATD conversion on channel 0, waits for the conversion to complete, reads the resulting data and returns the raw data reading in accumulator B. The raw data reading returned will be a positive number, $00 through to $A0 (decimal=160). This number is a measure of the temperature in steps of 0.25 C. For example an ATD value of $20 (decimal=32) equates to
32*0.25 = 8 C. Although larger numbers are possible from the ATD, the maximum range of values you can expect is 0 to 160 (0 - 40 C). Do not do any conversion in this routine
further into the task there are other sub routine called
- scale
-initialize timer
-delay
-split
-display
-main
Am i write by assembling the following code to initalise the
HC12
START
; INIILAISE THE ANALOG TO DIGITAL CONVERTER (ATD) T
TEMPIN EQU $0200 ;Memory location for temp in
SCALE EQU $0201 ;Memory for scale
INITMR EQU $0202 ;Memory to initalise timer
DELAY EQU $0203 ;Memory for timer delay
SPLIT EQU $0204 ;Memory for converting temperature
DISPLAY EQU $0205 ;Memory for digital display
PAD0 EQU $006F ;Memory location for temperature input
PORTT7 EQU $00AE ;Memory location for alarm
PORTT0 EQU $00AE ;Memory location for degrees c or f voltage
there is a diagram of the chip in the attachment where all the ports can been seen.
if anyone can provide me some information to whether i am correct or not that would be helpful.
thanks
Comment