getValue
;first do ADC-center value to discover direction
bsf dir,0 ; set direction, 1 = up
movlw high(center)
subwf NumH,f
movlw low(center)
subwf NumL,f
btfss STATUS,C
decf NumH,f
btfss NumH,7 ; is it negative
BRA notNeg
;need to negate acc
bcf dir,0 ; set direction, 1 = up
movlw 0xff
xorwf NumL,f
xorwf NumH,f
incf NumL,f
btfsc STATUS,Z
incf NumH,f
notNeg
; have now got a valid lookup value
BANKSEL EEADRL ; Select Bank for EEPROM registers
movfw NumL ;
movwf EEADRL
movfw NumH
addlw 0x0e
movwf EEADRH
bcf EECON1,CFGS ; Do not select Configuration Space
bsf EECON1,EEPGD ; Select Program Memory
bsf EECON1,RD ; Initiate read
NOP ; required 2 x NOPs
NOP
; EEDAT will now contain 0 - 2500
; and direction bit will be set
movf EEDATH,w
movlb 0
movwf fstep_1 ; for DDS frequency change
BANKSEL EEDATL
movf EEDATL,w
movlb 0
movwf fstep_0 ; for DDS frequency change
clrf fstep_2 ;********added
clrf fstep_3 ;********added