SerIn with Parallel Port output


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2011
    Posts
    26

    Default SerIn with Parallel Port output

    Hi,

    I have a master board with a 16f877 PIC that communicates with a slave board via the serout/serin commands. The slave board also has a 16f877 and basically just sits there waiting for a signal:

    serin portd.1,T300,["BAC"],mydata

    It waits for 'BAC' and then does something with the data that follows. This system works really well between my master/slave boards, and 300bps is more than enough for my purposes.

    I would like to replace the master board with my PC parallel port for another project. Can I wire a data pin from my parallel port to the serin port (d.1) on my slave board? How would I simulate the correct bit rate, etc? Can I just bit-bang my data at 1/300th of a second per bit? I can't use any other pins on the slave pic, and can't use a serial port on the pc. Has anybody done this before? Any issues that I need to watch out for?

    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,580

    Default Re: SerIn with Parallel Port output

    If you can get that type of control over the LPT-port you could definitely bit-bang it but wouldn't it be easier to use the serialport on the PC in conjunction with a MAX232 to bring the voltage of the line to the correct level? Depending on your actual need you may even be able to skip the MAX232, have a look at the SERIN/SEROUT sections of the manual, it'll tell you the details. Make sure you have the correct polarity (Inverted vs True) depending on if you use the MAX232 or not.

    /Henrik.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: SerIn with Parallel Port output

    In 2011, I would definitely not use the parallel port for a serial comm... OR at least use the whole set of pins with handshake... OR generate a synchronous comm (SPI, I2C) with the parallel port.

    if your on a dos level that's cool, but in Windows, it's a bit hard, not impossible, to predict/generate the exact timing of any hardware like the Printer port. Hence why there's dedicated serial ports... For educational purpose it's cool though...
    Last edited by mister_e; - 7th November 2011 at 20:36.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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