Talk to computers?

systems.

acquisition

motor

sum

much

what

massive,

Hello, Mr. Hansen. If you'd like to get into USB-based digital and analog I/O at a very reasonable price with most of the programming overhead already done for you take a look at the Lab Jack U12. It has

8 12-bit A-D, 2 D-A, up to 20 digital I/o, timer/counters, and software which will allow you to easily program in VB or C.

formatting link
They go at $119 USD ea. in single quantities.

Good luck Chris

Reply to
Chris
Loading thread data ...

Take a look at PIC microcontrollers,

formatting link
They have a huge following and many user sites describing how to program them and how to interface with them. In general, you can talk to them over a serial port, for which you can find software here or there or roll your own.

Chris

Reply to
kmaryan

If you'd like to have something that costs less and can work cross-platform, how about the GP-3 PC I/O Board Kit, which goes for less than $50.00 and operates from a serial port. It has 8 general purpose I/O lines, 5 10-bit A-D inputs, and the capability for PWM output (which you can use to make a good 8 or 9-bit analog output with an op amp).

It uses the serial port, and while the drivers are Window$-centric, you can communicate through your serial port with any programming language, even good ol' QBasic. Interface is easy. The GP-3 PC I/O Board Kit is based on a PIC, which should delight those to whom the PIC is the answer to everything.

formatting link

Glad to be of help Chris

Reply to
Chris

PIC's are fine microcontrollers, but, also take a look at Atmel's AVR microcontrollers and compare their features.

Atmel's site

formatting link
_no&Direction=ASC

You'll find all the tools, assemblers, compilers, etc... at AVR Freaks,

formatting link

J
Reply to
HappyHobit

This also applies to teenagers !!

I think I just dated myself -- I remember when Gene used to post all the time back then.

Reply to
Mike Fields

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.

--
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of 
mind-boggling amounts of excrement when you least expect it. "
  -- Gene Spafford, 1992
Reply to
Gregory L. Hansen

Looks very interesting. $119 is more than I had in mind, but I know from experience that although electronics are cheap, do-it-yourself tends to wind up costing more than I expect when I've bought the connectors, switches, and so on. And even personal time is worth something.

I suppose it's too much to hope for Linux or Mac drivers. The Linux crowd might have something, depending on how widely used the product is.

--
"Suppose you were an idiot... And suppose you were a member of
Congress... But I repeat myself." - Mark Twain
Reply to
Gregory L. Hansen

Wow. I hardly know where to begin, this is totally new to me.

Datasheets -> General Description is probably a good place. Looks like these are little computers that take little programs in their own 33 word language. But I'm not sure that's what I was looking for since I still wanted to talk with my macrocontroller to, e.g., save data and graph things. It's like an intermediate computer that I still can't communicate with, Baseline Flash Programmer aside.

I am getting the impression, though, that I should pick up a Windows box from somewhere if I want to do much with this sort of thing.

--
"What are the possibilities of small but movable machines?  They may or
may not be useful, but they surely would be fun to make."
    -- Richard P. Feynman, 1959
Reply to
Gregory L. Hansen

You know about microcontrollers, right? (PIC, AVR, 8052 etc...)

My favorite way to get data from a micro (I like PICs) is to use serial comm. You can use USB as well, but the PICs I tend to use don't have any native USB support so I would have to get a serial/USB adapter cable. Some people like shoving data thru the parallel port, but there is risk involved there.

If you want to look at PIC chips, check out

formatting link
for a nice book (college level I suppose, but not that hard) help get you going and a free blank circuit board for a development system. Digikey sells a kit of parts to complete the dev board and mine cost me US$59.00, pretty cheap for what you get IMO. The board uses an 18F452 that can run at up to 40Mhz (~10MIPS). It also has a small LCD, an RPG, some LEDs, an LM35 temp sensor, and a 2 channel DAC chip. The PIC has built in ADC. You can use a boot loader in the chip and upload your code with a terminal program instead of needing to buy a seperate programmer board to flash the PIC.

