taking 100 bit data into computer parallel / serial

Thread Starter

arunprasad

Joined Nov 28, 2011
2
HI I am designing a circuit which takes input from several users ( Yes / No only )and display it in computer. I am using a electronic switch to take the input.( like a inverter activated by momentary switch). Approximately i have 100 users at a time (ie 100 bits). I have to take all the input into a computer and display it individually.( user 1 answer, user 2 answer,.....)

I am struck up how to take all 100 inputs together at a time. Is it possible to convert all the data into serial input and transfer it to the computer or can I take all the data parallel.

hope i will get a answer.

thanks in advance
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
Parallel printer ports and RS-232 serial ports are legacy; not on new computers.
Look at using a USB interface.

Use parallel-in, serial-out shift registers. Latch the data, then shift it into the port.
 

Wendy

Joined Mar 24, 2008
23,415
I looked for a very long time for a printer interface card, and finally found one after several months. I was worried about risking a precious motherboard (XP is matched with a motherboard make).

There are lots of USB adapters out there for hobbiests, I would take Wookies advice as sound.
 

thatoneguy

Joined Feb 19, 2009
6,359
Bidirectional Shift Registers

You would need to latch the data when button is pressed, so an SR latch or similar at each button, the output of the shift register would be the "R"eset of the latch, sent from the microcontroller.

Once time is up, all buttons pressed (I hope it is a 0 or 1 button and not a multiple solution button), the uC clocks in the 100 bits from the 26 4 bit bidirectional registers, tagging each bit with position. Once all are clocked in, a 1 is sent out to be output on all I/O to reset the buttons. The operation should take maybe one or two eyeblinks to complete, depending on distance.

Then the uC uses the USB port to send addr:bit for each of the 100 bits to your PC application, which displays the results however you'd like.

If you want additional information from the buttons, such as timing from a global start signal, multiple choices, etc, this could get complicated.
 

BillO

Joined Nov 24, 2008
999
Parallel printer ports and RS-232 serial ports are legacy; not on new computers.
Look at using a USB interface.

Use parallel-in, serial-out shift registers. Latch the data, then shift it into the port.
While this might be true, it is a shame and we should push back. USB is great, but no one makes thru-hole USB devices. I'm not one for conspiracy theories, but it seems like the industry is sacking things against the hobbyist who may not have a re-flow oven at their disposal.

To the OP's original point. It will be difficult to bring 100 signals to a single PC, but there are ways to do this depending on the actual physical arrangement. Are the switches far apart? Are the events far apart in time? Is the time the event occurred important?

Cost is also an important consideration, but the best way to do this would be to use some intelligence at the user end, that way you could avoid having to bring 200 or more wires back the the PC. You could then connect the user device via some form of daisy-chained serial bus. There are several ways to skin that cat including RS485, but they will require some sort of local controller at the user's location.

If the number of switches was much smaller 8 - 16, I would say using some sort of multiplexer would be viable, but for 100, that's going to be a wiring nightmare. Unless of course, that a wiring nightmare is fine.
 

SgtWookie

Joined Jul 17, 2007
22,230
While this might be true, it is a shame and we should push back. USB is great, but no one makes thru-hole USB devices. I'm not one for conspiracy theories, but it seems like the industry is sacking things against the hobbyist who may not have a re-flow oven at their disposal.
Sadly, hobbyists don't drive the market. Companies who buy tens of thousands of IC or more DO drive it.

SMT/SMD really isn't that bad once you get used to it. After you make several boards, you might actually get to like them better - as you won't need a drill press any more, unless you need to drill vias.
 

John P

Joined Oct 14, 2008
2,025
It's easy enough to get a USB-connected input/output board. With a bit of programming of the outputs, you could make something with a shift register to grab 100 inputs. Example picked at random from among many:

http://www.bytearts.com/portbrain/

It is now possible to get a through-hole USB interface device, if you really must have one. Microchip makes processors that have built-in USB interface, and they do come in a DIP package.

See:
http://electronics-diy.com/electronic_schematic.php?id=525
 
Last edited:

Thread Starter

arunprasad

Joined Nov 28, 2011
2
hi,

yes, i'm struck with the idea of getting 100 inputs to the PC. The arrangement is something like a class room with rows and columns of tables. each table contain 8-15 switches depending on the requirement. ( I planned to group switches in 8 and additional requirements can be met in a group of 4) I can afford to have 1-2 switches extra in a table. All the switches can be placed in a single board

if i convert the data using

4 bit shift register - out put = serial data in 25 wires
8 bit shift register - output = serial data in 13 wires
16 bit shift register - output = serial data in 7 wires
( using 16 bit shift register may create some issues hence I think to avoid it)

Now considering 8 bit shift registers I have serial data in 13 wires

is it possible to use a 16 bit shift register here to convert all the data into serial data.

if it is possible then how to read the data correctly at the computer.

address:data format is required to decode at the computer correctly. How to do that.
 

John P

Joined Oct 14, 2008
2,025
I'm not sure how this would function best. It might depend on how you want the wiring to go. Would you prefer to have a daisy-chain arrangement where each desk is wired to its neighbors, or would you prefer to have a "star" topology where each desk is wired direct to the computer?

With the daisy-chain, I'd use a single bit, which shifts through all the units and the computer would get the data sequentially. If you have the star, you could still have everything in one long string, or you could have several strings and get the data fed out of each of them, all at once. It depends on how you imagine the software operating.
 
Top