1. kristt2001

    Thread Starter New Member

    Oct 13, 2009
    Hi, i need to interface 2 serial devices using RS-232 connection, a barcode scanner and a receipt printer. Can anyone help me in choosing a suitable PIC for this? I would need 2 usarts. Is it easier to use a pic with 2 of these or is there anyway to multiplex 2 others with one each?
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    What are you interfacing them to? Or are you planning on having the printer print the number scanned?

    If it is more complicated than that, you will more than likely end up using a PC type system with a database to update.
  3. Papabravo


    Feb 24, 2006
    A MAX3100 is a UART peripheral that will interface to the SPI port on a PIC. The SPI port can run much faster than the serial port. Connecting two of them to a PIC is easier than rolling off a log.
  4. BMorse

    Senior Member

    Sep 26, 2009
    Another thing the OP needs to consider is the BAUD rate of each device, most handheld scanners default at 4800, and most printers are at 9600 to 115K..... (Although the BAUD rate of each device can be reconfigured) it would be a good thing to implement a way for the BAUD rates to be selectable on the system....

    There are also several standard barcodes that are used so the unit has to be able to decipher the type of barcode (i.e. UPC-A, UPC-E, Modulo, Random Weight Modulo, etc..... There are also "Department" assignment for each type of barcode designated by the leading character in the barcode....)

    I have successfully used a PIC16F877 (1 USART) to be used with 2 RS232 Omni directional Barcode scanners and a PC, by using the RTS/CTS lines from each device I was able to switch which device needed the USART for comms.... I used the Max3222E for each device, so I could disable/enable comms with each one and still monitor the RTS/CTS lines for each device (Although that was powered off of 3.3 volt supply, I am sure they have the equivalent for a 5 volt supply)

    My .02

    My .02
    Last edited: Nov 15, 2009