Click here to Skip to main content
13,090,541 members (50,130 online)
Rate this:
Please Sign up or sign in to vote.
Hello Everybody,I'm an intermediate programer in Desktop programing using C#,C,C++ and java and I started a new project with microcontroller PIC18f2550.
I Programed the device driver for windows and linux but I can't start programing the microcontroller as it should send the USB descriptor. The problem is not in the descriptor itself but in how to send it I have to connect the device with two way USB although there is only one USB interface in that micro and anyother Microchip(PIC) microcontrollers. I connected one jack with the USB ports interface pins (RC5/D+)(RC4/D-) and the another one with the serial ports interface pins(RC7/RX)(RC6/TX).
Now my question is: How to send that descriptor through the USB interface pins and the serial ports ones?
Posted 26-Apr-13 11:17am
Updated 26-Apr-13 11:31am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You cannot wire a Serial port to a USB port, they are different line levels and protocols, this has nothing to do with the descriptors and setting up the USB and everything to do with how data is transmitted at the circuit level. If you want to connect a USB port to a serial port, you will need a go-between chip like the FTDI (Here[^]).
khaledkaaka 26-Apr-13 22:50pm
I cann't add this because I need high speed USB 480 Mbps not full speed 12 Mbps. Also RC7,6 can be used as normal input/output pins please help! the only problem is in sending the descriptors. Any solution.
Ron Beyer 26-Apr-13 23:50pm
A PIC will never do 480 Mbps, USB, Serial, or otherwise. Even on PIC's website the max speed of the USB interface is 12 Mbps and that speed would probably be difficult to achieve. For 480 Mbps you will need to get into FPGA territory (not for novices, very advanced stuff) Are you using some kind of development board or are you trying to wire directly to the chip? Do you have a schematic you can share for what you have and are trying to do?
khaledkaaka 27-Apr-13 0:08am
I'm using a PCB board and I need to make a device with two way USB ok I'll not be worry about the speed but how can I send the descriptor in non-USB interface pins that is only my question or how it be sent in the USB pins to semulate that.
Ron Beyer 27-Apr-13 0:27am
I'm sorry, but you can't connect non-usb pins to a usb port. You cannot directly (without the FTDI or similar chip) connect Serial to USB, its just not possible. There's nothing you could send on a serial port to talk to a USB port, or vice-versa and you may damage the chip (or worse, your computer) attempting to directly connect the two. I may be misunderstanding what you are trying to do here, but you can (or should be able to at least) program the PIC through the serial port using MPLAB and set up the chip to do USB communications through the code on the PIC. PIC has reference software to do this available:

khaledkaaka 27-Apr-13 1:05am
Can I connect any GPIO to the usb data wires and send data from it? I'm already using MPLAB
Ron Beyer 27-Apr-13 1:19am
No, the USB lines work on a transceiver that is internal to the PIC, that's why it only has one USB port, because it only has one transceiver. It's not just sending data down the line, it does a lot more like line level conversions, bus negotiation, etc. If it were serial I would say yes, since you can bit-bang serial, but you can't bit-bang USB.
khaledkaaka 27-Apr-13 1:29am
In flow code you can program a non-USB interfaced micro like pic12f675 to send and receive USB data packets and it doesn't have any USB transceiver. Can I send the data using USB data packet format.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

instead of using serial pins I found the solution and it worked. I used two micros and each one interacts with a computer but now move to the speed problem I'll use a FPGA but I wanna know does it have 2 USB-IF or only one?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100