;********************************************************************** ; This file is a basic code template for assembly code generation * ; on the PICmicro PIC16F877. This file contains the basic code * ; building blocks to build upon. * ; * ; If interrupts are not used all code presented between the ORG * ; 0x004 directive and the label main can be removed. In addition * ; the variable assignments for 'w_temp' and 'status_temp' can * ; be removed. * ; * ; Refer to the MPASM User's Guide for additional information on * ; features of the assembler (Document DS33014). * ; * ; Refer to the respective PICmicro data sheet for additional * ; information on the instruction set. * ; * ; Template file assembled with MPLAB V4.00 and MPASM V2.20.00. * ; * ;********************************************************************** ; * ; Filename: xxx.asm * ; Date: * ; File Version: * ; * ; Author: * ; Company: * ; * ; * ;********************************************************************** ; * ; Files required: * ; * ; * ; * ;********************************************************************** ; * ; Notes: * ; * ; * ; * ; * ;********************************************************************** list p=16f876A ; list directive to define processor #include ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _HS_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF ;********************************************************************** ;***** SPECIAL VARIABLE DEFINITIONS temp EQU 0x10 del1 EQU 0x11 del2 EQU 0x12 count EQU 0x13 recreg EQU 0x14 del3 EQU 0x15 del4 EQU 0x16 ORG 0x000 ; processor reset vector clrf PCLATH ; ensure page bits are cleared goto main ; go to beginning of program main ORG 0x007 ; remaining code goes here bcf STATUS, RP0 bcf STATUS, RP1 clrf PORTB bsf STATUS,RP0 movlw 0x00 movwf TRISB movwf TRISC LOOP movlw 0x00 movwf PORTB call delay movlw 0x0f movwf PORTB movwf PORTC call delay goto LOOP delay bcf STATUS,RP0 ;Max deley when all are load to 255 is 50s movlw 2 movwf del1 d2 movlw 0xff movwf del2 d1 movlw 0xff movwf del3 d3 decfsz del3,f goto d3 decfsz del2,f goto d1 decfsz del1,f goto d2 return END ; directive 'end of program'