Searching \ for '[PIC]: More on UART' 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/devices.htm?key=pic
Search entire site for: 'More on UART'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: More on UART'
2003\03\02@200206 by Tony Nixon

flavicon
picon face
I've just been porting some code from an 873 to a 628 chip that uses the
UART and found that the UART didn't work after the conversion.

After some searching I found that I forgot to take out some code the
sets TRISA and TRISB to 0x00.

Now it does work.

This suggests that TRISB does affect the UART whether the data sheet
says otherwise.

The PORTB UART diagram seems the same as for 87x series which indicates
that enabling the UART overrides the TX RX pin settings.

But....as with the 87x series, in the UART section it specifically
mentions that TRISB<1:2> or TRISC<6:7> have to be set with SPEN to
enable the UART.

Confusing...

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
spam_OUTsalesTakeThisOuTspambubblesoftonline.com

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu>

2003\03\02@221705 by David Duffy

flavicon
face
Tony N wrote:
>I've just been porting some code from an 873 to a 628 chip that uses the
>UART and found that the UART didn't work after the conversion.
>
>After some searching I found that I forgot to take out some code the
>sets TRISA and TRISB to 0x00.
>
>Now it does work.
>
>This suggests that TRISB does affect the UART whether the data sheet
>says otherwise.
>
>The PORTB UART diagram seems the same as for 87x series which indicates
>that enabling the UART overrides the TX RX pin settings.
>
>But....as with the 87x series, in the UART section it specifically
>mentions that TRISB<1:2> or TRISC<6:7> have to be set with SPEN to
>enable the UART.

Taken straight from a working product:

movlw           b'11111011'
movwf           tris_b

I did find that it didn't work when I originally (accidently) had TX set
to input and RX set to output. I don't recall whether it was only the
TX or RX that didn't work when the bits were flipped, or both.
I wonder if it makes any difference whether you do the UART setup
before the TRIS. (I do TRIS first, then the UART a few lines later)
David...

___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
___________________________________________

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu>

2003\03\03@143122 by Dwayne Reid

flavicon
face
At 12:00 PM 3/3/03 +1100, Tony Nixon wrote:
>I've just been porting some code from an 873 to a 628 chip that uses the
>UART and found that the UART didn't work after the conversion.
>
>After some searching I found that I forgot to take out some code the
>sets TRISA and TRISB to 0x00.
>
>Now it does work.

Tony - if you have the time, could you try it with tris settings of
RX=input, TX=output?  I would not expect it to work with the RX pin set to
output.  But I'm curious if it works with the TX set as output.

Thanks!

dwayne

--
Dwayne Reid   <.....dwaynerKILLspamspam.....planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 19 years of Engineering Innovation (1984 - 2003)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

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

2003\03\03@174637 by Tony Nixon

flavicon
picon face
Dwayne Reid wrote:

> Tony - if you have the time, could you try it with tris settings of
> RX=input, TX=output?  I would not expect it to work with the RX pin set to
> output.  But I'm curious if it works with the TX set as output.


Setup Scenario...

PIC = 16F873
UART enabled, RX = in(low), TX = out(hi)
PIC waits for command from PC and executes
Result is a two way "conversation" between PIC and PC
PIC waits for new PC command

Result of changing TRISC....

RX (RC7)    TX (RC6)

out         out       -> does not work
in          out       -> does work     (my default)
out         in        -> does not work
in          in        -> does work

It seems that the UART is affected by TRIS RX pin setting so the UART
TRIS override does not appear to be what the data book says.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
EraseMEsalesspam_OUTspamTakeThisOuTbubblesoftonline.com

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

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