Try setting ALL used I/O's as OUTPUT. Paulo Ricardo Pabst. -----Mensagem original----- De: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]Em nome de Tony Nixon Enviada em: ter=E7a-feira, 6 de agosto de 2002 19:50 Para: PICLIST@MITVMA.MIT.EDU Assunto: Re: [PIC][EE]: Unstable circuit Fredrik Axtelius wrote: > > Hi!! > > I have a PIC16F877 circuit and im having big problems to get it stable. Disable WDT Disable LVP Check crystal circuit, Vss connection to it, keep it compact and near the chip Wrong OSC fuse setting, try HS mode Floating inputs Disconnect PC from circuit Tie MCLR hard to 5V Verify software Delete all software except for "flashy LED" Check ground rails in circuit Connect BOTH Vdd and Vss to power supply Use another 877 chip Verify programming Change power supplies Check circuit for dry joints & shorted IO pins Try LED on another IO pin Check for BSF instructions on PORTS Give me $10, that helps Try this, it works.. list p=3D16f877 ; processor type #include "p16f877.inc" ; ; ------------------ ; CONFIGURATION FUSE ; ------------------ ; __CONFIG _CP_OFF & _WRT_ENABLE_OFF & _HS_OSC & _WDT_OFF & _PWRTE_= OFF & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _DEBUG_OFF ; ; The purpose of this program is to make a LED turn on and off ; The LED is connected to PortB any pin ; The flash rate is 500mS @ 4MHz ; CBLOCK 0x20 DelayL ; delay register LOW byte DelayM ; delay register MID byte DelayH ; delay register HIGH byte ENDC ; ; ------------- ; PROGRAM START ; ------------- ; org 0h ; startup address =3D 0000 clrf PORTA clrf PORTB clrf PORTC clrf PORTD clrf PORTE bsf Status,RP0 ; set RP0 for RAM page 1 clrf TrisA ; all PortA =3D outputs clrf TrisB ; all PortB =3D outputs clrf TrisC ; all PortC =3D outputs clrf TrisD ; all PortD =3D outputs clrf TrisE ; all PortE =3D outputs ; ; ------------------------- ; SET ANALOG/DIGITAL INPUTS ; ------------------------- ; movlw b'00000110' ; all digital movwf ADCON1 bcf Status,RP0 ; set RP0 for RAM page 0 start clrf PORTB call Delay500 ; execute a 500mS delay movlw 0xFF movwf PORTB call Delay500 ; execute a 500mS delay goto start ; do this loop forever ; ; --------------------------------------- ; SUBROUTINE: waste time for 500mS @ 4MHz ; --------------------------------------- ; Delay500 clrf DelayL ; clear DelayL to 0 clrf DelayM ; clear DelayM to 0 movlw 3h ; set DelayH to 3 movwf DelayH Wait1 decfsz DelayL ; subtract 1 from DelayL goto Wait1 ; if not 0, goto Wait1 decfsz DelayM ; subtract 1 from DelayM goto Wait1 ; if not 0, goto Wait1 decfsz DelayH ; subtract 1 from DelayH goto Wait1 ; if not 0, goto Wait1 return ; finished the delay end -- Best regards Tony mICros http://www.bubblesoftonline.com mailto:sales@bubblesoftonline.com -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics