• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Serial to Parallel

Status
Not open for further replies.

mstechca

New Member
I want to take data from a serial port and make the output parallel.

I want to use serial because it is more portable, and data can be carried longer distances.

I have tried using a shift register (74HCT164) with a counter (4040), but they dont work because I have to make my own clock equal to the speed of the outgoing data. I have tried wiring a octal D flip-flop (74HCT373) into a shift register, because it isn't edge triggered. The problem is that the flip flop seems to be alot faster than the serial port data.

So what I want to do is somehow obtain only 8 bits from a serial port, the moment it is ready to send data. As soon as 8 bits are received (doesn't matter if they are 0 or 1), I want the clock pin to be disabled.

Here's an example.

Say that the serial port output is something like this and assume that the first bit outputted is shown on the right (lsb):

101011001100111100000

Now what I want is the first 8 bits since I'm only wanting to send an 8-bit ascii character as output.

so we take: 11100000

The rest of the bits are garbage until the serial port is ready to send a new character.

I want to avoid making a clock based circuit, and I want the circuit to run at serial port speed.

Please help me.
 

plot

New Member
The UART on a PIC or AVR would be a simple solution for this if you have some experience with microcontrollers, or wouldn't mind taking the time to learn.

There are also stand alone IC's that are nothing but UART's. I have no experience with them, but I'd suggest it as a jumping off point for converting parallel to serial.

It's going to be extremely hard to make something without a clock... however, with a few switches you could make something that will switch the baudrate in the circuit.
 

JimB

Super Moderator
Most Helpful Member
If you are taking the output of a serial port from your computer, and converting it to parallel, the obvious way is to use a UART.

You WILL NEED a clock to get the bit timing correct.

Have you considered the start and stop bits of the RS232? The UART will strip those off for you.

Where are all those bits after the first eight which you want coming from? How is your circuit to know which bits of a random stream you want to use?

JimB

edited for spelling
 

JimB

Super Moderator
Most Helpful Member
Plot

You beat me to it! I think we said just about the same thing.

Great minds think alike! (Or is it that fools seldom differ? I never could decide!)

JimB
 

mstechca

New Member
Because each ascii character is 8 bits, I consider the rest garbage if I only want to send one character.

alright, If I have to use a clock, I will. What is the best frequency to set the clock at if the speed of the data through the serial port is variable?

I was thinking of using a counter and a shift register. As soon as the counter reaches 8 (bit 3 is set) the output from the parallel shift register is frozen. The question is, what is the best way to accomplish this?
 

mstechca

New Member
delete this post, but not the one above please. Internet explorer is screwing me up.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
mstechca said:
Because each ascii character is 8 bits, I consider the rest garbage if I only want to send one character.

alright, If I have to use a clock, I will. What is the best frequency to set the clock at if the speed of the data through the serial port is variable?

I was thinking of using a counter and a shift register. As soon as the counter reaches 8 (bit 3 is set) the output from the parallel shift register is frozen. The question is, what is the best way to accomplish this?
As already explained, you need a UART, RS232 is 10 bit, not 8 bit, as it's an asyncronous format with start and stop bits. So you can't do it with a simple shift register and clock.

You need either a standalone UART, see http://www.intersil.com/cda/deviceinfo/0,1477,HD%2D6402,00.html#data for details of one commonly used in the past, or use a PIC to do the job in a single small chip - the 18 pin 16F628 would make the job easy.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top