CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Interesting Problem !
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
musti463



Joined: 19 Sep 2013
Posts: 66

View user's profile Send private message

Interesting Problem !
PostPosted: Sat Sep 06, 2014 6:20 am     Reply with quote

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: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 06, 2014 7:10 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 06, 2014 7:13 am     Reply with quote

@temtronic can you look my layout and please tell me my faults


_________________
M.Emir SADE
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 06, 2014 7:28 am     Reply with quote

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: 19510

View user's profile Send private message

PostPosted: Sat Sep 06, 2014 7:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 06, 2014 8:03 am     Reply with quote

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: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sat Sep 06, 2014 9:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 2:37 am     Reply with quote

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: 19510

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 2:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 3:11 am     Reply with quote

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: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Sep 08, 2014 3:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 4:09 am     Reply with quote

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: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 5:04 am     Reply with quote

just add 'errors' as the last option

#use RS232(....., errors)


hth
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 08, 2014 10:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 10, 2014 8:25 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group