gnupic@linuxhacker.org
gnupic@linuxhacker.org
Eric N. said:
> I'm an engineering student working on a CPE degree. I'm looking for a
> good C/C++ book or site that would have information on the how to
> communicate using the RS232 or USB port. Novice to intermediate
> programmer.
Jan Axelson's "USB Complete" is good for getting a basic understanding of
USB, although it doesn't really cover the PIC in much detail, and it leans
towards Visual Basic in the examples. I hear that Jan's other interfacing
books ("Serial Port Complete" and "Parallel Port Complete") are also well
worth the money.
Host-side, you're going to find that the devil is in the details for USB
(well, same for serial, but the serial port is less complicated in
general). Windows makes it next to impossible for a hobbyist to
experiment, whereas Linux (and to some degree, the BSDs and Mac OS X) have
fairly easy interfaces to send and receive USB control messages. libusb
encapsulates this nicely: http://libusb.sf.net
I posted a little summary of my experiences with the PIC16C765 a little
while back; you may want to check on that if you're planning on doing USB
with a PIC (at least, I assume that's why you posted your question to this
list...).
For a school project, you are probably better off using a serial port.
There are plenty of PIC serial examples floating around the Internet, and
many of the newer PICs have hardware support for RS-232 (well, minus the
level shifter...). You will spend less time banging your head against the
wall if you just need to pass a few values back and forth across the
serial port.
On the other hand, there are a bunch of pre-built USB-enabled
microcontroller boards out there (EZ-USB and EZ-USB FX, mostly), and with
the right tools (any 8051 C compiler, such as SDCC), you can get up and
running pretty quickly.
It all depends on what you're trying to accomplish, really... are you
doing this for the sake of learning how to interface, or is this part of a
larger project?
--
Charles Lepple <clepple@ghz.cc>
http://www.ghz.cc/charles/
gnupic@linuxhacker.org