4 serial inputs 1 chip


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2007
    Posts
    11

    Default 4 serial inputs 1 chip

    I am beginning a new project. I want to connect 4 Parallax RFID readers to a PIC 16F877.
    I have already have the code written for one reader, but now I need to expand to 4. I know I will need to use ports other than only the internal USART.
    Does anyone have an idea how I might "scan" the 4 ports, and when an input is found on one of them collect the data?
    It seems like I am asking for an interrupt routine, but maybe there is some simpler method using IF, Then statements. Has anyone got an idea?
    Thanks
    Dan

  2. #2
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    What baudrate?

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

    Default

    Quote Originally Posted by nukte View Post
    I am beginning a new project. I want to connect 4 Parallax RFID readers to a PIC 16F877.
    I have already have the code written for one reader, but now I need to expand to 4. I know I will need to use ports other than only the internal USART.
    Do you have a spare MCU pin on the reader's pics? If so you could hook the readers all to the usart with a series resistor on each, then when a reader sends data it could pull that spare pin low which signals the other readers to standby, (all spare pins hooked together). Just make sure the reader's output pins Idle in the High state.
    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
    Dec 2005
    Posts
    1,073

    Default

    The datasheet for the reader says it is 2400 bps. I would not use a PIC. The ZX-328n from ZBasic can support up to 4 software UARTS that are full duplex, buffered, and operate in the background (with 4 UARTs, the max speed is 9600) . The ZX-328n has a built-in bootloader (uses the highspeed hardware UART) and the ZBasic compiler is free. The ZX-328n costs $10. You will to add the crystal, caps and an inverter for the hardware UART but this project will be child's play using it while it will be difficult with a PIC & PBP.

  5. #5
    Join Date
    Nov 2007
    Posts
    11

    Default Wish to stay with PIC

    Quote Originally Posted by dhouston View Post
    The datasheet for the reader says it is 2400 bps. I would not use a PIC. The ZX-328n from ZBasic can support up to 4 software UARTS that are full duplex, buffered, and operate in the background (with 4 UARTs, the max speed is 9600) . The ZX-328n has a built-in bootloader (uses the highspeed hardware UART) and the ZBasic compiler is free. The ZX-328n costs $10. You will to add the crystal, caps and an inverter for the hardware UART but this project will be child's play using it while it will be difficult with a PIC & PBP.
    Thanks Dave but the design must be implemented with PIC. But I will check on your chip recommendation for future designs

  6. #6
    Join Date
    Nov 2007
    Posts
    11

    Default No PICS on the reader

    Quote Originally Posted by Joe S. View Post
    Do you have a spare MCU pin on the reader's pics? If so you could hook the readers all to the usart with a series resistor on each, then when a reader sends data it could pull that spare pin low which signals the other readers to standby, (all spare pins hooked together). Just make sure the reader's output pins Idle in the High state.
    Almost perfect and a very good idea, but I don't have any pics on the reader boards, just the RS232 (MAX 232) chip. So I can only receive the card data at the PIC.

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073

    Default

    Quote Originally Posted by nukte View Post
    Thanks Dave but the design must be implemented with PIC. But I will check on your chip recommendation for future designs
    Then you'll need to look at Darrel's Instant Interrupts.

    Or, if you don't have to worry about simultaneous inputs, look at a DG409 and http://www.maxim-ic.com/appnotes.cfm/an_pk/588.
    Last edited by dhouston; - 6th July 2009 at 16:13.

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

    Default

    Quote Originally Posted by nukte View Post
    Almost perfect and a very good idea, but I don't have any pics on the reader boards, just the RS232 (MAX 232) chip. So I can only receive the card data at the PIC.
    They have CTS and RTS lines that work pretty much just that way.
    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.

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

    Default

    Quote Originally Posted by dhouston View Post
    Then you'll need to look at Darrel's Instant Interrupts.

    Or, if you don't have to worry about simultaneous inputs, look at a DG409 and http://www.maxim-ic.com/appnotes.cfm/an_pk/588.
    That looks like his solution Dave.
    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.

  10. #10
    Join Date
    Nov 2007
    Posts
    11

    Smile Good answer Dave

    Quote Originally Posted by Joe S. View Post
    That looks like his solution Dave.
    Think that's the answer, I like having lots of control, and it's easy to know just which port will be working. Thanks to everyone (Again).
    You're a great bunch and I'm proud to know you

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Displaying messages with only 7 (or 4) LEDs on a stick...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 20th May 2007, 08:35
  3. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. New member
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 28th February 2004, 22:44

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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