Parallel to Serial Data

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
"Shift Register" is your starter
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.
i would like to understand how will my LDR arrays and the Converter will communicate. >.<
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.

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.
 

kubeek

Joined Sep 20, 2005
5,795
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.
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?
 

kubeek

Joined Sep 20, 2005
5,795
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.

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.
 

kubeek

Joined Sep 20, 2005
5,795
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.
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!
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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!
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? >.<
 

SgtWookie

Joined Jul 17, 2007
22,230
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.
 

Thread Starter

yellowcloud

Joined Jun 30, 2013
32
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.

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