aljamri
Member
16F876A Simple Program, Yet not working !
Hi,
Long time I've not dealt with 16F876A, know want to do some experiment, not succeeded. back to square 1, copied a ready made Template from MPLab and put a simple ON - OFF program as in the following code but failed to make it work.
Is there anything wrong with it ?
Thanks
Hi,
Long time I've not dealt with 16F876A, know want to do some experiment, not succeeded. back to square 1, copied a ready made Template from MPLab and put a simple ON - OFF program as in the following code but failed to make it work.
Is there anything wrong with it ?
Code:
list p=16f876a
#include <p16f876a.inc>
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF &
_PWRTE_ON & _XT_OSC & _WRT_OFF & _LVP_ON &
_CPD_OFF
cblock 0x20
CounterA
CounterB
CounterC
endc
Loop
movlw 0xff
movwf PORTC
movwf PORTB
call Delay
movlw 0xff
movwf PORTC
movwf PORTB
call Delay
goto Loop
Delay
movlw D'6'
movwf CounterC
movlw D'24'
movwf CounterB
movlw D'168'
movwf CounterA
loop
decfsz CounterA,1
goto loop
decfsz CounterB,1
goto loop
decfsz CounterC,1
goto loop
retlw 0x00
END
Thanks
Last edited: