please Help , i have a strange output!!!

Status
Not open for further replies.

watzmann

New Member
Hi All ,

i have a build a new PCB for my 16f877 and all going fine but when i tested any program i got a very strange output.

for example i wrote a avery simple program to light up all leds connected to port b but i got a differant output ....... could you please look at the schematic and tell me if i did somethng wrong ?
 

Attachments

  • sc.jpg
    312.8 KB · Views: 171
You show C2 and C3 as electrolytics, they are far, far too small to be that.

Otherwise, the program is probably more important than the hardware, and you've not shown us that - or even told what actually happens.
 
what do you mean by far ?AND how to fix that

my program is with PIcbasic so simple :

Device =16f877
XTAL =4

HIGH PORTB.4
DELAYMS 1000
LOW PORTB.4

HIGH PORTB.5
DELAYMS 1000
LOW PORTB.5
 
here is a photo to this PCB ,

i have tried to turnoff all the portA analoge by the command : ADCON1=7

but the same proplem

i checked each pin of the PIC ports to ensure that i have no interfe and all ports were fine
 

Attachments

  • IMAGE0028.JPG.JPG
    311.4 KB · Views: 165

The statement PORTB.4 refers to pin #4, and PORTB.5 refers to pin #5
NOT ALL PORTB pins?
I dont use picBasic.
 
watzmann said:
i know that you are no using PICbasic , you are one of the Assembly leaders

What I mean, as I dont have PICBasic, I cannot check or compile your code in order to test it for you.

Did Nigels suggestion to set PORTB as outputs, work?
 
o.k now i have some news .

i have set all the port to be output , and i tested the same PIC on an old PCB i have and it worked very well.

so my problem now is in the new PCB ...... i noticed that i have portd.7 ON all the time but i don't know how it get this 1,

even the the pin no.31 is 5volts too, although it's the GND pin in the pic ,

i used my AVO meter for the third time to check in case i have any interfere but i haven't.

do you have any explantion ?
 
watzmann said:
even the the pin no.31 is 5volts too, although it's the GND pin in the pic ,

do you have any explantion ?

Fairly obviously if you have 5V on a pin that's supposed to be connected to ground, then it's NOT connected to ground - or at least not to the point you're using as the ground point for your meter.

The picture of the board is really too blurred to see, you've focused past it - but it looks very spread out and poorly designed. For example it's best to keep leads to the crystal and capacitors as short as possible, but you have it mounted well away from the PIC. It may well be OK, as long as every thing is connected, but from your post that's obviously not so.
 
the pic pin 31 is connected to ground but before that it connected too with the Optocoupler Pc817 pin 2 ( GND ).......is it right ?.

now most of my pic ports have 3 volts
 

Attachments

  • pc817.jpg
    58.4 KB · Views: 154
watzmann said:
the pic pin 31 is connected to ground but before that it connected too with the Optocoupler Pc817 pin 2 ( GND ).......is it right ?.

If the PIC pin is connected to ground it can't have 5V on it, so it's NOT connected to ground. Your PCB appears to be double sided, with through links, do you perhaps have a duff link stopping the ground connection?.
 
i'm using eagle to draw my Schematics and the use the eagle Autoroute to wire it...... do you think that eagle can do stupid links ?!!!
 
Disconnect the two incoming power supply leads.

Remove the PIC from its socket.

Set your test meter on its lowest resistance range.

Connect the negative lead from your resistance meter to the 0V line, use the terminal block connection that you use for the incoming supply.
Keep the negative meter lead connected to this point throughout the test.

Touch the positive lead of the resistance meter to pin #31 of the PIC socket.
The meter should read zero ohms.

Touch the meter to each 0v point in turn, they should all read zero ohms.

When and if you find a 0V that dosn't read zero, follow the track back to the point where is supposed to be connected to 0V.
 
That's one of the reasons why it's often smarter (and cheaper) to do single sided boards. If you can't route it properly you use jumpers. It requires a slightly more modular board layout and inteligent control of the routing though. If you use the back of the board for jumper routing you can do things that would cost 10 times the board space using a routed PCB.
 
Thank you all ...... problem solved .............simply i chnaged the regulator Lm7805.........i don't know what's the problem with first one but i'm sure it was the cause ,

Thanks again

as for the double sided boards i like it too much they are more professional
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…