Re: Talk to computers?
From: Gareth (me_at_privacy.net)
Date: 02/02/05
- Next message: Gregory L. Hansen: "Re: Talk to computers?"
- Previous message: Chris: "Re: Talk to computers?"
- In reply to: Gregory L. Hansen: "Talk to computers?"
- Next in thread: Gert Baars: "Re: Talk to computers?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 02 Feb 2005 21:23:33 +0000
Gregory L. Hansen wrote:
> I've been thinking of playing around with computer-controlled systems.
> Just for funsies, at least at first. E.g. a robot, or a data acquisition
> system for a pendulum experiment. But I was thinking at first of a motor
> that spins something, as a toy to play with control systems. So to sum
> up my technical demands-- pretty light, I think.
>
> I think I can figure out AD/DA, and I know there are chips that take much
> of the work out of that if I don't want to roll my own. But what are
> some options for simply moving digital signals to and from the real
> world? I'd rather use something like USB than a sound card, but I
> don't know how involved that is from the hardware perspective, or what
> might be available to ease it.
>
USB can get quite complicated. If you don't need high speed data then I
would suggest that you look at the serial port and/or parallel port.
Sending data out of the parallel port is probably easiest from a
hardware point of view since you can just send data to the port to set
the data bits high or low and get logic highs or lows on the
corresponding pins. You can then use these to control transistors or
FETs. If you just want to switch motors on and off this is probably the
way to go.
I have seen the parallel port used as a low speed serial port by using
one of the pins as a clock and another for data. PIC programmers often
do this.
I do not know how you send data to the parallel port in Linux but I
imagine it is fairly easy.
The serial port can be a bit more difficult from the hardware point of
view since you need to deal with start bits, stop bits and timing. The
voltages are a bit strange for RS232 as well, something like -10V for a
logic 1 and +10V for logic 0. Fortunately there are ICs which take care
of voltage translation for you.
A technique I have used is to interface a PIC to a PC via the serial
port and have the PIC control the electronics. The reason I did this
was I needed accurate timing. I could easily get this with a PIC
clocked at 20 MHz whereas you don't really know exactly what a PC is
doing in any given clock cycle.
Most microcontrollers have serial port hardware on the chip to deal with
the timing and start/stop bits, though you still need to do the voltage
translation.
Maxim make several RS232 line drivers:
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1798/ln/
I think Analog Devices have some as well:
www.analog.com
Gareth
-- ----------------------------------------------------------------------- To reply to me directly: Replace privacy.net with: totalise DOT co DOT uk and replace me with gareth.harris
- Next message: Gregory L. Hansen: "Re: Talk to computers?"
- Previous message: Chris: "Re: Talk to computers?"
- In reply to: Gregory L. Hansen: "Talk to computers?"
- Next in thread: Gert Baars: "Re: Talk to computers?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|