using Quad UART


Closed Thread
Results 1 to 10 of 10

Thread: using Quad UART

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    France
    Posts
    50

    Default using Quad UART

    Hi,

    I plan to use "quad uart IC" because my app need to control many other pic doing their jobs
    I have some question about them:

    -When data sheet told 16 bytes FIFO, is it a kind of 16 bytes buffer ?
    (because my pic cannot read all data at same time)

    -Is it not too hard to control a quad UART ?

    -What IC is the most common used ? (SPI or I2C interface, not //)

    I would like to know if someone is using this kind of IC... Example will be very useful to start play with.

    Regards
    Last edited by harryweb; - 27th April 2011 at 10:34.

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    Most of the time, I find that using a PIC as an intelligent peripheral is easier than using a dedicated chip. Why not use a chip like an 8723 (with two USARTS) as a peripheral? It can then do things exactly as you wish. That device could could easily have a 1K buffer.

    More importantly, why do you think you need all those USARTs to network your PICs? I have networked over 40 PICs together using one 18F8723 as a master talking to 18F2321's as slaves - and no extra chips are involved. The master's TXD line is connected to the (hardware) RXD line of all the slaves.
    The slaves then send data back using a bit-banged (SEROUT2 port), because the hardware TX port can't drive open-collector. All the output ports of the slaves are tied together, and that goes to the master's hardware serial RX port. The master polls the slaves by sending out an 8 bit address followed by a command and a checksum. The slaves use an interrupt to grab the bytes. If there is an address match, the slaves wait 600uSec and then send the requested data back in inverted (idle high) open-collector mode. Using this mode prevents bus contention. A 22K pull up is used on every slave.


    The whole scheme is still working flawlessly, and polls all the slaves in less than half a second. Although I have checksums and retries buit into the system, the only time it ever retries is when I hot-plug a slave. I also reserved address 253 for a "general call" that all slaves receive, but don't respond to. It is used to produce an output on the pins of all devices simultaneously. Address 254 is used to re-address the slaves. The 2321 board is so small there is no room for DIP switches or jumpers for addressing. By hooking up one device (only) to the master, and then sending to address 254, followed by a new address, followed by a checksum, you can change or set the device's address. It is stored in EEPROM and read on every power up.

    The only downside to using RS-232 between devices is that their oscillators have to be pretty stable if you want fast communication. Crystals on both sides are a must for speeds greater than 19.2Kbaud.
    Charles Linquist

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    Reply to Charles:
    Hi Charles,
    Have you considered making an article out of the project you described? I think it would be "Required Reading" for all members especially the noobies. I am pretty sure it could be set as not comment-able so it would stand alone. I know I would sure read it.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    I suppose I could. The easiest thing for me would be not to write to much verbage, but to post the code. And I don't think it would be appropriate/wise for me to include pictures, since most of what I have done recently has been for my current employer.

    Nonetheless, I'll try to put together something useful (yet non-conflicting) in the next week or two.
    Charles Linquist

  5. #5
    Join Date
    Apr 2011
    Location
    Kent, UK
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    We use a 2 line comms system.
    One line is a transmit request (TR) and the second is a common data line.

    All chips poll the TR for a high state. Chip that requested transmit then waits 5 mSec (pause 5) for all the other chips to listen in, then the message is passed. At the end of the transmit sequence, chip changes its serout2 port pin to an input, freeing up the bus for the next chip.

    Both port pins (TR & D_LOOP) are set as inputs.
    Fit pull down resistor to TR to hold line normally low and pull up for D_LOOP.
    Protocoll between chips can be anything you like, but in general you will want a header, ident (who sent it and who it is destined for), command index, data values & a checksum.

    I have used the hardware serial port for multi-chip transmision, simply drive a PNP transistor from the hardware serial out. Transistor then drives the data line in a open collector (emitter!) mode. Use a lowish (1k) pull up resistor on the data line.

    I have attached a couple of examples if it helps.
    Attached Images Attached Images

  6. #6
    Join Date
    Sep 2005
    Location
    France
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    Thank you for your reply.

    Why does I want to use external uart with buffer ?

    Please see PDF attached file.

    Actually my PCB has 5 PICS.
    The PIC 1 to 4 are connected to network (via tibbo modules with usart 1 and to the "master" PIC via USART2
    These 4 PICS are driving RF attenuators

    4 distant Network sends order to each PIC (1 to 4)
    These PIC also received order from Sensitive keyboard or a local (RS232) terminal connected on the master PIC

    As you can see, I need 1 USART. I MUST use SERIN2/SEROUT2 (witch are not good as hardware usart)

    This is my problem

    Communication are 9600 and 38400 Bds

    So my idea is to use an external USART to bypass the use of SERINOUT2

    regards
    Attached Images Attached Images

  7. #7
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: using Quad UART

    Quote Originally Posted by Joe S. View Post
    Reply to Charles:
    Hi Charles,
    Have you considered making an article out of the project you described? I think it would be "Required Reading" for all members especially the noobies. I am pretty sure it could be set as not comment-able so it would stand alone. I know I would sure read it.
    x2..........
    Thanks and Regards;
    Gadelhas

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts