You might be able to turn MCLR off but we do not know the chip you are using.
Post your configs, complete code, and schematic so the folks here will be able to help you.
You might be able to turn MCLR off but we do not know the chip you are using.
Post your configs, complete code, and schematic so the folks here will be able to help you.
Dave
Always wear safety glasses while programming.
the schematic above is the one i used to...
i am using pic16f84 and uln2803...
here is the code:
define osc 4
ti var byte
c var byte
z var byte
ti=40
trisb=0
open:
for z=0 to 25
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay
open1:
for z=0 to 25
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay3
close:
for z=0 to 25
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay1
close1:
for z=0 to 25
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay4
delay:
portb=0
pause 2000
goto close
delay1:
portb=0
pause 2000
goto loop
delay2:
portb=0
pause 2000
goto open1
delay3:
portb=0
pause 2000
goto close1
delay4:
portb=0
pause 2000
goto loop1
delay5:
portb=0
pause 2000
goto open
loop:
for c=0 to 275
portb=12
pause ti
portb=6
pause ti
portb=3
pause ti
portb=9
pause ti
next c
pause 2000
goto delay2
loop1:
for c=0 to 275
portb=9
pause ti
portb=3
pause ti
portb=6
pause ti
portb=12
pause ti
next c
goto delay5
end
Last edited by thenew; - 7th March 2011 at 15:15.
From the schematic you have posted, you have left the MCLR pin floating, and this is the reason of the problem you reported. Connect the MCLR pin to Vdd (+5V) using a 10K resistor. If you need to reset your chip then short the MCLR pin momentarely to ground for a second and than remove the short.
Did you connect ULN2803 to ground ?
Al.
Last edited by aratti; - 7th March 2011 at 16:35.
All progress began with an idea
yes i connect the uln2803 to ground...
should i put switch to MCLR? or just connect to 10K and +5v?
it is ok to connect the 4.7k resistor directly to the supply and MCLR without switch?
Last edited by thenew; - 8th March 2011 at 01:20.
Look at the example in the manual.
Dave
Always wear safety glasses while programming.
my previous problem solved..
do you have an ides how to program using sensor as input? That when it is high something would activate then when it is low still activate.
Bookmarks