PDA

View Full Version : 16F877A issue



DynamoBen
- 30th August 2007, 17:25
I recently moved a project from a 16F876A to the 16F877A. Everything was bread boarded so I just pulled out the 876 and inserted the 877. The code ported over fine but now I'm having trouble getting the pic to reliably "boot." I have to turn the power on and off to the breadboard multiple times and then suddenly it will "boot."

I've check my code and I can't see anything that would do this. I've gone through and verified all the hardware connections and I don't see anything odd.

Thoughts? Things to check?

Bruce
- 30th August 2007, 19:53
Hi Ben,

Do you have a cap between Vcc and ground pins close to the PIC? The A series are a lot more sensitive to power supply ripple/noise.

DynamoBen
- 30th August 2007, 19:56
If memory serves I have a 1uf cap near by; I will triple check tonight. I've also tried a 47uf cap on the power rail, but no change.

Bruce
- 30th August 2007, 20:05
On the 877A I place 0.1uF caps right beside the PIC between pins 11/12 and 31/32. Had odd
problems just like this before adding the caps.

DynamoBen
- 30th August 2007, 20:10
I will give that a go tonight and report my results.

DynamoBen
- 31st August 2007, 02:33
Didn't help...I even swapped the pic out for a new one.

Darrel Taylor
- 31st August 2007, 03:32
I recently moved a project from a 16F876A to the 16F877A. Everything was bread boarded so I just pulled out the 876 and inserted the 877.

http://www.pbpgroup.com/files/876Avs877A.GIF

I hope there was some re-wiring going on there too. ??


_

DynamoBen
- 31st August 2007, 03:34
I guess that was assumed. When I do get the device to "boot" everything works as it should.

Darrel Taylor
- 31st August 2007, 03:57
IF power is already on.
When you take MCLR low, does it reset and restart everytime?

If the power supply rises very slowly when turned on, the PIC may not RESET.
The minmum is 0.05 V/ms, so it must reach 4V in 80ms or less.

Really BIG caps can slow it down. But if it worked on the 876 it should still work on the 877
---------------

Since you moved the oscillator, did the CAPs get in the right place too. Crystals won't always start up if 1 cap is missing, but still may sometimes.
---------------

Grasping at straws.

_

DynamoBen
- 31st August 2007, 04:15
So I stripped my code back to just a blinking LED, which worked consistantly. That got me thinking...

Previously my indication that the device was functioning was based on a serial data status LED. I would consider the chip "booted" after serial data was recieved by the pic and the LED went on. On the 16F876A Rx for the UART is on PortB, on the 16F877A its on PortC. After looking at TRISC I noticed that TRISC.7 in my code was not set. I set it and things seems to be "working" now.

Long story short, check your TRIS settings. I must have check that a dozen times in the last 2 days. I guess I've been staring at this code too long ;) Thanks for the help!