I am looking to simply connect a pic to a pc and transfer data. I'll use any
port; parallel, serial or USB, whichever is most convenient. I would hope to
get the power for my pic from the port as well, which makes me think the USB
might be best, however it would be real easy to transfer data to the
parallel port. Anybody got some advice/experience with communicating with a
pc in this way? I'm also quite concerned about writing the software on the
pc side to read the port, not making it over complicated due to the pic
connection.
USB is definitely as simple or low-cost as parallel, but
you're right -- you can't source power from it. What
port you choose will also determine the rate at which
you need to transfer the data.
If you intend to only power a PIC or other low-power
circuit, you can do what I did in one app...I have the
I/O via the parallel port, but also had a connector on
the keyboard/mouse port for stealing 5V.
I'm using linux on the PC, so programming is simple in C.
There are only a few commands you need -- to setup the
port and then read and write to the port.
The protocol to read from the PIC should be the easiest
part. You can come up with your own, or write something
similar to a PC communicating with a printer (in reverse).
Do a search for parallel port pinout or parallel port
programming and you'll find lots of resources. I don't
remember them offhand, but beyond logic is a good place
to start.
> I am looking to simply connect a pic to a pc and transfer data.
> I'll use any
> port; parallel, serial or USB, whichever is most convenient. I
> would hope to
> get the power for my pic from the port as well, which makes me
> think the USB
> might be best, however it would be real easy to transfer data to the
> parallel port. Anybody got some advice/experience with
> communicating with a
> pc in this way? I'm also quite concerned about writing the software on the
> pc side to read the port, not making it over complicated due to the pic
> connection.
Go serial. It is simplest, by far, on both the software and firmware side
of things. TTYL
Thanks Neil and Herbert for the reply. I think I will try serially just
because it has power and sounds more convenient and neater. The data rate is
really not important to me at all. I just want to confirm that I can power a
pic off the serial port, I always though a mouse was a fairly passive device
and so very little current could be drawn? Also you wouldn't perhaps know of
a good place to get a code example of a pic/serial port communication (RS232
I guess)?
> I am looking to simply connect a pic to a pc and transfer data.
> I'll use any
> port; parallel, serial or USB, whichever is most convenient. I
> would hope to
> get the power for my pic from the port as well, which makes me
> think the USB
> might be best, however it would be real easy to transfer data to the
> parallel port. Anybody got some advice/experience with
> communicating with a
> pc in this way? I'm also quite concerned about writing the software on the
> pc side to read the port, not making it over complicated due to the pic
> connection.
Go serial. It is simplest, by far, on both the software and firmware
side
of things. TTYL
> Thanks Neil and Herbert for the reply. I think I will try serially just
> because it has power and sounds more convenient and neater. The
> data rate is
> really not important to me at all. I just want to confirm that I
> can power a
> pic off the serial port, I always though a mouse was a fairly
> passive device
> and so very little current could be drawn? Also you wouldn't
A serial port cannot supply that much current, however it is enough for a
PIC.
> perhaps know of
> a good place to get a code example of a pic/serial port
> communication (RS232
> I guess)?
Try looking up Father McGee's UART example, it's about the best one out
there. TTYL
Do the configuration bits vary much between PIC16C74A and PIC16F628? and are
there any other major changes that need to be made to code for a PIC16C74A
to be used on a PIC16F628?