Hi,
I'm new to using usb and I must write a C code that read data from the usb port of PICDEM Full Speed demo board (PIC18f4550).
What software can I use? I need to write a little driver for exchange data with the board?
thanks![]()
Hi,
I'm new to using usb and I must write a C code that read data from the usb port of PICDEM Full Speed demo board (PIC18f4550).
What software can I use? I need to write a little driver for exchange data with the board?
thanks![]()
Do you need to write "C" code for the PIC or the USB host application?
I have PBP & Visual Basic code for the following if you're interested
http://www.rentron.com/images/USB_MAIN.gif
Last edited by Bruce; - 20th September 2006 at 00:34.
Hi Bruce,Originally Posted by Bruce
Did you used the HIDFS Maker by trace system in this application of yours for the PIC USB firmware program side?
Thanks
This looks like a good example to put in your example projects page.... I know I would certainly like to see it. By the way, I don't know if you hear it enough, but those examples are excellent and really help beginners understand how to get started..... so in other words.... THANK YOU!Originally Posted by Bruce
Wisdom is knowing what path to take next... Integrity is taking it.
Ryan Miller
Hi Bruce,
I must write the USB host application...only read and display bulk data from the pic in CDC class.
If I use a generic class i must write a driver, it's correct?
Can I go with the CDC class or an HID class to 1,5 Mbit/s ?
thanks![]()
Last edited by Gab25; - 21st September 2006 at 09:33.
I don't see why you would need to write your own driver. CDC class can use the Windows generic driver already available with Windows.
Microchip & PBP both offer example programs for CDC class USB communications.
As for data rates, download & review the USB 2.0 & CDC class documents from http://www.usb.org These explain in detail what data rates you can expect depending on the USB transfer type you're using.
You might also want to take a peek at Microchips' AN956; Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software.
Any route you take is going to involve some serious study time. USB is pretty complex.
I tried to use the microchip example "Run time linking" but I can't see the correct value of the potentiometer.
If I try to read the Firmware Version it works great. Any Idea?Code:#define RD_POT 0x37 send_buf[0] = RD_POT; send_buf[1] = 0x02; SendReceivePacket(send_buf,2,receive_buf,&RecvLength,1000,1000); printf("\n%x %x %x\r\n",receive_buf[0],receive_buf[2],receive_buf[1]);
Another part of the example:
switch(dataPacket.CMD)
{
case READ_VERSION:
dataPacket._byte[2] = MINOR_VERSION;
dataPacket._byte[3] = MAJOR_VERSION;
dataPacket._byte[4] = MINOR_VERSION;
dataPacket._byte[5] = MAJOR_VERSION;
counter=0x06;
Why I can't send 6 byte or more...but only 4?
Thanks and sorry for my english![]()
Last edited by Gab25; - 16th October 2006 at 17:28.
Hi Bruce,
Thanks a lot for your post on USB. I am one of those countless people to have benefited from your site and code examples. You have the knack to explain things in a lucid manner, with the result, I don't merely copy your code, I learn to generate my own code.
I have been using PICs for my projects for the past 5 years and PBP is my compiler. As you have rightly pointed out, USB is a fairly complex subject and you need to do some serious learning if you want to incorporate USB connectivity in your projects. Of course, the degree of difficulty varies depending on what you want to do with the USB.
Now, my question: Where is the code example in your site? When I click on the link you have given (http://www.rentron.com/images/USB_MAIN.gif), I only see the gif image of the screen shot of the VB program.
Awaiting your reply.
Regards,
Bala
Hi Bala,
I haven't had time to finish this project, but you're welcome
to download the project files as-is from this page:
http://www.rentron.com/PicBasic/PIC_USB.htm
When I can find some spare time, I'll finish the project.
Until then, anyone using these files will need to figure
things out by referring to the source code comments.
It's going to be a while until I have time to finish this one,
but it should help a few folks get started.
Bookmarks