Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: ejohns85 on August 22, 2006, 05:17:15 PM

Title: PC link with microcontroller
Post by: ejohns85 on August 22, 2006, 05:17:15 PM
Hi,

I am trying to set up a link between an AVR microcontroller and a PC. I need the PC to send signals to set the input pins high/low, and also so the microcontroller can send the values of its output pins back to the PC for analysis.

Initially I would like to do this using cables to simplify things, but later on if it is possible, I am keen to use a wireless link for the two-way communication. Any suggestions for what products are available for what I am trying to do, or how I can make one myself?

Thanks very much!
Title: Re: PC link with microcontroller
Post by: cjwillms on August 23, 2006, 12:28:20 AM
I've found 2 links that should really help you. I haven't done this my self yet, but both articles seems to go into plenty of detail

Using C, Controling Parallel port pins
http://engr.nmsu.edu/~etti/fall96/computer/printer/printer.html

Using C#, but the article only mentions Parallel output
http://www.codeproject.com/csharp/csppleds.asp

The best thing to do, is hook up a parallel cable to a breadboard, and then attach buttons & leds to the different ports.
Title: Re: PC link with microcontroller
Post by: dunk on August 23, 2006, 04:57:54 AM
while this could be done using a PC's parallel port, using the PCs serial port and an AVR's UART makes for much simpler circuitry.

the big win for you here would be when you come to make your project wireless it will be a simple matter of inserting a pair of
radio transceiver units between the serial RX <-> TX lines rather than having to worry about lots of different connections between the parallel port and the AVR.

another advantage of using serial communication is you will be able to communicate with your AVR using standard PC software (such as hyperterminal that comes with windows).

do a google search for terms like "UART" and "serial port" and see what you come up with.
here's 2 i found in under 5 mins:
http://www.qsl.net/pa3ckr/bascom%20and%20avr/rs232/index.html
http://www.opend.co.za/tutorials/avrtut4.htm
http://home.wanadoo.nl/electro1/avr/scroll6.htm

happy building!

dunk.