View previous topic :: View next topic |
Author |
Message |
musti463
Joined: 19 Sep 2013 Posts: 66
|
Interesting Problem ! |
Posted: Sat Sep 06, 2014 6:20 am |
|
|
Please watch this video. I record this problem with my cam. And so tell me "why" ?
http://youtu.be/J76eMgJH7SQ _________________ M.Emir SADE |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Sat Sep 06, 2014 7:10 am |
|
|
probable problem is EMI
possible causes are poor cabling,no RF bypass caps, poor grounds, etc.
hth
jay |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sat Sep 06, 2014 7:13 am |
|
|
@temtronic can you look my layout and please tell me my faults
_________________ M.Emir SADE |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Sat Sep 06, 2014 7:28 am |
|
|
You should have posted the schematic as well but..
..OK found it in your other post...this post should be deleted and added to the original....
1) All I/O pins should have pullup resistors on them NOT left unconnected( floating). They become 'antennae and can halt the PIC unless your program properly sets them.
2) lack of filter caps on power coming in
3) needs more RF bypass caps (.001) near PIC and LCD
4) I like a ground bus around the entire edge of the PCB.
5) _MCLR should be tied high, not low. hmm...PCB layout is OK, schematic is wrong.To me down arrows mean grounds NOT Vdd connections.
6) filters/bypass caps needed on 'RS485' interface connections to other PIC
hope this helps
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Sat Sep 06, 2014 7:39 am |
|
|
Then there are the Vss/Vdd rails not actually connecting from one side of the PIC to the other.... |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sat Sep 06, 2014 8:03 am |
|
|
temtronic wrote: | You should have posted the schematic as well but..
..OK found it in your other post...this post should be deleted and added to the original....
1) All I/O pins should have pullup resistors on them NOT left unconnected( floating). They become 'antennae and can halt the PIC unless your program properly sets them.
2) lack of filter caps on power coming in
3) needs more RF bypass caps (.001) near PIC and LCD
4) I like a ground bus around the entire edge of the PCB.
5) _MCLR should be tied high, not low. hmm...PCB layout is OK, schematic is wrong.To me down arrows mean grounds NOT Vdd connections.
6) filters/bypass caps needed on 'RS485' interface connections to other PIC
hope this helps
Jay |
3) What is the RF bypass caps values (0.001 uF ?)
4) You mean ground plane?
6) You mean "tie A and B pins with 100nF " _________________ M.Emir SADE |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Sat Sep 06, 2014 9:13 am |
|
|
musti463 wrote: | @temtronic can you look my layout and please tell me my faults
|
If you look at the PCB layout you will notice that two tracks are not routed. I have not checked the Pinout for the PIC you are using but Assume it has two VDD and two VSS pins. The two VSD pins must be connected together and the two VSS pins must be connected together. My guess us that is not happening.
As mentions, you should not have PIC pins left floating - this is easy to fix, make all unused pins outputs
You have no power supply reverse polarity input protection and no power supply filter capacitor. You might want to consider using a Schottky diode in series with the positive supply terminal (these have a low forward volt drop of approx 0.2 volts) . Also consider adding a 100uF or higher 16volt electrolytic capacitor across the power supply rails. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Sep 08, 2014 2:37 am |
|
|
i did output all unused pins and system work. But system don't work first start. I am reseting power until system start working. And when slave start receiving, system working correctly. I have to reset the system again again until system working. Why? _________________ M.Emir SADE |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Mon Sep 08, 2014 2:53 am |
|
|
Try putting a 3MR resistor across the crystal.
Some PIC's require this for the oscillator to start reliably.
Commonest cause though, is probably slow rise time on the supply rail. There is a minimum speed that the supply must 'come up' from the off to on, for the internal reset circuit to work. |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Sep 08, 2014 3:11 am |
|
|
Ttelmah wrote: | Try putting a 3MR resistor across the crystal.
Some PIC's require this for the oscillator to start reliably.
Commonest cause though, is probably slow rise time on the supply rail. There is a minimum speed that the supply must 'come up' from the off to on, for the internal reset circuit to work. |
I putted 3MR resistor parallel the crystal's pins. But didn't work.
So i forgot say that : When i give power to system.
Master start sending and shows that "Sending Data: 1-99"
Slave show that "Incoming Data: 0"
But slave must follow masters sending data. I have to reset system for correctly receiving !
i use this settings. May i add any command this line?
Code: |
#FUSES XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD
#USE rs232(baud=250000,xmit=pin_c6,rcv=pin_c7,enable=pin_c5,restart_wdt) |
_________________ M.Emir SADE |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Mon Sep 08, 2014 3:44 am |
|
|
Yes. You are missing the "errors" keyword. You MUST use this when using the hardware serial port because the PICs are stupid devices, when they encounter an error (because you did not read the receive buffer fast enough) it does a dummy spit and disables the serial peripheral. Whoever designed the peripheral must have been having a very bad day to have done something so stupid as to disable the serial port on an embedded controller. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Sep 08, 2014 4:09 am |
|
|
asmallri wrote: | Yes. You are missing the "errors" keyword. You MUST use this when using the hardware serial port because the PICs are stupid devices, when they encounter an error (because you did not read the receive buffer fast enough) it does a dummy spit and disables the serial peripheral. Whoever designed the peripheral must have been having a very bad day to have done something so stupid as to disable the serial port on an embedded controller. |
Thank you now working. What you offer for use in "#USE RS232(options)" options? (restart_wdt,brgh1ok,bits,float_high etc...) _________________ M.Emir SADE |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Mon Sep 08, 2014 5:04 am |
|
|
just add 'errors' as the last option
#use RS232(....., errors)
hth
jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Sep 08, 2014 10:45 am |
|
|
If you're having start-up problems with the PIC, add the PUT and
BROWNOUT fuses.
Your main problem is the board layout. Your power and grounds are
very poor.
You have several headers at the edge of the board. The copper traces
going to these headers take up a large amount of space. This space
would be much better used for a power or ground plane.
Your power and grounding consist of a large number of stubs (cul-de-sacs)
at the end of long, winding traces. This is guaranteed to cause a lot of
electrical switching noise at the end of those stubs. I have seen this on
a board layout (not done by me). I fixed it temporarily by soldering
several 22AWG jumper wires on the back of the board, to inter-connect
all the ground stubs, and also for the power stubs.
If you don't have a power or ground plane, you should try to layout
the power and grounds in a grid like this:
Code: |
===================
| | |
| | |
|=================|
| | |
| | |
|=================|
| | |
| | |
|=================|
| | |
| | |
===================
|
Or at least do it as much as possible. Mostly, put the grounds on one side
of the board (eg., top layer), and the power grid on the other side (eg.,
bottom layer).
As others have mentioned, you need bypass caps (100 nF) between the
Vdd and Vss of every chip (and lcd) on the board. If a chip has two or
more sets of Vdd/Vss, then you need a cap on each pair.
If your PCB layout software can do it, it's much better to create a power
plane on one side and a ground plane on the other side. Example:
http://i.stack.imgur.com/2n2ON.jpg
You still have a 2-layer board but the power and grounding are much better. |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Wed Sep 10, 2014 8:25 am |
|
|
PCM programmer wrote: | If you're having start-up problems with the PIC, add the PUT and
BROWNOUT fuses.
Your main problem is the board layout. Your power and grounds are
very poor.
You have several headers at the edge of the board. The copper traces
going to these headers take up a large amount of space. This space
would be much better used for a power or ground plane.
Your power and grounding consist of a large number of stubs (cul-de-sacs)
at the end of long, winding traces. This is guaranteed to cause a lot of
electrical switching noise at the end of those stubs. I have seen this on
a board layout (not done by me). I fixed it temporarily by soldering
several 22AWG jumper wires on the back of the board, to inter-connect
all the ground stubs, and also for the power stubs.
If you don't have a power or ground plane, you should try to layout
the power and grounds in a grid like this:
Code: |
===================
| | |
| | |
|=================|
| | |
| | |
|=================|
| | |
| | |
|=================|
| | |
| | |
===================
|
Or at least do it as much as possible. Mostly, put the grounds on one side
of the board (eg., top layer), and the power grid on the other side (eg.,
bottom layer).
As others have mentioned, you need bypass caps (100 nF) between the
Vdd and Vss of every chip (and lcd) on the board. If a chip has two or
more sets of Vdd/Vss, then you need a cap on each pair.
If your PCB layout software can do it, it's much better to create a power
plane on one side and a ground plane on the other side. Example:
http://i.stack.imgur.com/2n2ON.jpg
You still have a 2-layer board but the power and grounding are much better. |
I changed my layout like your says. What is your comments now for my layout? (I wil add 100nF other side of PIC)
Top Layer (Have Power Plane)
Bottom Layer (Have Ground Plane)
_________________ M.Emir SADE |
|
|
|