I primarily use solderless breadboards for all my tinkering.

Reply to
Anthony Fremont

They've been mentioned. But I'm really not sure they're what I'm looking for right now because I'm not looking for a little computer to put into a self-contained project. I'm just looking for a way to communicate with my big computer, and it doesn't really look like having a microcontroller would help me communicate with that.

The Lab Jack U12 that Chris mentioned looks a lot closer to what I had in mind, although a bit higher in price and MS-centric than I had in mind.

--
"A nice adaptation of conditions will make almost any hypothesis agree
with the phenomena.  This will please the imagination but does not advance
our knowledge." -- J. Black, 1803.
Reply to
Gregory L. Hansen

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:

formatting link

I think Analog Devices have some as well:

formatting link

Gareth

--
-----------------------------------------------------------------------
To reply to me directly:

Replace privacy.net with: totalise DOT co DOT uk and replace me with 
gareth.harris
Reply to
Gareth

Hmm...

"you can write programs in practically any language (Visual Basic, Visual C++, C#, Windows Scripting Host, Delphi -- even Active Server Pages)"

I guess that's practically every language.

That actually looks more like what I had in mind. Quite interesting.

--
"The preferred method of entering a building is to use a tank main gun 
round, direct fire artillery round, or TOW, Dragon, or Hellfire missile to
clear the first room." -- THE RANGER HANDBOOK U.S. Army, 1992
Reply to
Gregory L. Hansen

What exactly are you trying to communicate? Microcontrollers are like magic glue that can connect a PC to the "real world". They usually contain all the abilities necessary to connect to various sensors and then pass that data to a full fleged PC for extended processing, graphing, making it visible on the internet, etc etc etc. As you learn about the sensors you might use on a robot, you will begin to appreciate how micros fit into it all. They can offload work from your main controlling pc as well as do work that your pc really can't do without special equipment, like the precision timing you might use in range finding. They are cheap, extremely powerful devices that can save you allot of frustration, keep an open mind about them.

I don't think you understand what they can do for you. As for communicating to the PC, they are fully capable of doing so in numerous ways (rs232, lpt port, usb, ir etc). The magic is in the fact that most sensors don't output data in a form compatible with your pc. The micro has the ability to transform that data into something that you can use.

They are ok, if you don't mind being tethered to a pc. It's nothing compared to what you can do with a micro. (:-) For example, a PIC

16F88 has 2 comparators, 16 i/o pins, a 7 channel 10-bit ADC, 3 timers, hardware PWM ability, hardware USART for rs232/spi/i2c, internal multispeed oscillator that's switchable on the fly from 32khz to 8mhz, 4k words code space, 368 bytes ram, and 256 bytes eeprom memory. Not too bad for something that only uses ~75uA running at 1Mhz and costs just over $3.00. BTW, PICs don't care who they talk to. ;-)
Reply to
Anthony Fremont

RS232 is easiest but slowest (115Kbps). Networkcard is fastest (100Mbps) but most complicated. If speed isn't important RS232 is fine.

Regards,

Gert Baars

Website:

formatting link

Gregory L. Hansen wrote:

Reply to
Gert Baars

+5V and zero. Exact details are a little sketchy now, I'm just trying to see what the terrain looks like. But I had in mind things involving an address bus, command bus, and data bus. To tell a particular peice, for instance, "Hey, motor, turn on", or "Spinny thing, report position".

The ones I saw were, e.g. 6 pin IC packages. And I thought to myself "Okay, so I have a microcontroller in my little device. I still don't know how to talk to the microcontroller with my computer." It didn't seem to put me ahead.

Certainly. But they also seemed a little adult for me just now. I'm still about at the level of "Hey, motor, turn on!"

That timing thing is interesting, though. I'd wondered how I might move data in with precise timing information over, say, a USB, which I gather communicates in chunks basically when it feels like it. An external clock and about 32 bits of memory seemed sufficient if I only needed to know when a value occured rather than ensuring something happens at a particular time-- send the time along with the data.

