Searching \ for '[PIC]: UART Rx Problems' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=rx
Search entire site for: 'UART Rx Problems'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: UART Rx Problems'
2001\11\28@130419 by Laurence Evans

flavicon
face
Hello All,

I am having trouble with the UART of an 16F877.

I am using a piece of software which simulates the PIC extremely
well and does simulate the UART (Proteous). Every time I initialise
the UART the Rx State changes to "Start Bit" straight away
despite the input being configured as an input and its being driven
high.

The UART goes to start bit as soon as the instruction:

bsf  rcsta, cren

is executed.  Because the UART thinks it has recived a start bit, it
gets a framing error which is impossible to clear for some reason.
Mabe its because the UART status goes immediatly to start bit
again after recieveing anything ????

Thanks for any help in advance

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\28@230236 by Dale Botkin

flavicon
face
On Wed, 28 Nov 2001, Laurence Evans wrote:

> Hello All,
>
> I am having trouble with the UART of an 16F877.
>
> I am using a piece of software which simulates the PIC extremely
> well and does simulate the UART (Proteous). Every time I initialise
> the UART the Rx State changes to "Start Bit" straight away
> despite the input being configured as an input and its being driven
> high.

So are you having this problem with a real 16F877, or only on the
simulator?  I understand that the simulator may be really good, but it may
still not be quite 100% perfect...  also, make sure you're configuring
both the Tx and Rx pins (RB6 & 7) as inputs.  I doubt this would cause
what you're seeing, though.

> The UART goes to start bit as soon as the instruction:
>
> bsf  rcsta, cren
>
> is executed.  Because the UART thinks it has recived a start bit, it
> gets a framing error which is impossible to clear for some reason.
> Mabe its because the UART status goes immediatly to start bit
> again after recieveing anything ????

I'm not sure what you mean by "UART goes to start bit"...  do you mean the
receiver thinks it's seeing a start bit?  How do you know this?  There's
an RCIF bit to tell you when the*stop* bit has been received, but nothing
to tell you the start bit is being received unless it's in your sim.

Also, if you're driving the PI pin high, remember that the data is true at
teh PIC, not inverted like you'll see it on the other side of the RS232
level shifter.  A 1488/89 or MAX232-type driver/receiver will invert the
data.  So a logic high at the PIC pin *is* a start bit.

> Thanks for any help in advance

Hope this helps.  If not you might want to post the UART init code you're
using...

Dale

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\11\29@051847 by Sean H. Breheny

face picon face
Hi Laurence,

Go to http://redrival.com/mcgahee/ and download PICUART.ZIP, which is Fr.
Tom McGahee's PIC UART tutorial. I  think this is a known "gotcha" and
there is a way to clear the framing error. It is addressed in his (well
commented) example code.

Sean

At 12:48 PM 11/28/01 +0100, you wrote:
{Quote hidden}

----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PIC]: UART Rx Problems'
2001\12\01@065352 by SkinTech
flavicon
face
Hi Laurence,

I don't have a solution to your problem, unfortunately, but maybe you can
help me. I also got the Proteus Virtual Simulator + the '874 model. However,
I can't get it to work, not even a simple setting of output pins. I'm using
a simple piece of software that runs on the hardware OK, but no success with
the VSM.
Could you mail me a source (spam_OUTjan.diddenTakeThisOuTspamskintech.be) that you know runs on
the VSM so I can see what I maybe do wrong?

Thanks beforehand,

Jan Didden

By the way PIClisters, it's worthwhile to check out http://www.labcenter.co.uk,
their VSM simulates pic systems interactively, i.e. you mouse-click a switch
on the schematic and the pic reacts etc. Including interactive debugging
etc. Very neat! There is a lite version for < 100 US$


{Original Message removed}

2001\12\01@095455 by M. Adam Davis
flavicon
face
If you are driving the pin high, then you have a start bit and you'll
get a framing error until you drive it low.  If you clear the framing
error, it will come right back unless you drive the pin low.

If you need to drive the pin high for some reason, either turn off the
rx interrupt, or turn off the uart rx.

Remember that in 0-5v logic, rs-232 is not inverted, so a 1 is +5v.  A
start bit is +5v, stop bit is 0v.

-Adam

Laurence Evans wrote:

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2001\12\01@134128 by Bob Barr

flavicon
face
On Sat, 1 Dec 2001 09:53:07 -0500, you wrote:

>If you are driving the pin high, then you have a start bit and you'll
>get a framing error until you drive it low.  If you clear the framing
>error, it will come right back unless you drive the pin low.
>
>If you need to drive the pin high for some reason, either turn off the
>rx interrupt, or turn off the uart rx.
>
>Remember that in 0-5v logic, rs-232 is not inverted, so a 1 is +5v.  A
>start bit is +5v, stop bit is 0v.
>

Are you sure about that? I think you have it backwards.

All of the UART timing diagrams that I've seen in Microchip docs show
the idle RS-232 input as a high on the Rx pin. (See PIC16F87X,
DS30292B, page 101, figure 10-5) The start bit is detected when the RX
pin goes low. The stop bit is shown as a high.

Regards, Bob

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\01@150509 by Matt Pobursky

flavicon
face
You are right Bob,

Every hardware UART I've seen in the last 20 years idles high,
then goes low for a start bit (at the TTL or logic level).

A constant low on the output is a "break" condition.

Matt Pobursky
Maximum Performance Systems

On Sat, 1 Dec 2001 18:33:57 GMT, Bob Barr wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


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