My question really is: I know how to play with PIC's, I know how to mess with the PC software side (or at least what to google etc, which is basically the same thing given time) BUT I have no idea how to connect the two. I'm not afraid of using a soldering iron, and I know you can get small LAN or USB board that I'm sure I can wire to a PIC. So, I need to know what to program that will let me send signals to and from a PIC and a desktop.
I'm sorry if I'm not being very useful with my description, but thats the main problem; I don't know quite what to do, so I don't even know which manual to rtfm. If I'm barking up the wrong tree, I'm all ears, as I say I just need some easy, preferably cheap protocol to send signals between a PIC and desktop
Cheers, ~Sym~
Questions on PIC's and connectors
Moderator: Moderators
Questions on PIC's and connectors
Linux is hard...
- avwolf
- Templar Inner Circle
- Posts: 7006
- Joined: Wed Jan 17, 2007 5:33 pm
- Location: Nebraska, USA
- Contact:
Re: Questions on PIC's and connectors
Easiest thing to do is get a USB FIFO device. The one I've used is by DLP Design. It's got a driver that lets you treat the USB device as a standard serial port, which is much easier to write code that talks to. Then you can wire it up on your embedded device as either a parallel or serial data source. It's really straightforward. I've tried getting a PIC with a built in USB controller and wiring a USB port to it, but I couldn't get it to work properly (I was having trouble figuring out how to make anything work without rewriting the USB stack, and there was no way in hell that I was about to do that).
-
- Templar GrandMaster
- Posts: 706
- Joined: Fri Dec 08, 2006 7:06 am
- Location: Behind my computer.
- Contact:
Re: Questions on PIC's and connectors
Go with a very cheap USB -> Serial adapter. You can do this one of two ways:
1. Get a standard USB->RS232 adaptor off Ebay(China Inc sells loads for extremely cheap), and grab a Maxim IC MAX232 level-converter to transform the serial-voltages to the lower voltage we need for the pic.
I've done this before with a PIC16F684, and it worked fine. I used HyperTerminal(on windows) for sending/recieving raw data.
2. Get a USB-TTL serial adaptor - Like This one for $6. It can be configured to output 3.5 or 5V, just what you need. This'd probably be the better option, but I haven't tried it myself.
Software side, you've got a UART on your pic that can be used to send and receive serial bytes simply by moving/reading a couple of registers. Note that it's slightly tricky; one of the timer modules may interfere with it and need special configuration on your pic - My 16f684 needed a couple of extra registers; the 16f690 didn't.
As far as reading/writing to the serial port, there's all sorts of things to do PC side - Easiest is a terminal emulator. Above that, I'd look into PySerial for using Python to acquire/send data to your device, and then use something like PyQt to give you a nice GUI.
1. Get a standard USB->RS232 adaptor off Ebay(China Inc sells loads for extremely cheap), and grab a Maxim IC MAX232 level-converter to transform the serial-voltages to the lower voltage we need for the pic.
I've done this before with a PIC16F684, and it worked fine. I used HyperTerminal(on windows) for sending/recieving raw data.
2. Get a USB-TTL serial adaptor - Like This one for $6. It can be configured to output 3.5 or 5V, just what you need. This'd probably be the better option, but I haven't tried it myself.
Software side, you've got a UART on your pic that can be used to send and receive serial bytes simply by moving/reading a couple of registers. Note that it's slightly tricky; one of the timer modules may interfere with it and need special configuration on your pic - My 16f684 needed a couple of extra registers; the 16f690 didn't.
As far as reading/writing to the serial port, there's all sorts of things to do PC side - Easiest is a terminal emulator. Above that, I'd look into PySerial for using Python to acquire/send data to your device, and then use something like PyQt to give you a nice GUI.
Re: Questions on PIC's and connectors
Ok, thanks for that, I think I'll probably go with the USB-TTL if only to see how it does, I'll have to work out how to wire it and what parts to get, but since I haven't actually bought anything yet, that won't be hard. So, now I can look up PySerial on the recieving end, the only thing left is to learn assembly...which is a pain. Don't get me wrong, I know its an annoying language to learn, I'm prepared for that, but I can't seem to find much literature on it...
I'm probably missing a few large and vital steps, but I normally do, I appreciate your help nonetheless!
~Sym~
--Edit--
Having a look at some of the PIC's, the 18F series can come with a physical USB embedded (as far as I can tell, none of the photos have anything that looks like one on it(?), or at least raw support for such) as well as a USART pin. Given the price for the low end chips is still quite low (I'm considering the 18F2455), might be worth a shot?
I'm probably missing a few large and vital steps, but I normally do, I appreciate your help nonetheless!
~Sym~
--Edit--
Having a look at some of the PIC's, the 18F series can come with a physical USB embedded (as far as I can tell, none of the photos have anything that looks like one on it(?), or at least raw support for such) as well as a USART pin. Given the price for the low end chips is still quite low (I'm considering the 18F2455), might be worth a shot?
Linux is hard...
- avwolf
- Templar Inner Circle
- Posts: 7006
- Joined: Wed Jan 17, 2007 5:33 pm
- Location: Nebraska, USA
- Contact:
Re: Questions on PIC's and connectors
Find a compiler and write C. Tons, tons easier than writing assembly for the PIC.
Re: Questions on PIC's and connectors
That sounds a Lot nicer. I mean, I still don't know the language, but...mmm, yes, lots nicer, Cheers.
Linux is hard...