2
\$\begingroup\$

Just wanting to ask if there's a way that an old computer could be like a microcontroller. In the sence that it has a range of pins (standard, PWM and analogue), both input and out put could be emulated by the operating system.

\$\endgroup\$
3
\$\begingroup\$

If you mean a VERY old computer: the parallel port on the really old ones (IBM PC) was such an I/O port. On later ones it was a bit more complex, but could still be read and written by a simple I/O instruction.

On current PCs things are not that simple any more, and there are layers upon layers of hardware and software between the CPU and pins that go to the outside world.

If you want to play with I/O pins: get a bare micro-controller (PIC, Cortex M0, AVR), or a development board (Arduino is a popular one), or a Raspberry Pi.

\$\endgroup\$
  • \$\begingroup\$ Yes the desktop computer has a RS232 and parallel (the bigger one). I'll do some research \$\endgroup\$ – liamdiprose Dec 28 '13 at 7:42
  • \$\begingroup\$ A not-too-old PC is still likely to have a parallel port on the mainboard, even if it's not connected to a plug on the case. \$\endgroup\$ – maxy Dec 29 '13 at 8:35
4
\$\begingroup\$

I'm assuming that a computer, which the O.P. has in mind, is an old PC-like desktop or laptop.

There are ways to add microcontroller-style I/O to a computer (old or new). The class of peripherals that does this is usually called I/O cards or DAQ (data acquisition) card. The complexity and functionality of these devices varies a lot.

A good example of a simple I/O card is NI USB-6008. Another example: an Arduino can be used as a USB I/O card.

\$\endgroup\$
  • \$\begingroup\$ Or if you're feeling brave, build your own. The OS driver might be a bit tricky though. \$\endgroup\$ – Ignacio Vazquez-Abrams Dec 26 '13 at 23:14
  • \$\begingroup\$ Your comment made me think of a breadboard taped to the back of a computer where every cell is a IO port. EDIT: Removed 'thanks' notes (not allowed) \$\endgroup\$ – liamdiprose Dec 28 '13 at 7:39
0
\$\begingroup\$

No computer that you would be able to buy today could do that. Computers with that capability didn't even have operating systems, let alone GUIs. Even if you could get your hands on one of these antiques, you need to be an assembly programmer to make them do anything.

There is hope for this idea, though. Embedded Linux boards like the BeagleBone are full-featured computers running Linux, and they have I/O pins like an Arduino. You access the pins through a VFS (Virtual FileSystem). Essentially each pin is represented by a text file, and you set it on or off by writing 0 or 1 to that file. You can write programs by using any scripting language you like, and writing scripts that write to the files. It being an actual computer, it has some things onboard, which saves time with things like audio. Some single-board computers eg Raspberry Pi have I/O pins also.

If you really want to use a normal computer, you can get I/O expansion cards. These will give this functionality to any desktop, and some models even for laptops. Some of these can be pricey, though, and some require custom software and/or a specific OS. They are not the best option, but might be worth a look.

Hope this helps!

\$\endgroup\$
  • \$\begingroup\$ I'm planning on getting an arduino and possibly a r.pi later on. I guess the benefit I had in mind with using a computer is that there would be more outputs \$\endgroup\$ – liamdiprose Dec 28 '13 at 7:44
  • \$\begingroup\$ @bobsterman I doubt a computer would give you more outputs, and nowadays you need to buy an expansion card to make it work at all. The reason I would just go with an arduino or possibly an embedded Linux board is you can program them easily, whereas it is likely to be much more complicated on a computer. \$\endgroup\$ – felixphew Dec 28 '13 at 21:22
  • \$\begingroup\$ I am going to be getting an arduino soon but the reason I asked was so I could automate (or at least design) an entire house. Sure ive seen people automate a few lamps or door handles with small Linux embedded devices, but I'd estimate that you'd need to have at least 50 IO pins for a whole house. Would it be possible to make an circuit that slices a serial port in to x io ports?? \$\endgroup\$ – liamdiprose Dec 29 '13 at 8:21
  • \$\begingroup\$ This may answer your question, @bobsterman: the Arduino Mega. 54 digital I/O pins for €39. A lot simpler than multiplexing a serial port, I should think. That is possible, but it's a lot of bother for this kind of thing, and you would need to do the software bit from scratch. \$\endgroup\$ – felixphew Jan 1 '14 at 21:39
  • \$\begingroup\$ OK, I had heard of the Mega but didn't know it had so many pins! Sounds like a great solution... \$\endgroup\$ – liamdiprose Jan 4 '14 at 7:21
0
\$\begingroup\$

I woud answer your question about the old computer itself with no. But you can use interfaces or for example the Raspery Pi coud be the solution you are looking for. It has the low-level peripherals:

  • 8 × GPIO
  • UART
  • I²C bus
  • SPI bus with two chip selects
  • I²S audio
  • +3.3 V
  • +5 V
  • ground

and it runs with a Linus OS.

Look here for more details.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.