Sonsivri

Electronics => Hardware and Tools => Topic started by: terval on November 20, 2007, 08:52:12 20:52



Title: usb connect - need help
Post by: terval on November 20, 2007, 08:52:12 20:52
any one can help me on :

i need usb connectivity to pc (pic18f2550 or pic18f4550) to everything ,port(x), i2c, serial ,adc ?

any idea or soft.

Best regards to all.



Title: Re: usb connect - need help
Post by: 8K51 on November 20, 2007, 09:00:33 21:00
Hi

If you don't want to developp your own firmware UBW board is an answer :

http://greta.dhs.org/UBW/ (http://greta.dhs.org/UBW/)

Regards


Title: Re: usb connect - need help
Post by: FlvAnm on November 20, 2007, 09:09:50 21:09
Perhaps this link (http://www.alanmacek.com/usb/ (http://www.alanmacek.com/usb/)) - USB and PIC Microprocessors 16C745 and 18F2455 could be usefull.
it's quite old, but interesting.

Best Regards,
FLV


Title: Re: usb connect - need help
Post by: microled on November 20, 2007, 09:40:12 21:40
If you check the picbasic forum you will find all the answers you need, plus quite a few more!!


Title: Re: usb connect - need help
Post by: frasenci on November 21, 2007, 02:32:51 02:32
@terval

All suggestions given already are ok but maybe you get confused analyzing already made examples that are more complicated than needed.
I would say , try to keep it always as simple as the proyect at hands permits.

1.- First establish a clean link between PIC and Pc , that you can accomplish easy with CDC ( USb Serial )  or HID ( Both supported by MS Visual  on Pc and BASIC for PIC )

2.- Develop an communication code to talk between both platforms wich includes the commands and type of info you want to share.

3.- Write the code to handle the messages on both sides based on 2.-

For example , one message coming from Pc to PIC could be the string "AAAC01XXX" where AAA = Flag to announce message start , C01 = Command for PIC to sample analog port 1 , XXX = Flag to indicate termination off message. To this , PIC could answer with another message "AAAV010985XXX" . In this mesage , AAA and XXX can have the same meaning as before and V010985 will indicate V01 = value of variable 01 , 0985 = value 985

On Pc side it will be easy to manage the polling of serial port with function OnCom() ( prescence of data on com port ).
On PIC side it can be more tricky but you will soon find a way to poll the port with needed timing and let the code handle the messages from there on.

Hope this simple description helps you as a very basic startpoint
For CDC and HID see examples in Proteus,Proton and PBPro

Greetings
 


Title: Re: usb connect - need help
Post by: terval on November 27, 2007, 08:12:22 20:12
Hi frasenci

Now i understand much more about, using your information,and it seemĀ“s not so dificult,this protocol looks an easy way to work.

regards


Title: Re: usb connect - need help
Post by: aj49m on November 27, 2007, 08:57:58 20:57
Certainly class CDC is easier for working with transfer data usb, Programming PC Simplifies



Title: Re: usb connect - need help
Post by: drovik on November 28, 2007, 11:06:17 11:06
www.microchip.com :) or Proteus 7.2 (samples CDC, HID, GeneralUSB with temperature sensor for 18F4550)


Title: Re: usb connect - need help
Post by: bogdantk on November 28, 2007, 02:25:19 14:25
Hello
The easy way is to coonect via the serial port and an FT245R adapter to USB
Check http://www.ftdichip.com/Products/FT245R.htm
you will find the driver also it will map the usb to a com port very easy to use


Title: Re: usb connect - need help
Post by: micro_2000 on November 28, 2007, 07:20:28 19:20
Hi.. The FT232R also easy to used as USB to serial converter too.
Need not additional external component.