cheetha
Full Member level 2
- Joined
- Sep 17, 2011
- Messages
- 146
- Helped
- 1
- Reputation
- 2
- Reaction score
- 2
- Trophy points
- 1,298
- Activity points
- 2,310
I am using PIC 16F877a micro controller initially i just want to on/off an led by giving high/low to RD0and portA is constantly high , the circuit is working fine in proteus simulation but not in hardware no any port is giving any output. I am using 4MHz oscillator with 15pf capacitors ....
Thanks in Advance
Thanks in Advance
LIST P=16F877a,r=hex,n=80,x=off,st=off
#include <P16F877.INC>
__CONFIG _CP_OFF & _WDT_OFF & _HS_OSC & _PWRTE_ON & _LVP_OFF
ORG 0010H
BSF STATUS, RP0
BCF STATUS, RP1
MOVLW 00H
MOVWF TRISB
MOVLW 00H
MOVWF TRISA
MOVLW 0FFH
MOVWF TRISD
BCF STATUS, RP0
BCF STATUS, RP1
CLRF 21H
CLRF 22H
CLRF 23H
MOVLW 0FFH
MOVWF PORTA
A CALL DELAY
BTFSS PORTD,0
GOTO A1
MOVLW 0FFH
MOVWF PORTB
GOTO A2
A1 CLRF PORTB
A2 CALL DELAY
GOTO A
DELAY:
MOVLW 0FFH
MOVWF 22H
AAA MOVLW 0FFH
MOVWF 21H
AA DECFSZ 21H,F
GOTO AA
DECFSZ 22H,F
GOTO AAA
RETURN
END