hi ~all.
i am trying to program something to microchip pic16f877a by using mplab,who can help me check whether my script can run in pic or not?
help me to correct if got any error.
thanks.
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files Required: P16F877A.INC *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************
list p=16f877A ; list directive to define processor
#include <p16f877A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
ORG 0x000
goto main
main STATUS equ 03h
TRISA equ 85h
TRISB equ 86h
PORTA equ 05h
PORTB equ 06h
movlw 02h
movwf STATUS
movlw 03h
movwf TRISA
movlw fch
movwf TRISB
clrf STATUS
start btfss PORTA,0
btfsc PORTA,1
goto stop
movlw 03h
movwf PORTB
goto start
stop movlw 00h
movwf PORTB
goto turn
turn movlw 01h
movfw PORTB
btfsc PORTA,0
btfss PORTA,1
goto start
goto turn
i am trying to program something to microchip pic16f877a by using mplab,who can help me check whether my script can run in pic or not?
help me to correct if got any error.
thanks.
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files Required: P16F877A.INC *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************
list p=16f877A ; list directive to define processor
#include <p16f877A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
ORG 0x000
goto main
main STATUS equ 03h
TRISA equ 85h
TRISB equ 86h
PORTA equ 05h
PORTB equ 06h
movlw 02h
movwf STATUS
movlw 03h
movwf TRISA
movlw fch
movwf TRISB
clrf STATUS
start btfss PORTA,0
btfsc PORTA,1
goto stop
movlw 03h
movwf PORTB
goto start
stop movlw 00h
movwf PORTB
goto turn
turn movlw 01h
movfw PORTB
btfsc PORTA,0
btfss PORTA,1
goto start
goto turn