Hi there!
After struglling with JDM and facing failure I bought PIC KIT2 and it works very good, I successfuly programmed LED blinking but now I want to give an input to my PIC 16f690 and here is the codes I tryed:
list p=16f690
#include<p16f690.inc>
#define LED PORTC,0
#define SWITCH PORTC,4
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT
ERRORLEVEL -302
TEMP_VAR UDATA
temp RES 1
delay1 RES 1
delay2 RES 1
;*******************************************************************
Main
org 0x05
Setpins
bsf STATUS,RP0
movlw b'11110'
movwf TRISC
bcf STATUS,RP0
Start
On
bsf LED
wait
btfss SWITCH
goto wait
call Loop
call Loop
Off
bcf LED
call Loop
call Loop
goto Start
Loop
decfsz delay1,1
goto Loop
decfsz delay2,1
goto Loop
return
END
As per the codes, the LED should come to stand still (continious lightning(ON) ) as soon as HIGH (+5v) is removed from pin 4 of PORT C but, that is not happening insted it continue to blink for a while even after removing HIGH from pin 4 of PORT C and then it comes to stand stiil (ON), I think this should happen immediatly, why it is not so? I considered : http://www.winpicprog.co.uk/pic_tutorial1.htm which is of course for blinkin an LED and for f628 not for f690 but, I think I it has something to do with COMPARATORS and that's why mine programme not working , I know very little about programming so if you have solution try to be simple, please!
After struglling with JDM and facing failure I bought PIC KIT2 and it works very good, I successfuly programmed LED blinking but now I want to give an input to my PIC 16f690 and here is the codes I tryed:
list p=16f690
#include<p16f690.inc>
#define LED PORTC,0
#define SWITCH PORTC,4
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _INTRC_OSC_NOCLKOUT
ERRORLEVEL -302
TEMP_VAR UDATA
temp RES 1
delay1 RES 1
delay2 RES 1
;*******************************************************************
Main
org 0x05
Setpins
bsf STATUS,RP0
movlw b'11110'
movwf TRISC
bcf STATUS,RP0
Start
On
bsf LED
wait
btfss SWITCH
goto wait
call Loop
call Loop
Off
bcf LED
call Loop
call Loop
goto Start
Loop
decfsz delay1,1
goto Loop
decfsz delay2,1
goto Loop
return
END
As per the codes, the LED should come to stand still (continious lightning(ON) ) as soon as HIGH (+5v) is removed from pin 4 of PORT C but, that is not happening insted it continue to blink for a while even after removing HIGH from pin 4 of PORT C and then it comes to stand stiil (ON), I think this should happen immediatly, why it is not so? I considered : http://www.winpicprog.co.uk/pic_tutorial1.htm which is of course for blinkin an LED and for f628 not for f690 but, I think I it has something to do with COMPARATORS and that's why mine programme not working , I know very little about programming so if you have solution try to be simple, please!