onionzai
Newbie level 1
Dear all pros, i am currently using assembly language for my Final Year Project. Then i use MPLAB to convert the assembly code to hex code and download it into my Microcontroller using PICkit 2 v2.55. However, it didnt works well for me.
Currently im still testing everything using 2 LED.
This is the code.
list p=16F877,f=inhX32, x=on
#include <p16f877.inc>
errorlevel 0,-302 ;eliminate bank warning
__CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF & _LVP_OFF
cblock 0X20
count1
count2
count3
endc
status equ 03h
trisb equ 86h
portb equ 06h
org 0x00
bsf status, 5
movlw b'00000000'
movwf trisb
bcf status, 5
start
movlw b'10010000'
movwf portb
call delay
movlw b'00000000'
movwf portb
call delay
goto start
delay
loop1 decfsz count1, 1
goto loop1
decfsz count2, 1
goto loop1
decfsz count3, 1
goto loop1
return
end
I have uploaded the picture of topview of the circuit. Hope you pros can help me out !
Currently im still testing everything using 2 LED.
This is the code.
list p=16F877,f=inhX32, x=on
#include <p16f877.inc>
errorlevel 0,-302 ;eliminate bank warning
__CONFIG _CP_OFF & _XT_OSC & _PWRTE_ON & _WDT_OFF & _LVP_OFF
cblock 0X20
count1
count2
count3
endc
status equ 03h
trisb equ 86h
portb equ 06h
org 0x00
bsf status, 5
movlw b'00000000'
movwf trisb
bcf status, 5
start
movlw b'10010000'
movwf portb
call delay
movlw b'00000000'
movwf portb
call delay
goto start
delay
loop1 decfsz count1, 1
goto loop1
decfsz count2, 1
goto loop1
decfsz count3, 1
goto loop1
return
end
I have uploaded the picture of topview of the circuit. Hope you pros can help me out !