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 support@ccsinfo.com

Strange character on the serial monitor
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dyeatman



Joined: 06 Sep 2003
Posts: 1912
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue May 05, 2020 7:03 am     Reply with quote

All of this is why, years ago, I ditched crystals entirely in all my designs and
started using clock modules. Takes a slight bit more room but worth it for the
stability and accuracy.
_________________
Google and Forum Search are some of your best tools!!!!
temtronic



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

View user's profile Send private message

PostPosted: Tue May 05, 2020 8:09 am     Reply with quote

In the picture of the btm side of the board, the 6th pin under C14 doesn't look properly soldered...
Kinda curious as to the 'zigzag' routing of that port of pins...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 05, 2020 12:56 pm     Reply with quote

Here is a quick critique of the power and ground layout.

The red lines are the +5v power. They're bad. Skinny little tracks going
all over the place. Not gridded.

The yellow circles are ground problems. The big one is the ferrite bead
in the ground path in the upper left. You want a low impedance ground path.
Don't put a ferrite bead in the ground path.

The bright green line is the ground path for the 18-pin PIC. The ground path
from the crystal circuit to the Vss pin on the PIC is too long.

erpgc82



Joined: 02 May 2020
Posts: 73

View user's profile Send private message Send e-mail

PostPosted: Tue May 05, 2020 2:44 pm     Reply with quote

Ttelmah wrote:
OK.
It sounds as if your original crystal is not actually resonating correctly
at the specified frequency...
Some PIC's can have an issue that some low frequency crystals overdrive
the clock input pin. On these a series resistor of perhaps 200R between
the crystal and the pin helps.
However it may just be that there is a supply issue, and this is now
showing different symptoms.

Now you are I think using a 2596 'simple switcher'?. Is this a genuine
one, or a Chinese version?. Switchers like this require very careful
PCB layout. Also the output capacitor should be a low ESR type. I
suspect your supply is actually oscillating, and touching the ground
brings it under control. A DVM won't show this in general (since they
are integrating ADC's). The clone chips in particular are documented to
have worse stability problems than the genuine versions.
Look at:

http://rohmfs.rohm.com/en/products/databook/applinote/ic/power/switching_regulator/converter_pcb_layout_appli-e.pdf

I'm wondering if your input capacitor may be poorly placed, the tracks
too narrow, or both capacitors may have too much ESR, or too little!....
The output capacitor forms a zero at 1/(2*pi*ESR*C). If the ESR is
extremely low, or too high, this can lead to instability. I suspect
too high is most likely, since the capacitor here does not look like a
low ESR type.

If you stick an oscilloscope on the supply rail, I suspect you will
see it is not stable.
What is the actual supply feeding this?. These switchers generate very
significant current pulses in the incoming feed. If this is not reasonably
regulated, there can be issues. What is the input capacitor value?.


Hello friend Ttelmah, is it really that the problem is fake Chinese crystal?

I always set up access control equipment boards, with serial communication, using 10mhz and 20mhz crystal, I never had any problems. The difference is that before, it was always other people who made the firmware.

Now I am trying to learn C programming, with CCS, and the worst problems are happening to me. I have to laugh a little

 Smile

About the 5V supply. I use the LM2596 with its recommended circuit. Or I use the LM2576 with its standard recommended circuit.

In this case now, I am using LM2576 5.0, 100uh inductor, capacitor at 100uf input and 1000uf output. The inductor and diode 1N5822 are as close as possible to the pin of the LM2576, I already have these tricks, because I have been mounting plates for many years like this, I never had any problems. But the problems come to learning ...

Probably this LM2576 regulator is clone, counterfeit, Chinese. I bought it on aliexpress ... Great chance ...

Even so, I still don't believe it, because I've already assembled so many other cards with serial communication and nothing was wrong.



