Guys,
Everything is working perfect when I use the programmer power.
A ~700 lines code.
The problem is very simple when connecting outside power source.
Guys,
Everything is working perfect when I use the programmer power.
A ~700 lines code.
The problem is very simple when connecting outside power source.
I build a temporary new board and it works ok.
Maybe something is wrong with the other board.
I might build it fro scratch again.
Thanks.
Does it run if you manually RESET (pull MCLR to ground) it after power up?
If so, put a capacitor across MCLR and ground, and a resistor between Vdd and MCLR.
The problem might be that MCLR is coming up faster than Vdd.
An R/C across MCLR might slow it up just enough to meet the chip's MCLR timings.
On the temporary board the led was blinking very fast (suppose to have 1 sec pause)
Only when I set MCLR to +5v it started to run ok.
Sounds like bad soldering or bad connections. Glad you have it sorted though. External power source making it work points to sever current loss accross your tranny/7805 circuit. Could it be your bridge rectifier is shot in the tranny? low power output?
The LED was probably dumping your +5v line repeatedly causing a brown out causing your PIC to reset making it look like it was blinking really fast (which it probably was). If your MCLR was floating (i.e. not connected), same thing may happen (i.e. brown out triggers MCLR just by chance). Connecting MCLR to Vdd might've help alleviate the situation, but sounds to me like a temporary fix.
Not a good practice to leave MCLR floating, unless you are absolutely sure it's tied internally (which I'm not sure the 16F877A has that exact option).
Add an extra resistor inline with your LED (make it really dim), pull the +5v off of MCLR and see what happens (less current flow across the LED, less load on the main +5v rail, etc).
Then maybe try adding another capacitor between Vdd and Vss...can never have too much of that...
Dammit!!!! Didn't spot the MCLR pin wasn't connected in the schematic. Maybe need new glasses!!!!!!
Well, I really dont know what do more.
On the test board everything was ok. The LED was blinking, the LCD shows the numbers.
Now I wrap it again and it aint work, unless I touch the 8Mhz crystal with my hand ;-0
And ofcourse, if using the programmer power , everything is ok (with MCLR stright to the +5v)
Look at the grounds. Make sure they are very nice, short, and fat traces (or wires). The traces (or wires) from the crystal to the PIC should be as short as possible. The capacitors on the crystal should also be as close as possible to the PIC, with direct connection to GND. Pay good attention to the MCLR connection (follow the datasheet, they did not went through all that trouble for no reason).
This is what I tried to explain before. The 877A has external MCLR and external oscillator (the 887 has the capability to run both of them internally - not good comparison).
How do you explain that when using the power from the programmer, everything is OK ?
Bookmarks