Exact match. Not showing close matches.
'[PIC] USART funnies'
Some time back I made a cct with:-
20x4 LCD (4bit parra)
This worked really well and I could parse and place charaters on the screen
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.
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
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?
On Fri, 28 Jan 2005 06:20:49 +1000, Andrew Rich
<tech-software.net> wrote: vk4tec
|Andrew Rich <mit.edu> wrote: piclist
> 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.
> Send 000 get 00-
> Send sss get ss&
> Send 000.0 get 00-.0
So you don't know whether the problem's on the USART side or the LCD
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
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
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
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 -- cypress.comaiw
=== Principal Design Engineer
=== Cypress Semiconductor Corporation
=== (but open to offers)
=== Opinions expressed above do not
=== necessarily represent those of
=== Cypress Semiconductor Corporation
At 03:20 PM 1/27/2005, Andrew Rich wrote:
>Some time back I made a cct with:-
>20x4 LCD (4bit parra)
MAX232, or MAX232A, and do you have the right value of caps on it?
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
> > 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
> > 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
> > Only when I went to make a proper version did it start this guff
> > Cheers Andrew
> > --
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:-
> >20x4 LCD (4bit parra)
> >4800 baud
> MAX232, or MAX232A, and do you have the right value of caps on it?
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 !
> Add a long delay in front of EVERY write to any of the display's
> If that fixes your problem, you either have code that's not
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 ??
> 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.
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.
Jan-Erik Soderholm wrote:
I can be cheaper than you!
In my 16F688 circuit, I set SCKP, bit 4 of BAUDCTL
SKCP: Synchronous Clock Polarity Select bit
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.
On Mon, 31 Jan 2005 15:13:57 -0700, Robert Rolf <ualberta.ca> wrote: Robert.Rolf
'[PIC] USART funnies'
William Chops Westfield
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
a non-working example to see what it had for a driver, but I have run
equipment that didn't work. (not recently?)
More... (looser matching)
- Last day of these posts
- In 2005
, 2006 only
- New search...