I am using a 12v, 5A Chinese metallic source, but I believe that it does not supply all this current (power). These 12Vs enter the jack, pass through a diode and go to the input pin of the LM2576 with the 100uf capacitor. The rest is the LM2576's standard mounting scheme (circuit).
_________________
Gradually you will go far with persistence, will and determination!
erpgc82



Joined: 02 May 2020
Posts: 73

View user's profile Send private message Send e-mail

PostPosted: Tue May 05, 2020 2:54 pm     Reply with quote

dyeatman wrote:
All of this is why, years ago, I ditched crystals entirely in all my designs and
started using clock modules. Takes a slight bit more room but worth it for the
stability and accuracy.



I've heard about it, use 32768khz. Thanks for the tip, in the future!
_________________
Gradually you will go far with persistence, will and determination!
erpgc82



Joined: 02 May 2020
Posts: 73

View user's profile Send private message Send e-mail

PostPosted: Tue May 05, 2020 2:57 pm     Reply with quote

temtronic wrote:
In the picture of the btm side of the board, the 6th pin under C14 doesn't look properly soldered...
Kinda curious as to the 'zigzag' routing of that port of pins...


I resold, this connector is the 40 pin zif socket, I am not using the PIC16F877 yet.

These ZIF connectors are not really good for welding!
_________________
Gradually you will go far with persistence, will and determination!
erpgc82



Joined: 02 May 2020
Posts: 73

View user's profile Send private message Send e-mail

PostPosted: Tue May 05, 2020 5:02 pm     Reply with quote

Hello my friends, sad about this problem.
Finger on the GND is necessary to operate the serial communication.

As a recommendation from some, I did these procedures in order:
- 1st, I removed FERRITE BEADS, no positive result;
- 2nd, reinforced GND trails, no positive results;
- 3rd, I removed all the components related to the LM2576, and started using the 7805 with 2 capacitors of 220uf, one at the input, another at the output, no positive result;


Start, without touching the GND;
perfect, finger on the GND;


reinforcement in the GND;
removed ferrite beads;


removed the entire circuit of the LM2576;
using 7805 (2 electrolytic) 220uf;


     I don't know what it can be anymore, I never had this problem before.
     Even considering the flawed, problematic layout, I could not have such a critical problem in such a small and simple circuit.

     With so many modifications, no minimum improvement, except by touching the circuit's GND with your finger.

     I will continue studying the book, placing my finger on the GND to visualize the result on the SERIAL MONITOR.

Shocked Crying or Very sad
_________________
Gradually you will go far with persistence, will and determination!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 05, 2020 6:03 pm     Reply with quote

The basic problem you have only this one test setup.

You need to get another complete test setup. Another board, another PIC,
another crystal (from a known-good manufacturer), etc.
Maybe borrow it from a friend. You need to test with known-good
hardware. The board should be made by a company, and be known to work.
erpgc82



Joined: 02 May 2020
Posts: 73

View user's profile Send private message Send e-mail

PostPosted: Tue May 05, 2020 7:57 pm     Reply with quote

PCM programmer wrote:
The basic problem you have only this one test setup.

You need to get another complete test setup. Another board, another PIC,
another crystal (from a known-good manufacturer), etc.
Maybe borrow it from a friend. You need to test with known-good
hardware. The board should be made by a company, and be known to work.


Just to conclude and close the matter.

I found and used a module (USB - SERIAL TTL "FTDI") and it worked perfectly, just eliminating the MAX232N and its 100NF capacitors.


So all the headache is still in the hardware, the max232 and its capacitors.

I've never had a problem as simple and critical as this.

Thank you for the support!

I made a beginner's mistake ...
_________________
Gradually you will go far with persistence, will and determination!
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Wed May 06, 2020 1:50 am     Reply with quote

So the obvious suspicion is you just have a faulty MAX232.

It's worth saying that when building a 'protoytype' board, I usually make three
or four. Always minimum two. It is so hard otherwise to rule out hardware
problems....
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 Previous  1, 2
Page 2 of 2

 
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