Hello Guyz,
I am a newcomer to this forum and i have been looking for such a great forum for a while.
I am also a newcomer to the Microcontroller programming stuff and robotics.
Been trying to make a LED flasher in PIC16F877A but unfortunatly things not working have made me hate the electronics stuff.
Here is the schematics:
**broken link removed**
Code:
I dont really know but when i supply 12V to the power regulator it outputs more or less 5V and these are supplied to both VDD pis and MCLR. I am using port RB1 to get output to led but it's not doing anything.
Can you help me get over this problem?
regards,
Rakan
I am a newcomer to this forum and i have been looking for such a great forum for a while.
I am also a newcomer to the Microcontroller programming stuff and robotics.
Been trying to make a LED flasher in PIC16F877A but unfortunatly things not working have made me hate the electronics stuff.
Here is the schematics:
**broken link removed**
Code:
Code:
;header for 16F877
;Equates section
TMR0 EQU 1
OPTION_R EQU 1
PORTA EQU 5
PORTB EQU 6
PORTC EQU 7
TRISA EQU 5
TRISB EQU 6
TRISC EQU 7
STATUS EQU 3
ZEROBIT EQU 2
CARRY EQU 0
EEADR EQU 0DH
EEDATA EQU 0CH
EECON1 EQU 0CH
EECON2 EQU 0DH
RD EQU 0
WR EQU 1
WREN EQU 2
ADCON0 EQU 1FH
ADCON1 EQU 1FH
ADRES EQU 1EH
GHS0 EQU 3
GODONE EQU 2
COUNT EQU 20H
;*******************************************
LIST P=16F877
ORG 0
GOTO START
;********************************************
;CONFIGURATION BITS
; _CONFIG H'3FF0'
;********************************************
;1 SECOND DELAY
DELAY1 CLRF TMR0
LOOPA MOVF TMR0,W
SUBLW .32
BTFSS STATUS,ZEROBIT
GOTO LOOPA
RETLW 0
;0.5 DELAY
DELAYP5 CLRF TMR0
LOOPB MOVF TMR0,W
SUBLW .16
BTFSS STATUS,ZEROBIT
GOTO LOOPB
RETLW 0
;********************************************
START BSF STATUS,5
MOVLW B'11111111'
MOVWF TRISA
MOVLW B'00000000'
MOVWF TRISB
MOVLW B'11111111'
MOVWF TRISC
MOVLW B'00000111'
MOVWF OPTION_R
MOVLW B'00000000'
MOVWF ADCON1
BSF STATUS,6
BCF EECON1,7
BCF STATUS,5
BCF STATUS,6
BSF ADCON0,0
CLRF PORTA
CLRF PORTB
CLRF PORTC
;***************************************************
; program starts here
BEGIN BSF PORTB,1
CALL DELAYP5
BCF PORTB,1
CALL DELAYP5
GOTO BEGIN
END
;************************************************
I dont really know but when i supply 12V to the power regulator it outputs more or less 5V and these are supplied to both VDD pis and MCLR. I am using port RB1 to get output to led but it's not doing anything.
Can you help me get over this problem?
regards,
Rakan