![]() | ![]() | ![]() |
| | |||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I want to communicate with a pic using usb in C++. Any help on this? | |
| |
| | (permalink) |
| You'll have to use C on the PIC but on the PC you can use C++ http://www.microchip.com/stellent/id...GE&nodeId=1486
__________________ --- The days of the digital watch are numbered. --- | |
| |
| | (permalink) |
| Thanks for the link. I'll check it out. I actually have a bigger problem. The circuit I'm working with already has a PIC16F886 on, which only has a RS232 serial port. But my laptop does not have a serial port, only USB. I've heard of a usb to rs232 converter, but they are not very stable. Is it possible to use the usb port as a virtual serial port maybe, and do rs232 communication directly to the pic? | |
| |
| | (permalink) | |
| Quote:
Here is an example of a project using that chip: http://www.camelspit.org/2008/02/29/...ensor/#more-42 Alternatively there are many ready-made usb to serial converters available quite cheaply from ebay etc. I think it would be almost impossible to do software only usb comms using your 16f886 chip. Someone has tried it already but had problems with getting the clock speed high enough (although it does work with AVR chips) http://www.cesko.host.sk/IgorPlugUSB...0(AVR)_eng.htm Another option would be to use a PIC18F2455/2550/4455/4550 chip which has a hardware usb interface built-in. | ||
| |
| | (permalink) |
| Thanks. I thought of using a 18f2550 but its pin outs doesn't match with the 16f886 on my PCB. The FT232RL chip seems easy to use. I'll try the pre-made converter first. Just 2 questions on using a pre-made converter: Do I still need to put in a MAX232 before the pic's UART to convert to serial levels or does the converter do that for me? And on the computer/USB side, is this then USB comm. or RS232? If it is usb communication, can anyone give me some help on that if I'm using C++. Thanks allot for the replies! | |
| |
| | (permalink) |
| You will need an inverter and level converter, as the USB/RS232 converter obviously outputs RS232 signals - a MAX232 is one solution. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Usb Cmos Camera Interface With Pic | RAJ.MIRK | Micro Controllers | 4 | 30th April 2008 11:56 PM |
| USB - First try - PIC 18F4550 | atferrari | Micro Controllers | 8 | 28th April 2008 11:48 AM |
| usb flash memory and pic | x_sa07 | Micro Controllers | 28 | 23rd April 2008 03:22 PM |
| PIC 18F4550 interacing with USB | amax | Micro Controllers | 7 | 21st December 2007 03:13 PM |
| USB communication between microcontroller & PC | HiteshDR | Micro Controllers | 15 | 19th December 2007 08:57 AM |