Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

usb communication between a pic and PC

Status
Not open for further replies.

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
hi guys,



can someone tell me how to configure usb communication on a pic18f using micro C .i want to send some data to the PC so how can i identify my PIC though usb port.how to create a discriptor.?????



thank you.
 

tpetar

Advanced Member level 5
Joined
Sep 27, 2010
Messages
6,427
Helped
1,712
Reputation
3,454
Reaction score
1,677
Trophy points
1,393
Location
Pancevo-Belgrade, Serbia
Activity points
37,376
Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Zip and Post your code so that I can help. To create descriptor file, go to Tools>HID Terminal in mikroC and click Descriptor Tab. See image for the settings.
replace "Any name with the name you want. select mikroC option in the HID Terminal windows. click save descriptor and save the file in your project folder.
Then Go to menu Project>Add Files to Project... and in the dialog box select USB
dsc.c file from your project folder and click open in the dialog box.

Also see the link http://usbhidcommunication.blogspot.in/2011/10/simple-usb-hid-communication-project.html
 

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
thanks a lot for the reply...
I dont want any user interface in pc to send any data to PIC through usb. i just want to collect the data comming through usb.how can i achieve that????
 

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
thanks
hyperterminal is there to collect serial port data.rit??? usb??
 

tpetar

Advanced Member level 5
Joined
Sep 27, 2010
Messages
6,427
Helped
1,712
Reputation
3,454
Reaction score
1,677
Trophy points
1,393
Location
Pancevo-Belgrade, Serbia
Activity points
37,376

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
thankss
it says about saving 'serial data (from serial port)' in a usb. but i want to save data which is coming through usb port ( data coming from HID) in the PC.
 

tpetar

Advanced Member level 5
Joined
Sep 27, 2010
Messages
6,427
Helped
1,712
Reputation
3,454
Reaction score
1,677
Trophy points
1,393
Location
Pancevo-Belgrade, Serbia
Activity points
37,376
thankss
it says about saving 'serial data (from serial port)' in a usb. but i want to save data which is coming through usb port ( data coming from HID) in the PC.


To communicate with your USB device you need adequate PC software for that device.

That USB serial logger is for portable version (one of versions). You can easely send serial data from uC.

:wink:
 

xpress_embedo

Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,165
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,570

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
After creating the discriptor file ...... what should i do next to communicate through USB. How do i create the "host software "...????????

please helpPP!!!
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Do you want to create a vb.net or vc# app to log data coming from your PIC? If yes, you need Visual Studio 2008, 2010, 2012 and USB HID friver like mcHID.dll found at Helm PCB.

There is also USBHIDNetClass and some other drivers for USB communication. If you use mcHID.dll I can help in VB.Net code.

What data are you sending from PIC to PC? what will be the contents of Write_Buffer in mikroC Pro code?

Have you seen this link https://www.edaboard.com/thread271146.html
 

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
Do you want to create a vb.net or vc# app to log data coming from your PIC? If yes, you need Visual Studio 2008, 2010, 2012 and USB HID friver like mcHID.dll found at Helm PCB.

There is also USBHIDNetClass and some other drivers for USB communication. If you use mcHID.dll I can help in VB.Net code.

What data are you sending from PIC to PC? what will be the contents of Write_Buffer in mikroC Pro code?

Have you seen this link https://www.edaboard.com/thread271146.html
i want to send some data calculated inside my PIC, to PC periodically!!!!!!!!!!
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
You can use a timer interrupt for your period and USB communication to send data. 64 bits are sent at a time. you should use a vb.net application if you are using mcHID.dll to log data at the PC side. I can help coding using mikroC Pro and vb.net
 

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
You can use a timer interrupt for your period and USB communication to send data. 64 bits are sent at a time. you should use a vb.net application if you are using mcHID.dll to log data at the PC side. I can help coding using mikroC Pro and vb.net
thanks>>>>>
i'm using MikroC Pro ...... hw should i proceed???
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
See the USB example in mikroC Pro folder. Write a code and post it. You should know the address of USB RAM. To know the address of USB RAM for your PIC see the USB RAM section in the datasheet. See where the USB user data starts and ends. Which PIC are you using? Do you have Visual Basic 2010 or 2012?
 

amilaachala

Newbie level 6
Joined
Nov 15, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,356
i'm using pic18f2550 .......... i can download visual basic............. this is needed to design the host software rit???
 

Joined
Jul 25, 2012
Messages
1,192
Helped
170
Reputation
340
Reaction score
161
Trophy points
1,343
Activity points
0
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top