Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Problem with PIC 16F877

Status
Not open for further replies.

u04f061

Advanced Member level 4
Joined
Mar 3, 2006
Messages
103
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,298
Activity points
2,090
configuration bits 16f877a problems

Hi,

I am having problem with PIC16F877. First, I have simulated my program in Proteus and it works fine, so there is little chance of a programming problem. But in hardware, my controller works well if I touch it with hand(when I am connected to earth). Morover, I have tried the following:

1 - As I am using PORTC(PORTB and PORTD) of the PIC, I have tried both pulling it up and down, through a variety of resistors, but it did not give the right output.

2 - I have checked and re-checked the floating ground problem, but in vain. I have also tried different power supplies, but did not succeed.

3 - When I do not touch it, the PIC does not turn off, rather it gives a wrong output. This wrong output is a clock at some pins and any pulse with a different cycle on the others.

4 - I have directly and indirectly shorted the pin to earth, but of no use. Moreover, I connected a resistor equal to my body resistance and tried to pull the pin and up through it, but still it did not work.

At last, I want to clarify that it actually does work when I earth it through me. I have checked for a variety of outputs.
 

Zman

Junior Member level 1
Joined
Sep 11, 2006
Messages
15
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,371
setar ansel 16f877

only a few reasons:

1) most likely: you have floating inputs (pins configured as inputs and not connected)
solution: all unused pins change to output

2) less likely: something wrong with crystal (replace)

3) even less likely: something really wrong with your pcb layout (crystal one meter away etc)

p.s. check if you init the pic portA as digital pins, by default they are ADC inputs!

for more details post an exact schematics plus pcb photo plus init code
 

progart

Newbie level 4
Joined
Nov 1, 2007
Messages
7
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,340
pic 16f877a ansel

Your MCU's not running healtly.
check
ANSEL regs and configuration bits (set ANSELx = FF for Digital I/O)
OSC. circuit
check TRIS registers and set not used pins "0" form TRIS regs.Do not some free inputs ...
 

saas123qa

Member level 2
Joined
Feb 7, 2005
Messages
46
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
210
crystal for 16f887

I think this a ground problem you are acting as ground of the IC
 

xorcise

Full Member level 2
Joined
Sep 27, 2007
Messages
124
Helped
20
Reputation
40
Reaction score
1
Trophy points
1,298
Location
NYC
Activity points
2,169
16f887 porta

Get an 16F877A or 16F887. The 16F877 is a long outdated PIC and was replaced by the 16F877A. The new 16F887 is identical and has a few more features, like internal oscillator, and is 1/2 the price of the '877's.

Just a suggestion to get on the right track from the start.
 

lazyboy

Newbie level 4
Joined
Jul 16, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
45
porta problem pic 16f887

First check the hardware : power,reset,crystal
Second check software : difinition of Digital I/O (off ADC port),difinition output pin
Last check the solder pins
 

mfabre

Newbie level 1
Joined
Dec 26, 2007
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,284
ic 16f877 photo

Try with a ~4MHZ crystal. If that works, check if you have configured the osc in HS mode.

Best regards,
Marcelo
 

Osolong

Newbie level 5
Joined
Jun 11, 2007
Messages
10
Helped
7
Reputation
14
Reaction score
5
Trophy points
1,283
Location
San Luis Potosi, Mexico
Activity points
1,353
pic16f877 earthing problem

Hi.
I had exaclty the same problem with a Z80 loooong long time ago.
I even changed the Z80, used a lower frequency crystal, checked grounds, etc. Nothing.
I could even make it work slow motion, when i touched it, stop by releasing it, and then resume by touching it again.

The problem turned out to be the protoboard I was using. I changed it and everything worked perfectly. A friend of mine had the same problem but with a PCB board. He placed 100nF capacitors from VDD to VSS close to the ucontroller.
That worked for him.

Can't hurt trying.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top