Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

USB interface with PIC

Status
Not open for further replies.

madeel

Newbie level 3
Joined
Aug 28, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
i want to interface my PIC18f4520 microcontroller with USB port. how can i do that..!
if i directly short controler Tx with USB Rx and controller Rx with USB Tx, and short the grounds..
will that work or do i have to put some logic converter like RS 3232 in between.?
or this approch is totaly wrong?
i have no clue about it.
need help..
experienced personel comments will be highly acknowledged
 

USB is entirely different from RS232.
There is no need to use level converters and you can simply connect D- and D+ pins of usb device to host.


TX-RX / RX-TX---- this connections are not valid in the case of USB.
 

USB doesn't know Rx or Tx, the signal lines are named D+ and D-, and they have to be connected respectively.
Also Vbus has to be connected somehow at an USB "device" function, either powering the device (bus powered
operation) or as another signal that is needed to operate the interface according to the requirements,
particularly to detect bus attachment (self powered operation). Microchip has application notes about USB
interfacing.

There's also a classical source of USB related information **broken link removed**
 

anandpv2009 is right, usb protocol is quite complex.
There are some useful books and sites if you want to learn more.
 

It is possible to bitbang a USB at low speed only with that PIC but i would strongly recomend you getting a PIC18F2550 with a USB hardware.. you dont need to do anything, just learn how to use its specific functions at compiler and you got a USB port.

Another very classical reference about USB: https://www.beyondlogic.org/usbnutshell/usb1.htm
 

A good starting point is Jan Axelson's book USB Complete. She covers USB-capable PIC parts as well as gives code examples (C and PicBasic Pro on the microcontroller side, and VB and VC# on the PC side). If ordering it, be sure to get the latest 4th edition.

https://www.amazon.com/gp/product/1931448086
 

madeel said:
i want to interface my PIC18f4520 microcontroller with USB port. how can i do that..!
if i directly short controler Tx with USB Rx and controller Rx with USB Tx, and short the grounds..
will that work or do i have to put some logic converter like RS 3232 in between.?
or this approch is totaly wrong?
i have no clue about it.
need help..
experienced personel comments will be highly acknowledged

since you are using PIC with no USB pins but with UART,you can use prolific or ftd232 chips but you in serial port mode not in USB.

**broken link removed**
https://www.ftdichip.com/FTProducts.htm
 

since you are using PIC with no USB pins
Congratulations for reading the original question exactly, I didn't notice the point.
I couldn't imagine using two chips instead of one. But the correct answer in this case is of course:
directly short ... the pins, without extra logic or level converters, as assumed.
 

FvM said:
since you are using PIC with no USB pins
Congratulations for reading the original question exactly, I didn't notice the point.
I couldn't imagine using two chips instead of one. But the correct answer in this case is of course:
directly short ... the pins, without extra logic or level converters, as assumed.

Thanks for commenting on my posts,greatly appreciated.PIC18F4520 has only UART pins and has no USB pins(if this could be PIC18F4550,USB pins are readily available),so madeel can only use USB to RS232 chips(prolific or ftd) to have connections with USB but in serial mode.This is also use in link below for 16F877 can be interfaced with USB but in serial mode(PIC-P40-USB dev kit) for reference only.

https://www.olimex.com/dev/index.html

but if madeel will use 18F4550,he can use the USB framework from microchip using C18 compiler.This framework has many examples to playon(like HID,CDC,bootlader,etc.).

**broken link removed**
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top