Searching \ for ' connecting PIC to 16550 UARTs' 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: 'connecting PIC to 16550 UARTs'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] connecting PIC to 16550 UARTs'
2002\06\24@155444 by Michael Milner

picon face
I've been prototyping a circuit that connects two 16550 Serial UARTs to a
PIC (the PIC16F877).  I know the PIC already has a UART, but I'm using that
already.  I was thinking about doing some bit banging to eliminate the
external UARTs, but in my application I need the speed and accuracy of these
external UARTS.

Ok, so now my problem.
For some reason, when I assert the Read line on the UART (to tell the uart
to put it's recieved byte onto the bus), it takes almost a full second for
the bus to arrive at the correct value.  On top of that, the _RXRDY line
(which indicates when a byte is waiting to be read) does not de-assert when
I'm done reading.  Unfortunately, I don't have a scope to see what's going
on, so I can't say for certain how deep this problem is.

I've worked with the 16550 UART in this manner before and it worked fine.
Could I have melted the 16550's bus drivers or something?

I'm using PORTD of the PIC as my data bus, and the 6 bits of PORTA for
control (yes, I have a pull-up resistor on RA4)

If nothing obvious comes up, I can post the scematics or code.

Thanks,

Mike

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


2002\06\25@181113 by Mike Singer

picon face
Michael Milner wrote:
> I've been prototyping a circuit that connects two 16550
> Serial UARTs to a
> PIC (the PIC16F877).  I know the PIC already has a UART, but
> I'm using that
> already.  I was thinking about doing some bit banging to eliminate the
> external UARTs, but in my application I need the speed and
> accuracy of these
> external UARTS.
>
  How about using PIC16LF627-04 ($2, AUSART) instead of 16550 UART?
What is the price of 16550?

  Mike.

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


2002\06\25@185525 by M. Adam Davis

flavicon
face
Are there any undue loads on the lines?  What's connected to the ouput
of the UART?
I imagine the UARTs are connected to a common bus - what state is the
other UART in - are they both trying to drive the line, is one taking
too much current, etc?
Do you experience the same problem in the other UART?  If not, what
happens when you swap them?

I would suggest you look at using a dual UART instead of two seperate
UARTS - it would save board space, and the trouble of trying to find a
problem in one that doesn't occur in the other.  You might even go for a
quad UART - you can get quad UARTS that connect to SPI or another
processor bus and you can eliminate the large data bus, get smaller
chips, etc.

www.google.com/search?q=dual%20uart%20IC
Is one way to find some dual uarts.

TI also has a line of UARTS:
http://www-search.ti.com/search97cgi/s97_cgi?Action=FilterSearch&Filter=TI.filter.hts&Site=new&keywds=uart

There are dozens of other places that make such chips.

Alternately you take a cheap 16fxxx chip with a crystal that's divisible
by the rs-232 rates you need, use the onboard UART to communicate with
your processor via some synchronous method (IIC, SPI, etc), and bit bang
the three uarts.  Very accurate, and likely to be as inexpensive as any
other dual or quad UART.  You can even invert the lines, use cheap
transisters and a +/- 12 supply to replace the more expensive max232
chip you might otherwise need.

-Adam

Michael Milner wrote:

{Quote hidden}

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


2002\06\25@185838 by Mark J. Dulcey

flavicon
face
Mike Singer wrote:
> Michael Milner wrote:
>
>>I've been prototyping a circuit that connects two 16550
>>Serial UARTs to a
>>PIC (the PIC16F877).  I know the PIC already has a UART, but
>>I'm using that
>>already.  I was thinking about doing some bit banging to eliminate the
>>external UARTs, but in my application I need the speed and
>>accuracy of these
>>external UARTS.
>>
>
>
>    How about using PIC16LF627-04 ($2, AUSART) instead of 16550 UART?
> What is the price of 16550?


I looked up the 16C550 on Digi-Key; they cost US$3.92 in singles, or
$2.43 in 100 quantity. (The old non-CMOS 16550 is even more expensive.)
Using the 16C552 dual UART gets you a little closer; they're $7.04 in
singles or $4.75 for 100, and you get two UARTs per chip. (But you have
to deal with PLCC or LQFP packages.) At those prices, it's actually
cheaper to use a couple of extra PICs than to use UARTs - 16F627s are
only $3.20 in singles, or $1.69 in 100 quantity! The economics of this
business are strange sometimes...

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


2002\06\26@004908 by Michael Milner

picon face
I've gotten a couple good ideas here.  I'll let you know what I'm actually
trying to do and maybe you'll be able to help me come up with something
better.

In my job, I often have to debug serial communication lines and reverse
engineer the protocols.  I'm trying to build a generic device that can be
used to connect to devices, sort of like a "man-in-the-middle" concept.

The first device connects to UART_1, the second device connects to UART_2.
When device_1 sends a byte, UART_1 receives it, then, as fast as possible,
UART_2 sends it to device_2; and similarly in the opposite direction.  I
want to make this as fast as possible so that the delay won't interfere with
the device's communications.

Using this setup, I will be able to log every byte transmitted, and also
know which device sent it.  Depending on the baud rate of the devices, this
may even be fast enough to change the data as it passes through.

The original reason for two UARTs was because I'd worked with the 16550
before, and I though it would be faster than a dual UART.  I also want the
PIC to be able to determine the baud rate of the target device automatically
(although it would probably lose a byte or two in the process)

So, any suggestions on the best method to do this??  If I used two cheap
PICs instead of UARTs, would I have the same range of supported BAUD rates?
These target devices may use irregular baud rates.

Thanks for all your help!

Mike

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


2002\06\26@095402 by M. Adam Davis

flavicon
face
Since you're most likely to use this around a computer anyway then you
might consider simply using a computer with two serial ports and one of
the many available progams for it.  This is what I've done (with a
simple VB program) to decipher some communications between a computer
and the TI-LINK for graphing calculators.

The second easiest method, I suspect, is to simply tap the lines in a
straight through cable.  You'll then have two TX lines, and a bunch of
signal lines from each.  Use a PIC to read the signals and send them off
to the computer - no need to use any uarts.  You don't get the ability
to change bytes in the stream on the fly though.

But if you want to do this on a PIC and have the ability to change bytes
on the fly, I'd suggest you use an 18f device running with a 9.216MHz
crystal (quadrupled) which would give you 80 instructions for each bit
at 115.2kbps.  This frequency is divisible by 5 (three times) and by 3
(twice) so you can create any common bps rate exactly.  I doubt you'll
come across many devices that'll need the full 115.2k, but when you do
you'll need to ransfer data out of the pic twice as fast, or assume that
neither device is using the full bandwidth and buffer it in the PIC.

Good luck!

-Adam

Michael Milner wrote:

{Quote hidden}

--
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 2002 , 2003 only
- Today
- New search...