That is a very strong possibility. The world of microcontrollers is about seven hours old for me now.

But I fear also that my competence has been over-estimated. I have about the electronics skills you would expect from a physicist that has never done electrical engineering work more complicated than a few op-amp circuits.

What do you mean by numerous ways (rs232, etc.)? From my brief reading of datasheets, it seemed that simply means data can be digitized and stored in memory so that it can be read by a computer if only I were able to build the electronics that would turn a communication standard into suitable digital signals to tell the microcontroller what to do. Which is exactly the problem that I came here with.

If you mean that, say, the pins of a serial port connector mounted on the board can be connected to the designated pins of the controller and then talking to it immediately reverts to a software problem, that is more interesting.

All that for just over $3.00 is impressive. But microcontroller or not, I wanted to save data to the PC to graph or analyze, so it would be there anyway. At least in the shorter term projects.

--
"Don't try to teach a pig how to sing.  You'll waste your time and annoy 
the pig."
Reply to
Gregory L. Hansen

At a fundamental level, the micro would be able to read the real world sensors, and control motors, valves and things, and convert to/from a serial bus, and also handle the addressing, so you can command individual chips.

Ideally, the micro board would be something smarter, running the operation, with the PC/network connection used to monitor, adjust, and coordinate the operations of the boards.

Yes, the smarts are in the software code.

You can still have it log stuff to a PC.

Reply to
Gary J. Tait

about

about

never

numerous

most

micro

use.

reading of

stored

Which is

the

then

had

timers,

8mhz,

Not

not, I

there

Thanks for saying that, I have a hard time putting into the proper words.

Reply to
Anthony Fremont

The micros I looked at seemed to be less handy than that. Can you recommend a specific part?

--
"Very well, he replied, I allow you cow's dung in place of human 
excrement; bake your bread on that." -- Ezekiel 4:15
Reply to
Gregory L. Hansen

on the

then

more

The 16F88 is a nice mid-range part. The 18F452 is a nice upper end part. What language do you wish to develop in? I prefer assembler, and I highly recommend you learn it first then look at things like JAL or C. Once you fully understand what these things can do for you, you will start seeing applications for them everywhere. They are simply tiny self-contained computers offering high speed and precision and the ability to easily interface to analog or digital devices. The best part is that you can reprogram them 100's of thousands of times if necessary. ;-)

Some of the fun things I have built with PIC chips:

1) 4*20 LCD dumb serial terminal. You plug a PC keyboard into it. ;-) 2) stepper motor controllers for a never ending robot project 3) infrared remote controlled temperature display using Dallas 1-wire sensors (I even do a complete bus search for all devices and address them all by their full id's) 4) ultrasonic rangefinder 5) telephone line powered caller-id display 6) antique clock beat synchronizer, counter 7) RGB LED rainbow color changer thingy (kinda simple I know, but hey I'm fascinated by bright, shiny objects)

All of these devices could be easily modified to communicate serially (or thru USB) to a PC. The PC could be simply used as an output device or it could exercise full control over the device, the choice is yours (well actually it's mine ;-) You could do something where the PIC accumulates data over time and stores it internally (or in another eeprom for large amounts of data) and then spits it out on command upon connection to a PC.

Reply to
Anthony Fremont

January Circuit Cellar magazine had a project based on the work of Igor Cesko

formatting link
which implements USB 1.1 in software in a cheap AVR microprocessor, either an ATmega8 or a AT90S2313.

This would be a good option, as it connects the uC directly to USB and powers it too, giving you the ability to customise the software load in the AVR to do specialised (rapid) things, but still get started with Windows drivers to flip port pins at a lower rate. The AVR is a pretty easy uC to get started with, and there are enough different kinds that you can use one of the family for almost any project. You'd probably not need to learn another architecture for a number of years.

Reply to
Clifford Heath

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.