Newbie: A/D -> RS-232 -> Computer -> RS-232 -> D/A

I'm interested in learning electronics (have picked up a basic book, but open to recommendations).

Anyhow, I'm basically looking for some help on the best/easiest/cheapest/fastest way of reading some analog values into the computer (via USB or RS-232 port), processing these values and then outputting a value via USB or RS-232 port to be output in analog. I'm also interested in outputting a value that represents a frequency to be generated by a timer chip.

Help!?

I've done some looking on Digikey and there are piles of A/D and D/A chips with serial interfaces on them. These are clearly not meant for RS-232 direct interfacing and I'm sure are meant for high speed serial input.

I'm open to using PIC chips if necessary. If that is the route, then I need to find an inexpensive source for them.

So, I guess I'm asking somebody/everybody to give me free ideas/designs that would normally cost mucho $$$ :-)

Thanks.

-Ralph

Reply to
Ralph Seguin
Loading thread data ...

What I started reading your post I was hoping to see you mention the PIC (or any other MCU), which you did! That's because the MCU approach is one of the easiest and most flexible. You can get PICs with built-in A/D converters of up to 10 bits or resolution. As for D/A, if you're not too bothered with issues like precision, speed and ripple, you can use one of the built-in PWM outputs to generate an analogue voltage using a simple RC filter. The resolution of the h/w PWM modules on standard PICs goes up to 10 bits too, which matches the A/D nicely. If you want to go for a true D/A chip, there are plenty available. Choose a serial one (to save pins) and drive it from the PIC's pins directly. For the serial (RS-232) communication there are PICs with built-in USART modules that do it in hardware. I'd suggest the

16F877A as a general purpose PIC with all of the above. If it's too big for you (40 pins) you can get the 28-pin version (16F876A). If you finally decide to go the PIC way, do a Google search for programmers, resources, etc. The available information is overwhelming. I personally use the ePIC programmer from
formatting link
As for source code, check out
formatting link

Once you build the data acquisition circuit and you can send/receive analogue signals, you can use the remaining PIC pins and code memory to do all sorts of fancy stuff like driving LCDs, controlling motors, etc. A nice beginner/intermediate project is to build a servo position control system with a motor coupled with a pot to provide the feedback signal.

Good luck.

Costas _________________________________________________ Costas Vlachos Email: snipped-for-privacy@hot-X-mail.com SPAM-TRAPPED: Please remove "-X-" before replying

Reply to
Costas Vlachos

There are lots of simple A/D interfaces available to buy if you don't want to design your own.

Try a search on "data logging" or see these pages...

formatting link
formatting link

Reply to
CWatters

On a sunny day (13 Jan 2004 21:00:49 -0800) it happened snipped-for-privacy@yahoo.com (Ralph Seguin) wrote in :

The PIC 12F675 has a 4 channel AD, 8 pins, you can use a pin for serial out, internal flash memory, internal oscillator and cost about 2 $ in single quantities. So:

2 power pins (+ and GND) 4 input pins 1 reset pin 1 serial out

To do the D/A spend an other 2 dollars and use the timer in that chip to generate a PWM signal, that you then lowpass with a simple RC. Rest as above.

For that money buy 10 and start experimenting.

Some (much) more expensive pics have rs232 port, some are 'self programable' via the rs232.

You can also use a Philips PCF8591 on 3 pins (2 for sda, 1 for scl), it has 4 channel A/D and 1 channel DA 8 bits, but not true rs232, but i2c.

Reply to
Jan Panteltje

Go to

formatting link

It's $24.95 with all the software you need, and there are 4 10Bit channels.

Least expensive I've found! I have three I use for DC power supply monitoring.

Reply to
Roger Gt

Monitoring analog data via an RS232 connection is the easy part. DATAQ has a 4 port, 10 bit, A/D device that gets its operating power from the serial connection to the PC and includes some software. They even include some VB source code.

formatting link
$24.95US

More about me:

formatting link
VB3/VB6/C/PowerBasic source code:
formatting link
Freeware for the Palm with NS Basic source code:
formatting link
Drivers for Pablo graphics tablet and JamCam cameras:
formatting link
johnecarter at@at mindspring dot.dot com. Fix the obvious to reply by email.

Reply to
the Wiz

Now we're talking 8)

For your objective i'll suggest the pic 16f877 or the 16f877a. They both have a UART (or USART?! i'm not sure) and a ADC included.

Go for

formatting link
and find its datasheet...

For programming the PIC, I'm using the "Trivial Low Voltage Programmer" TLVP circuit *free* : it's bloody simple and works

look at

formatting link

(you still need to get a aditional circuit for the +5V supply for the programmer ... not included above. A simple +9V power supply and a voltage regulator / 5.1 zener diode will do the trick ...)

On the same link above is the software to use the programmer (free)

I think the best free programmer solution would be the

formatting link
but if you want to quickly start PIC programming, i'ts the simplest yet working circuit i've found.

A word of warning : if you want to try the TLVP, stick to the 16F877 instead of the 16F877A ... the first chip is a lot bulkier that the A version but I haven't found the software needed to program the A version chips ... Although the

formatting link
can.

Note that with the programmer you can use every language you want : BASIC, C, asm, whatever. The programmer only takes your compiled code (compiled by your language compiler) and puts it into the PIC flash epprom !

Be carefull when building the hardware ... Check everything, specially the PC parallel port wiring ... Don't blow up your PC parallel port 8)

For the PC paraller port wiring, look at

formatting link

Ufff! I hope I've helped you 8) Information overload ?! 8) hope not !

Reply to
ptek

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.