Serial to Parallel conversion C Programming

Discussion in 'Programmer's Corner' started by simon86, Oct 21, 2008.

  1. simon86

    Thread Starter New Member

    Oct 21, 2008
    How can I convert serial to parallel in C?

  2. beenthere

    Retired Moderator

    Apr 20, 2004
    It's usually done in hardware. You can always shift bits into a register, though. Probably easier to do in assembler.

    What is the purpose/function of the S to P?
  3. hgmjr

    Retired Moderator

    Jan 28, 2005
    Assuming that you are interested in implementing a synchronous shift register, you will need to provide a clock source to accompany your serial data stream. I would look at assigning the clock source to an external interrupt pin. That way you could use the interrupt service routine to read the state of the pin you have assigned to the incoming serial data stream.

    Converting the incoming serial data to parallell data is then a matter of shifting the incoming serial bits into a register until the register has been fully populated. The register (typically 8-bits in length), once full, would then be written to memory and then the process would be repeated.