Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

[SOLVED]Help with PIC soldered circuit sometimes work sometimes doesnt

Status
Not open for further replies.
Hello
I would really appreciate if you can tell me please any idea you get by the following situation. (I really need help :( )

I have soldered a socket to a perfboard, and put a 18F2550 in it. I have also soldered a circuit in it in which I use pin RB0~RB4. I also soldered RB6,7 to connect to the programmer. I have soldered other necessary components.

The program I wrote basically gives 1s or 0s to pins B0 to B4. nothing else.

I have successfully program the PIC.

Then when I power the PIC sometimes it works, sometimes it doesn't. If it works it keeps working good until turn off (there is no instability)

When it doesnt, a small push in the side of the PIC makes it work. Investigating more, when it does not work a touch with a metal to the PIN B5 makes it work. if it is working it makes it not work again!!!

Now I suspect about the soldering. however here is the strange and bewildering fact:

I used a oscilloscope to test the PINs directly.(Not the soldered connections) Pin Vdd is receiving 5V successfully. However Pins B0 to B4 are not outputing anything!
If I touch B5 they start.
So It is not the soldering or the connections!!!

What is happening here? Any idea? really any idea?
I have run out of possible solutions!:banghead:
 
Last edited:
Intermittent problems are extremely difficult to troubleshoot and solve regardless of what field of endeavor you are in. You have given very little concrete information from which to work. You may want to post your program, your schematic, and pictures of your soldered board.

That said, last year I chased such a problem with a 16F1519 for months. Some of the symptoms were the same. I could re-program, and it wouldn't work. If I touched the pins or even let it sit overnight, it would work. Eventually, I found two problems and addressed them. I am not sure which of those problems was the real culprit. One problem was in the initialization of the EUSART module. I had not followed exactly the MC sequence and initialized the baud rate first. The second problem was initialization of RAM, i.e., General Purpose and Common (both were used). I added a small program to clear both in reset. The pin problems you mention may indicate a similar problem or a problem in initialization of your ports. Note that on reset, many of the registers are unknown or unchanged (Table 4-4). Do you have proper pull-up or pull-down resistors in your circuit?

upload_2015-6-11_2-11-37.png


John
 
Thank you very much for you reply.
Here are pictures of the soldered PIC. I am a beginner and I have monkey hands :facepalm: so please forgive the uglyness

DSC_0233.JPG DSC_0231.JPG DSC_0232.JPG

In the first pic the pin that causes problems is the third lowest to the left (next to the red cable). Right now it is connected to nothing

its TRIS is 0 so now it is configured as output.


------------------------

I found this thread in microchip forum

https://www.microchip.com/forums/m250127.aspx

Apparently sometimes B5 causes a reset! that is what is happening to me!
Should I disable LVP explicitly?
 
Last edited:
Have you configured the oscillator correctly, are the I/o pins configured correct, also have you enabled mclr, I've had a similar thing when I thought I'd disabled mclr and I hadn't, the pin was still mclr and it was picking up noise and randomly resetting the chip.
 
Have you configured the oscillator correctly, are the I/o pins configured correct, also have you enabled mclr, I've had a similar thing when I thought I'd disabled mclr and I hadn't, the pin was still mclr and it was picking up noise and randomly resetting the chip.

the oscillator being used is the internal one. The I/O is configured to output (TRIS=0). I noticed that in the datasheet B0~B4 says "data output not affected by analog input" but B5 just says "data output". Does this mean anything?
About MCLR right now it is pull up meaning connected to 5V with a resistor.

Pin B5 is not connected to anything and it seems this pin can cause resets when LVP is not deactivated. I dont know if that is the reason but i will test it today

EDIT: I implement the circuit on a breadboard and the same thing happens! So it is not a matter of bad soldering!

When I connect a LED resistor to B5 it does not work (I expected that) but at least the problem of this thread does not happen. So this reseting thing is caused by B5.
Next I ll try disabling LVP

EDIT2 I did and the problem went away!
turns out leaving Rb5 as LVP makes all kinds of strange things happen:nailbiting:

thanks for all the help!!
 
Last edited:
Excellent you got there, now your more experienced.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top