Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


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.

Reply
 
LinkBack Thread Tools Display Modes
Old 2nd May 2008, 11:04 AM   (permalink)
Default USB communication with pic

I want to communicate with a pic using usb in C++. Any help on this?
Albert Smit is offline  
Old 3rd May 2008, 04:07 AM   (permalink)
Default

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. ---
kchriste is offline  
Old 3rd May 2008, 10:12 AM   (permalink)
Default

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?
Albert Smit is offline  
Old 3rd May 2008, 01:16 PM   (permalink)
Default

Quote:
Originally Posted by Albert Smit
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?
Some people use an FT232RL USB converter chip, I have not heard of the stability problems that you mentioned.
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.
picasm is offline  
Old 3rd May 2008, 02:43 PM   (permalink)
Default

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!
Albert Smit is offline  
Old 3rd May 2008, 04:23 PM   (permalink)
Default

You will need an inverter and level converter, as the USB/RS232 converter obviously outputs RS232 signals - a MAX232 is one solution.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
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



All times are GMT. The time now is 08:25 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

eXTReMe Tracker