Ghosh Debalina
Newbie level 5
- Joined
- Mar 6, 2014
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 60
I am trying to get output from PIC16f874a.I have written the following program but unablwe to get high output voltage so led is not glowing. Can anybody help me.its urjent.
Code:
#include <p16f874A.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BOREN_OFF & _PWRTE_ON & _HS_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF
Status EQU 03h
TRISB EQU 86h
PORTB EQU 06h
LED EQU 0x05
CBLOCK 0x20
; Variables used in delay routine
Kount100us
Kount1ms
Kount100ms
ENDC
org 0x0000 ; processor reset vector
goto start
org 0x04 ; go to beginning of program
start:
BANKSEL TRISB
bcf TRISB,LED
BANKSEL PORTB
;CLRF PORTB ; switch to bank1
loop:
bsf PORTB,LED
call delay100ms ;TURN the muscle on by first putting it into
bcf PORTB,LED
call delay100ms
goto loop
delay100us:
movlw 0xA5
movwf Kount100us
R100us decfsz Kount100us
goto R100us
return
delay1ms:
movlw 0x0A
movwf Kount1ms
R1ms call delay100us
decfsz Kount1ms
goto R1ms
return
delay100ms:
movlw 0x64
movwf Kount100ms
R100ms call delay1ms
decfsz Kount100ms
goto R100ms
return
END