piclist 2003\03\02\221705a >
Thread: More on UART
www.piclist.com/techref/microchip/devices.htm?key=pic
flavicon
face BY : David Duffy email (remove spam text)



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
spam_OUTpiclist-unsubscribe-requestKILLspamspammitvma.mit.edu>
<5.2.0.9.2.20030303131255.00a42bd0@audiovisualdevices.com.au>

In reply to: <3E62A93B.3892D16@eng.monash.edu.au>
See also: www.piclist.com/techref/microchip/devices.htm?key=pic
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) More on UART

month overview.

new search...