PICDEM FS and USB


Closed Thread
Results 1 to 10 of 10
  1. #1
    Gab25's Avatar
    Gab25 Guest

    Default PICDEM FS and USB

    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

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Nestyplus's Avatar
    Nestyplus Guest

    Default

    Quote Originally Posted by Bruce
    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
    Hi Bruce,

    Did you used the HIDFS Maker by trace system in this application of yours for the PIC USB firmware program side?

    Thanks

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    No. I used EasyHID.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216

    Default

    Quote Originally Posted by Bruce
    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
    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!
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

  6. #6
    Gab25's Avatar
    Gab25 Guest

    Default

    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.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Gab25's Avatar
    Gab25 Guest

    Default

    I tried to use the microchip example "Run time linking" but I can't see the correct value of the potentiometer.

    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]);
    If I try to read the Firmware Version it works great. Any Idea?

    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.

  9. #9
    Bala Chandar's Avatar
    Bala Chandar Guest

    Default PICDEM FS and USB

    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

  10. #10
    Join Date
    Jul 2003
    Posts
    2,405

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. USB Bootloader.
    By HenrikOlsson in forum USB
    Replies: 22
    Last Post: - 2nd May 2013, 02:46
  2. General USB questions
    By BobEdge in forum USB
    Replies: 2
    Last Post: - 21st April 2009, 04:19
  3. Analyzing USB Comm
    By kirtcathey in forum USB
    Replies: 13
    Last Post: - 11th January 2009, 21:27
  4. USB power definitions
    By RYTECH in forum USB
    Replies: 5
    Last Post: - 24th June 2008, 18:40
  5. Replies: 1
    Last Post: - 7th November 2007, 20:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts