Searching \ for '[PIC] USART funnies' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/ios.htm?key=usart
Search entire site for: 'USART funnies'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] USART funnies'
2005\01\27@152054 by Andrew Rich

flavicon
face
Some time back I made a cct with:-

MAX232
16F628
20x4 LCD (4bit parra)
4800 baud

This worked really well and I could parse and place charaters on the screen
no probs.

I made a proper PCB and placed the components on it.

Now I have the odd behaviour where any three consecutive characters thru the
MAX232 to the PIC and LCD,
cause corruption of the third character.

Example

Send 000 get 00-
Send sss get ss&
Send 000.0 get 00-.0

Here is my proceedure for trouble shooting:-

1. Looked for proper operation of MAX232 - done
2. Tried a new 16F628 and Max232 - same result
3. Tried a new power supply - not sure why but anything is worth a go

Now I swear that I ran this thing on int osc. 4MHz

I wonder if the thing is running out of steam ? I have some diagrams where I
ran it on a 10MHz XTAL.

I can not remember having this sort of problem before.

Anyconsecutive 3 characters through the USART corrupts the third.

I have had this project in the car runnin fine hooked up to the GPS.

Only when I went to make a proper version did it start this guff

Cheers Andrew





2005\01\27@154746 by Mark Rages

face picon face
You can test if the serial is OK by connecting it to 'serial in' the
RS232 port of your computer and running a terminal.

My guess is the PIC's internal clock frequency has drifted or
something... try changing the baud multiplier up and down 5% and see
if the probem changes.

Do you have an o-scope?

Regards,
Mark
markrages@gmail

On Fri, 28 Jan 2005 06:20:49 +1000, Andrew Rich
<spam_OUTvk4tecTakeThisOuTspamtech-software.net> wrote:
{Quote hidden}

> -

2005\01\27@155238 by Andrew Warren

flavicon
face
Andrew Rich <.....piclistKILLspamspam@spam@mit.edu> wrote:

> Now I have the odd behaviour where any three consecutive
> characters thru the MAX232 to the PIC and LCD, cause corruption of
> the third character.
>
> Example
>
> Send 000 get 00-
> Send sss get ss&
> Send 000.0 get 00-.0

Andrew:


So you don't know whether the problem's on the USART side or the LCD
side, right?  

With LCD modules, the first thing to do is just slow everything down:
Add a long delay in front of EVERY write to any of the display's
pins.  

If that fixes your problem, you either have code that's not following
the LCD's timing spec or you have a read-modify-write problem (or
both).  

If it doesn't fix your problem, I guess there could be something
wrong with the USART side... But at only 4800 baud, it's not likely
to be a hardware issue, and since you say everything worked fine
before you changed from a breadboard to a PCB, I don't think it's a
software issue, either.  

Of course, before you do any of this, you should carefully examine
your board, making sure that you've a) laid it out without errors, b)
used the correct components, and c) placed and soldered them all
correctly.  

-Andy  

P.S.  This is unlikely to be the cause of your problem... But you're
running on the internal oscillator, right?  You might want to try
tacking a crystal or resonator onto the board and reconfiguring the
PIC for that external oscillator to see if it makes a difference.  

=== Andrew Warren -- aiwspamKILLspamcypress.com
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
=== (but open to offers)
===
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation

2005\01\27@155556 by Dave VanHorn

flavicon
face
At 03:20 PM 1/27/2005, Andrew Rich wrote:
>Some time back I made a cct with:-
>
>MAX232
>16F628
>20x4 LCD (4bit parra)
>4800 baud

MAX232, or MAX232A, and do you have the right value of caps on it?

2005\01\27@161738 by Andrew Rich

flavicon
face
Yes to the scope

I will try a loop back to isolate the max232 and serial.

I am thinking the quick fix is to go straight to 10Mhz and be done
with it.

{Quote hidden}

the screen
> > no probs.
> >
> > I made a proper PCB and placed the components on it.
> >
> > Now I have the odd behaviour where any three consecutive
characters thru the
{Quote hidden}

go
> >
> > Now I swear that I ran this thing on int osc. 4MHz
> >
> > I wonder if the thing is running out of steam ? I have some
diagrams where I
> > ran it on a 10MHz XTAL.
> >
> > I can not remember having this sort of problem before.
> >
> > Anyconsecutive 3 characters through the USART corrupts the third.
> >
> > I have had this project in the car runnin fine hooked up to the
GPS.
> >
> > Only when I went to make a proper version did it start this guff
> >
> > Cheers Andrew
> >
> > --

2005\01\27@161931 by Andrew Rich

flavicon
face
MAX232 CPE - 10uF 16 Volts

I wonder - are the caps too low in volts ?

What does RS232 swing too ?

Maybe I have a capacitance problem .

On the last project I used 25 volt caps


> At 03:20 PM 1/27/2005, Andrew Rich wrote:
> >Some time back I made a cct with:-
> >
> >MAX232
> >16F628
> >20x4 LCD (4bit parra)
> >4800 baud
>
> MAX232, or MAX232A, and do you have the right value of caps on it?
>
> --

2005\01\27@162235 by Andrew Rich

flavicon
face
Thanks,

My plan of attack will be:-

1. Check the values on the caps on the max232
2. Do a serial loop back test thru the max232
3. up the freq to 10 MHz

I have proven the LCD is good, because I send a banner screen.

I does not and never has missed any characters from PIC to LCD.

So the breakdown is in the serial - MAX232 - PIC somewhere

Cheers ! All good !

{Quote hidden}

down:
>  Add a long delay in front of EVERY write to any of the display's
> pins.  
>
> If that fixes your problem, you either have code that's not
following
{Quote hidden}

b)
{Quote hidden}

> --

2005\01\28@012121 by liam .

picon face
Why not use a MAX 233 then you dont need the caps (If i read the sheet
right back a while ago).

Also, you said you had it connected to a GPS, what for ? and what
breed of GPS ??


Liaaam

2005\01\28@022519 by Jan-Erik Soderholm

face picon face
> Why not use a MAX 233 then you dont need the caps (If i read the sheet
> right back a while ago).

But doesn't the non-cap version cost (much) more ?

And, besides, a MAX232 must be one of the most proven
curcuits out there. I would not look in that direction first...

I took a quick look at the source code in the original post,
and I realy couldn't understand what he was doing. I could
not find any interrupt routine, and it also looked like
the uart receive interrupt flag was polled (?). But, there
wasn't enough code to make any comment on it.

Jan-Erik.



2005\01\31@171354 by Robert Rolf

picon face
74HC14 is cheaper than either. Just put 100R on the output side,
and 1k on the input(100k pulldown so disconnected is idle state).
Good for short range comms since any RS232 receiver will
be happy with 5V in (>3v of spec).
I have mine running 10 meters ad 115.3kbaud in a noisy lab environment
without any problems.

Robert

Jan-Erik Soderholm wrote:
{Quote hidden}

2005\01\31@213547 by Mark Rages

face picon face
I can be cheaper than you!

In my 16F688 circuit, I set SCKP, bit 4 of BAUDCTL

SKCP: Synchronous Clock Polarity Select bit
     Asynchronous mode:
     1 = Transmit pin ^TX
     0 = Transmit pin TX

so a wire directly from TX pin to my computer's serial port works.
Not so lucky with RX -- I used a common emitter transistor to invert
things.  Worked fine for prototyping, but when I laid out the board I
put a MAX232 on there.

Regards,
Mark
markrages@gmail


On Mon, 31 Jan 2005 15:13:57 -0700, Robert Rolf <@spam@Robert.RolfKILLspamspamualberta.ca> wrote:
{Quote hidden}

> -


'[PIC] USART funnies'
2005\02\01@001146 by William Chops Westfield
face picon face

On Jan 31, 2005, at 6:35 PM, Mark Rages wrote:

>> [74hc14 is] Good for short range comms since any RS232 receiver will
>> be happy with 5V in (>3v of spec).

Not all receivers will be happy with the OTHER side (0V instead of -3),
though.  MOST of them will, but not all.  I don't think I ever took
apart
a non-working example to see what it had for a driver, but I have run
into
equipment that didn't work.  (not recently?)

BillW

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...