Shop OBEX P1 Docs P2 Docs Learn Events
Converting serial to parallel? — Parallax Forums

Converting serial to parallel?

VaatiVaati Posts: 712
edited 2010-03-19 16:33 in General Discussion
To convert serial to parallel (i.e.; DB9 to DB25) will a shift register do the job?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

(no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2010-03-18 22:11
    First thing to consider here is that DB9 and DB25 do not imply serial or parallel. DB25 is a D-Sub connector used on many devices for both serial and parallel interfacing. Assuming though that you mean a 9-pin serial port to a 25-pin printer port on a PC, you would need a little glue logic to make this happen. First of all the shift register by itself will accept serial input happily without ever putting anything on the parallel output. This is initiated by pulsing the latch pin. So you need some counters and other glue logic to latch every 8 bits, ignoring the start/stop bits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    ·
  • VaatiVaati Posts: 712
    edited 2010-03-18 22:47
    Sorry--I didn't really explain very well what I want to do.

    I want to be able to connect a parallel device, such as a parallel programmer, to my USB to serial cable that I use to program the BS2 and my PropStick Kit. Will a shift register do the job for that, or will I need something else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    (no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-18 23:02
    The serial to parallel is inconsequential and usually it is best just to use a small CPU to handle this as it is an asynchronous stream in which you have to supply your own clock, detect and validate start bits, etc. The problem is the software that normally drives a parallel device is not going to automatically know how to talk to a serial device or does it? If so, it's easy then to describe the actual software and hardware in question so that you can get a more accurate reply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • VaatiVaati Posts: 712
    edited 2010-03-18 23:22
    "The problem is the software that normally drives a parallel device is not going to automatically know how to talk to a serial device or does it?"

    For the application that I have in mind, I will end up having to write the software. smile.gif

    However, I would like this to be a generic serial to parallel converter, and I have some software that I could test it with properly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    (no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2010-03-18 23:41
    Normally I would say just use a Propeller as you are familiar with it and it has sufficient I/O. The only problem with the Prop I/O is that it is 3.3V and your parallel devices may be 5V. Of course you could use simple resistors and buffers but only if you dedicate a pin as input or output, that doesn't help you if it needs to be both.

    If I did it I would just use something like a PIC chip because they run at 5V and usually have a UART for the serial connection, in fact some of them will connect directly to USB as a serial device. But use resistors on all the I/O pins as these could be connected anywhere, I would use any value between 100R and 1K (or more) depending upon what it is you are actually connecting to. If you want to be able to do synchronous reads and writes across all the pins then usually a 32-bit CPU can at least read and write simultaneously read or write 32-bits simultaneously. An 8-bit CPU would ripple through the 8-bit ports one at a time which may causes problems with the target device. Using latched shift registers for inputs and outputs will get around this problem but then the pins aren't programmable as input or output.

    Bear in mind, that the software for a serial to parallel converter is a bit like a blinking led demo, there's nothing to it really so it's not really going to need test software. Serial in, parallel out, Parallel in, serial out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*

    Post Edited (Peter Jakacki) : 3/18/2010 11:49:17 PM GMT
  • kwinnkwinn Posts: 8,697
    edited 2010-03-18 23:50
    Vaati, if you are talking about standard serial data (ie start bit, 7/8 data bits, 1/2 stop bits) from a standard PC serial port it is possible to do it with a uart chip, some logic, and a clock generator but that is much more complicated and expensive than using a small micro. As Peter says a small cpu with a serial port and a few parallel I/O pins will do the job. Four I/O pins could control as many shift registers as you need for the parallel data. You could also use a prop chip or protoboard and have as many as 31 parallel output bits available.
  • VaatiVaati Posts: 712
    edited 2010-03-19 00:24
    Ok--I have 4 ATmega8515's that I think will suffice. smile.gif

    I still haven't learned assembly, or C++. With pre-calculus homework all the time, all my projects will probably have to wait until summer...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    (no longer new) SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2010-03-19 16:33
    Vaati,

    I've gone the other way around, converting Parallel to Serial via discrete components, but not from Serial to Parallel.

    Attached is a schematic of Parallel to Serial, perhaps that will provide an insight to the direction you need.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    864 x 641 - 13K
Sign In or Register to comment.