Little more testing. it seems that if i let the unit sit for about 30 seconds, it will work.
any thoughts anyone?
thx in advance
russ
Little more testing. it seems that if i let the unit sit for about 30 seconds, it will work.
any thoughts anyone?
thx in advance
russ
I'm going to go out on a limb here with my limited knowledge, but I had similar problems while trying to learn this stuff.
First was the MCLR pin not connected to the + side with a 4.7K resistor and not turned ON in the programmer. That really caused erratic operation like you descibed. My resistor had popped out of the breadboard and I hadn't noticed so I had it ON, but it wasn't there.
Second is that I have read here a few times that all unused pins should be set to input and grounded via a resistor or they end up floating which can also cause problems.
Since I'm still learning this too I may be completely off base, but your problems do sound a lot like mine.
Bart
This is about as simple a piece of code as you can get.
Check, when you programmed your PIC (do it again if need be) that your Config Fuse settings in your programmer matched those in the program. If you haven't programmed MCLR_OFF into the chip, that could be the problem, alternatively, look for bad hardware connections or bad PSU.
If the above suggestions have not fixed your problem ...
I have observed this behavior before in my own circuits. My problem was the “added” capacitors for the power supply were not immediately fully discharging below the brown-out range when I turned off the power. If I waited 30 seconds or so, they did eventually leak and everything worked great. If I turned the power back on sooner, sometimes it worked and sometimes it did not. Try measuring the voltage across the power supply and seeing what happens when you turn the power off. If the voltage hangs on, you can add a bleed resistor to your power supply so you do not have to wait. This worked in my case. Good Luck.
Paul Borgmeier
Salt Lake City, Utah
USA
Hi, Russman
I encountered such problems sometimes with different pics, last time it was with a ST 6265...
the only way I found to have a strong trusty reset is an external MC 33064 or TC54VN43 ( µChip) to drive the MCLR pin.
Like that, it works fine ... at each time.
May be it's a supply problem ... I remember µChip tells about that in their datashheets, may be a reason !!!
May be we could also think to a lost PC ... due to power up and bad reset.
Something to try then could be to add an ASM GOTO pointing to the reset vector ( 00 ??) at the last available program memory location ( care to 3FF , sleep and goto sleep at the end of the HEX !!! ) ... as it was on the older 16C54 -58 i.e.
add :
ASM
org 3FCh
GOTO 0 ; ... or GOTO INIT
ENDASM
just before the PbP END
Note 3FD and 3FE are occupied by PbP ( endless sleep ... smells the lost PC !!! ) and 3FF by the clock calibration value.
Alain
Last edited by Acetronics2; - 25th February 2006 at 14:09.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I was thinking along the lines of what Paul mentioned. Have had problems with that in the past - the reset circuit like Alain mentioned should fix it if that is the problem.
Thanks for all the suggestions - it turns out that the bulk capacitors i had on the power supply were most likely the culpret.
i manually put a bleed resistor on as suggested and voila - the problem vanished.
i will spend the rest of the week understanding what Acetronics has suggested - sounds like some good stuff there if my understanding was a little more progressed
i am now having a complely different problem, will post that next.
thx for the suggestions all.
Bookmarks