Parallel to Serial Data

Discussion in 'The Projects Forum' started by yellowcloud, Oct 4, 2013.

  1. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    Good day!!!

    I am currently working for my design project. can someone help me to understand the basic of data transmission? here is my concern,

    I have these array of LDR (Light Dependent Resistor), and i will try to gather data from the states of this ldr. in short these LDR will have an output of parallel binary data.. i would like to connect it to a Parallel to Serial converter.

    Can you guys explain to me how will i do that? specifically the circuit between my Array of LDR and the parallel to serial converter.

    THANK YOU!:D:D
     
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    "Shift Register" is your starter
     
    yellowcloud likes this.
  3. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,548
    2,373
    Did you want to conform to any particular serial transmission standard? RS232 RS485 etc?
    If so you would either need to look for a stand alone RS232 IC (rare now) or use a Pic etc.
    Max.
     
    yellowcloud likes this.
  4. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    im planning to use 8 bit parallel to serial data converter. is the two the same? :D thanks for replying sir.

    and also, will my serial output from the converter can have start and stop bits? because i will feed it to a microcontroller.
     
  5. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    i would like to understand how will my LDR arrays and the Converter will communicate. >.<
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You'll need to convert the analog output of the LDR's to a logic "1" or "0" using comparators or Schmitt triggers.

    Your specifications for the LDRs are missing, as are the criteria for determining what should be a logical 1, and what should be a logical 0. Hysteresis is used to help eliminate ambiguity in the "gray region" between what should be a 1 and what should be a zero.

    An LM339 is a quad comparator.
    A 74HC14 is a hex Schmitt trigger.
    A CD40104BC is also a hex Schmitt trigger; slower than the 74 series, but a wider range for Vdd.
    LM339's will require a more complex circuit, but you'll have more control over the thresholds/hysteresis, where the 74HC14 and CD40104BC have fixed thresholds.
     
    yellowcloud likes this.
  7. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0

    Thanks for the info sir. I will use comparators to convert the analog output of the ldrs to digital. I will have an approx 20 LDRs. what can i do to convert the parallel digital output of my arrays in to series? and also, i want my microcontroller to be able to read the converted output.
     
  8. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
  9. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0

    :D thats a big help sir! but I need 24 bit parallel to serial shift register.. is there any existing? or can I utilize 74HC165 to have a 24 bit serial..
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    if you need more bits, then you simply connect output of one shift register to the input of another in a daisy chain fashion. This way the data from the frist register passes through the rest until it gets read by the uC.
     
    yellowcloud likes this.
  11. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    Now I get it. :D If I have 24 bit. I will connect the first 8 bit at the 1st 74HC165 and the output of it at the next 74HC165 with the next 8 bit? is that right sir? can you please specify which pins are input and output. coz im confused with the labeling at the datasheet.
     
  12. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    and also sir. for my Microcontroller and 74HC165 to be sync or communicate, I will just have to give them the same clock right? no need for start and stop bits?
     
  13. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    yes, the clock and enable wires will be connected to all the registers.
    No need for start and stop bits, since this type of communication is synchronous to the clock. UART is asynchronous so it needs the start and stop bits to synchronize the receiver.
     
    yellowcloud likes this.
  14. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
  15. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0

    uhm. since i will transfer 24 bit of data. can my microcontroller read this 24 as a whole? coz my main objective is to read the maximum number of 1's in series. for example. i have this binary data. 000111001111111100000010. my microcontroller shud have an output of 8.
     
  16. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Typically an SPI port is capable of reading 8bits at once. So you will need to call the read routine three times to read the 8bits from the bus. Store each byte separately and then do what you need to do with it.
     
    yellowcloud likes this.
  17. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    I think I understand now the data flow of my system. Thank you!
    If I encounter more question. I will post it in this thread. Please visit my threads sir. thank you!
     
  18. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0
    Mr. Kubeek. can u suggest a microcontroller that has a good memory and can take the task that my system require. I will continously transmit 24 bits of data into it. can a microcontroller take that? >.<
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Virtually any microcontroller is capable of issuing clocks from one I/O port while reading a 2nd I/O port. LDRs are so inherently slow that speed won't be an issue.

    You need to define WHAT you wish to do with the data that you will be collecting in order to get a meaningful reply.

    What do you mean by "good memory"?

    To sample all of your LDRs one time will require 24 bits, or 3 bytes.
     
  20. yellowcloud

    Thread Starter Member

    Jun 30, 2013
    32
    0

    I need to get the maximum number of consecutive Logic "1" in the 24 bit data that entered my microcontroller.
     
Loading...