ahmad
Member level 1
Hi there,
| got question to you all, and hope you can give me the answer.
This is a simple delay program which i took from 16F84A PIC CDRom.
Delay
Movlw 0x07
movwf TEMP1 ; TEMP1 = 255
movwf TEMP2 ; TEMP2 = 255
movlw 0x07
movwf TEMP3 ; TEMP3 = 7
DLOOP
decfsz TEMP1, F
goto DLOOP
decfsz TEMP2, F
goto DLOOP
decfsz TEMP3, F
goto DLOOP
retlw 0x00
end
My question is :
1. Why the comment on line 3 say TEMP1 = 255 not 7 but at line 6 TEMP3 = 7
For your information TEMP1 = 0x08 (EEDATA REGISTER)
TEMP2 = 0x09 (EEADRS)
TEMP3 = 0X0A (PCLATH)
2. Why they used EEDATA, EEADRS AND PCLATH register not RAM ?
3. When I changed value of TEMP1 from 7 to FF then the frequency of
LED is become faster not slower as i expected. WHY ???
4. When I declare DATA equ 0x10 (RAM Location) at the top, the compiler say DATA is not declare at the beginning. WHy ??
Anyone please help.
Thanks.
| got question to you all, and hope you can give me the answer.
This is a simple delay program which i took from 16F84A PIC CDRom.
Delay
Movlw 0x07
movwf TEMP1 ; TEMP1 = 255
movwf TEMP2 ; TEMP2 = 255
movlw 0x07
movwf TEMP3 ; TEMP3 = 7
DLOOP
decfsz TEMP1, F
goto DLOOP
decfsz TEMP2, F
goto DLOOP
decfsz TEMP3, F
goto DLOOP
retlw 0x00
end
My question is :
1. Why the comment on line 3 say TEMP1 = 255 not 7 but at line 6 TEMP3 = 7
For your information TEMP1 = 0x08 (EEDATA REGISTER)
TEMP2 = 0x09 (EEADRS)
TEMP3 = 0X0A (PCLATH)
2. Why they used EEDATA, EEADRS AND PCLATH register not RAM ?
3. When I changed value of TEMP1 from 7 to FF then the frequency of
LED is become faster not slower as i expected. WHY ???
4. When I declare DATA equ 0x10 (RAM Location) at the top, the compiler say DATA is not declare at the beginning. WHy ??
Anyone please help.
Thanks.