ghead
Member level 2
Hi all, I'm trying to take a quick succession of adc samples and use fsr to save them consecutively in locations 16h - 3ch which crosses into page 1. I'm not sure how to change page when program reaches end of page 0.
Here's exert from code but it doesn't seem to work at all.... :-?
Here's exert from code but it doesn't seem to work at all.... :-?
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 CLRF 04h movlw b'01111001' movwf ADCON0 btfsS PORTC,5 goto $-1 ;call _50us ;btfss PORTC,5 ;goto $-4 movlw 16h ;first location for storing A_D value movwf 04h ;put value into File Select Register bsf ADCON0,1 ;Start A/D btfsc ADCON0,1 ;has conversion finished? goto $-1 movf ADRES,w ;put result of conversion into w movwf INDF ;move value into INDF incf 04h,f ;increment FSR movlw 3ch xorwf 04h,w ;is file 04h = 3ch btfss 03,2 ;test zero flag in status z=1 when same goto $-9 ;has loops reached end no