PDA

View Full Version : Pic does not work properly



Armando Herjim
- 22nd June 2006, 02:39
Hello. My problem is that when I power up my pic it seems to stop right after the first instruction (which is to set a bit, in this case it is a led), but I just found out that if I put my finguer on the pin that connects to ground it works fine!! Does anybody know why is this happening? I canīt be puting my finger on it all the time!!
Thank you.

Pic_User
- 22nd June 2006, 02:59
Hi Armando, you seem to have put you FINGER on the problem.
At first I thought "Of course, because this is a DIGITAL circuit".

My own "HANDS ON experience" has shown this type of mysterious phenomenon to happen when the MCLR pull-up resistor is forgotten.

Maybe, missing or wrong value capacitors on the crystal.

-Adam-

Armando Herjim
- 22nd June 2006, 03:30
Hi Adam. Look, I have a pull-up resistor to MCLR just like the specification sheet sugests, Iīm unsing a 10 Mhz Crystal and 33 pF capacitor. In fact I am changing the value of the crystal from 4 Mhz to 12 Mhz just that I also change te capacitors from 33 pF to 15pF because Iīm trying to get a baudrate of 115200, so thatīs the why Iīm experimenting with diferent crystals. And one more thing, I also found that when I connect the serial cable it always works, I figure thatīs because the external part of the serial cable is connected to gnd... what do you think?

Thanks a lot!

Pic_User
- 22nd June 2006, 03:49
Hi Armando,

I see you have done everything exactly by the book.
It sound like you are correct about the serial cable adding a ground. Same with your finger on the LED.

What do you use for a power supply? Low noise? Is the ground connection between the supply and your PIC circuit good?

Do you have two capacitors near the power pins of the PIC to ground.
Something like a 10 microfarad. and a 0.1 microfarad, in parallel.

I would double check all the intended ground connections to see if some might be forgotten.

Maybe some of the unused / un-terminated pins are picking up noise.

Any other suggestions for Armando out there?

-Adam-

Armando Herjim
- 27th June 2006, 08:05
Hey Adam, thanks for your help. I appreciated too much. Listen, you wrote this:

"I would double check all the intended ground connections to see if some might be forgotten.

Maybe some of the unused / un-terminated pins are picking up noise."

Are you suggesting that I should connect all the unused pins to ground?? And what is exactly all the intended ground connections? I mean, I only have de gnd pin connected to ground, well and the capacitor too. I also have the 10 microfarad capacitor in parallel with the 100 nanofarad capacitor...

Thanks for your help!

Armando.

Armando Herjim
- 28th June 2006, 01:20
Hey everybody. Hey adam I got it, or at least I think so. At first I though that the pic wasnīt working properly for some strange reason and that when I had the pic on the board it would work just fine, but it didnīt. But after a while I found that the problem was on pin 38, wich is the RB5/KBI1/PGM. When I put this pin to ground it work perfectly fine!! Even on the protoboard. I donīt know whatīs the reason of this, so if anyone could explain me Iīd be very thankfull. Thank you.

Armando.

mister_e
- 28th June 2006, 03:23
what is your PIC?
Did you disable the low-Voltage Programming fuse?
What about your schematic?

Armando Herjim
- 29th June 2006, 02:05
Hello Steve. My pic is 18F4550. I donīt know what is the low-voltage fuse, Iīll check it... and the schematic... well itīs just the pic with its power pins the reset circuit and the oscillator with its respective capacitors and I have a led on portb.7, portb.6 and portb.5. Iīm also using the USART pins to communicate a CMUcam to my pic.... and thatīs it!...... sorry I donīt post the schematics but right now I donīt have any but Iīll make one. Thanks!!

Armando

mister_e
- 29th June 2006, 04:08
mmm, looking at the default fuse setting, the low-voltage programming is already disabled, and the value pass great to MPLAB, so just double check the configuration fuse setting before you program your PIC, and be sure that the low-voltage programming is set to OFF or Disabled.

After that... i don't see any other software reason why it shouldn't work...maybe i need to sleep too.. who knows :)

Just post your code and schematic and i'll test it here.