Ive now got my crystal in and the capacitors and programmed my chip with the following program, which is the 16f877a template from microchip and a small led loop from one of you're programs nigel. my programmer says its programmed ok but it still does'nt work in my circuit, wot could i be doing wrong???
;**********************************************************************
; This file is a basic code template for assembly code generation *
; on the PICmicro PIC16F877A. 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. *
; *
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files required: *
; *
; *
; *
;**********************************************************************
; *
; 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
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS
;w_temp EQU 0x71 ; variable used for context saving
;status_temp EQU 0x72 ; variable used for context saving
;pclath_temp EQU 0x73 ; variable used for context saving
ADDRH equ 0x72
ADDRL equ 0x71
DATAADDR equ 0x7D
COUNT equ 0x73
Data1 equ 0x20
Data2 equ 0x21
Data3 equ 0x22
Data4 equ 0x23
Data5 equ 0x24
Data6 equ 0x25
Data7 equ 0x26
Data8 equ 0x27
;**********************************************************************
ORG 0x000 ; processor reset vector
nop ; nop required for icd
goto main ; go to beginning of program
main
;setup RAM data
BANKSEL Data1
movlw 0x11
movwf Data1
movlw 0x22
movwf Data2
movlw 0x33
movwf Data3
movlw 0x44
movwf Data4
movlw 0x55
movwf Data5
movlw 0x66
movwf Data6
movlw 0x77
movwf Data7
movlw 0x88
movwf Data8
movlw 0x04
movwf COUNT
;setup pointers
movlw 0x00
movwf ADDRH
movlw 0x73
movwf ADDRL
movlw 0x20
movwf DATAADDR
BSF STATUS,RP1
BCF STATUS,RP0
movf ADDRH,W
movwf EEADRH
movf ADDRL,W
movwf EEADR
movf DATAADDR,W
movwf FSR
LOOP
movf INDF,W
movwf EEDATA
incf FSR,F
movf INDF,W
movwf EEDATH
incf FSR,F
bsf STATUS,RP0
bsf EECON1,EEPGD
bsf EECON1,WREN
bcf INTCON,GIE
;Required Sequence
movlw 0x55
movwf EECON2
movlw 0xAA
movwf EECON2
bsf EECON1,WR
nop
nop
bcf EECON1,WREN
bsf INTCON,GIE
bcf STATUS,RP0
incf EEADR,F
decfsz COUNT,F
goto LOOP
goto prog
prog
bsf STATUS, RP0 ;select bank 1
movlw b'00000000' ;set PortB all outputs
movwf TRISB
movwf TRISA ;set PortA all outputs
bcf STATUS, RP0 ;select bank 0
Loop
movlw 0xff
movwf PORTA ;set all bits on
movwf PORTB
nop ;the nop's make up the time taken by the goto
nop ;giving a square wave output
movlw 0x00
movwf PORTA
movwf PORTB ;set all bits off
goto Loop ;go back and do it again
END ; directive 'end of program'