add a 4.7k pull up resistor on mclr pin
add a 4.7k pull up resistor on mclr pin
Quite possibly - but we will hold-off sending the guys with the white coat over until we've seen schematics and code...Have I gone mad![]()
Thanks for that Bruce - I should have asked matron to check my post - forgot to attach the code, Just arrived back from the village pub and tried Joseph's 4.7k pull up on mclr and lo and behold... it works ! many thanks for that .
Cheers David
I do not believe this ! After a spot of tinkering and adding to the circuit this am it has suddenly gone unstable again (It only operates when finger approaches or touches PIC) stripped circuit down to basic (schematic attached) and it still doesn't work. By the time i have finished it would be quicker to build the thing with valves (tubes) I used to understand them ! The code is as follows:
[@ device pic16f628a,INTRC_OSC_NOCLKOUT
define osc 4
begin:
low porta.0 ' Turn LED on
PAUSE 500 ' Wait 500mS (1/2 second)
high porta.0 ' Turn LED off
PAUSE 500 ' Wait 500mS (1/2 second)
GOTO BEGIN ' Loop continuously
end
Have you try turning off the analog comparators? if you dont know how just add ADCON1=7 near the top row...
Also, add the line
TRISA = 0
"No one is completely worthless. They can always serve as a bad example."
Anonymous
CMCON = 7 will disable the comparators. Also place a small 0.1 or 0.01uF cap between the PIC gnd & vcc pins. Make sure it's as close as possible to the pins.
It's also a good idea to include at least the minimum config options in your code so you're not left with whatever the default unprogrammed config bits are.
I would use at least @ device pic16F628A, intrc_osc_noclkout, wdt_on, mclr_on, lvp_off, protect_off.
If that doesn't take care of it, check your power supply.
yup..my mistake...its cmcon = 7...
Bookmarks