• AVR Freaks

Hot!pic-pc communication protocol via usb

Page: 12 > Showing page 1 of 2
Author
boula
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/11/19 01:33:05
  • Location: 0
  • Status: offline
2020/01/06 02:15:41 (permalink)
0

pic-pc communication protocol via usb

Hello,
I would like to have documentation on the communication protocol between a pc (host) and a peak (device) via USB.
Can someone send me a documentation?
thank you
#1

32 Replies Related Threads

    ric
    Super Member
    • Total Posts : 25105
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic-pc communication protocol via usb 2020/01/06 02:30:07 (permalink)
    0
    There is no standard.
    If you have a PIC with a USB interface, then the firmware in the PIC will usually emulate a CDC (Communications Device Class) or HID (Human Interface Device).
    In each case, what data flows between the PIC and the PC depends upon what firmware is installed in the PIC. There is not enough information in your question for us to know how to answer.
    Are you trying to analyse how an existing system works, or are you trying to design a PIC/USB device yourself?
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 02:36:17 (permalink)
    0
    J'aimerai concevoir Moi-même un périphérique PIC / USB.
     
    #3
    ric
    Super Member
    • Total Posts : 25105
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic-pc communication protocol via usb 2020/01/06 02:49:05 (permalink)
    0
    boula
    I would like to design a PIC / USB device myself.



    Start with one of the Microchip example designs, then adapt it to your needs.
    What sort of USB device do you want to create?
     
    Start here: https://microchipdeveloper.com/usb:development
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    MBedder
    Circuit breaker
    • Total Posts : 6817
    • Reward points : 0
    • Joined: 2008/05/30 11:24:01
    • Location: Zelenograd, Russia
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 04:52:52 (permalink)
    5 (2)
    ricStart with one of the Microchip example designs, then adapt it to your needs.
    Wrong. Start from blinking a single LED at a certain rate and come back when done.
    #5
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 07:14:33 (permalink)
    0
     
    Hello, just to be clear,
    I want to change my communication protocol between an 8-bit microcontroller and a computer.
    Indeed, I use a RS-232 serial communication and I noticed that the data sending was very long in flow compared to our need (1.5Mbits/s).
    I had contacted a microchip person and advised me the 16 bits microcontroller ( pic24fj1024gb610).
    For the configuration of my pic24fj1024gb610 and my USB OTG module, I used the MPLAB X IDE software with its graphical environment.
    I have already configured my two tools, but the problem is that
    When I plug in my USB type-C the software does not recognize it.
    It must be because of my USB module's register configuration?
    THANK YOU 
     
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 18141
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 07:35:53 (permalink)
    0
    You used the graphical environment (MCC I assume) to configure the USB module as what? A “Device“ if you plan to connect to a PC. CDC? What ”software” does not recognize it?
    #7
    MBedder
    Circuit breaker
    • Total Posts : 6817
    • Reward points : 0
    • Joined: 2008/05/30 11:24:01
    • Location: Zelenograd, Russia
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 08:04:37 (permalink)
    0
    "Shall cure this LED blinking only, young padawan!" LoL
    post edited by MBedder - 2020/01/06 08:05:56
    #8
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 08:05:51 (permalink)
    0
    Le logiciels MPLAB X ,  pour commencer à effectuer les tests.
    #9
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 08:09:06 (permalink)
    0
    Peut être que c'est dû aux configurations des registres USB :( 
    #10
    MBedder
    Circuit breaker
    • Total Posts : 6817
    • Reward points : 0
    • Joined: 2008/05/30 11:24:01
    • Location: Zelenograd, Russia
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 10:39:39 (permalink)
    5 (2)
    Talk Irish!
    #11
    Aussie Susan
    Super Member
    • Total Posts : 3646
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 18:34:19 (permalink)
    0
    Irish = Celtic - that would be just as bad!!!
     

    Le logiciels MPLAB X ,  pour commencer à effectuer les tests.

    translates to:
    MPLAB X software, to start performing the tests.
     

    Peut être que c'est dû aux configurations des registres USB

    translates to: 
    Maybe it's due to the configuration of the USB registers
     
    I suspect the OP's problem is that they expect the USB module to be more than just hardware. MCC might help here but they need to realise that they need to provide the firmware to drive the USB module themselves. This is not necessarily a trivial exercise.
    An alternative (if practical) might be a serial/USB chip.
    However if the underlying problem is that they need a 1.5Mb/s transfer then there may be issues with the USB approach as well - full speed is only 12Mb/s without accounting for all of the overheads and other users of the bus. If they can't get the UART to go as fast as they need (the pic24fj1024gb610 UART can go to to 4Mb/s with 4x sampling and a suitably fast Fosc) for some reason, then they may be out of luck.
    Susan
    #12
    ric
    Super Member
    • Total Posts : 25105
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic-pc communication protocol via usb 2020/01/06 18:54:54 (permalink)
    0
    Aussie Susan
    I suspect the OP's problem is that they expect the USB module to be more than just hardware. MCC might help here but they need to realise that they need to provide the firmware to drive the USB module themselves. This is not necessarily a trivial exercise.

    Agree. I think the OP imagines the USB interface is just a very fast serial port.
     
    Even a PIC16F1xxxx chip using the USART in 4x mode could do 1.6MB/s when running at 32MHz.
    Of course, you would only have 20 instructions to load the next value into the TXREG, but it could be doable.
     

    An alternative (if practical) might be a serial/USB chip.

    Yep. An FTDI FT323R is rated to do up to 3Mb/sec, so could easily handle 1.6.
     
    I wonder if the specified 1.5 Mb/s is an exact requirement, or a minimum.
    Also, if the data flow is continuous, or just a short burst.
    These are all parameters an engineer needs to know to correctly evaluate the best solution, but the OP has failed to reveal them yet.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #13
    ric
    Super Member
    • Total Posts : 25105
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic-pc communication protocol via usb 2020/01/06 19:01:55 (permalink)
    0
    n.b. clocking the PIC from the 24MHz clock output of the FT232R would permit generating 1.5Mb/s precisely.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #14
    Mysil
    Super Member
    • Total Posts : 3544
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/06 22:07:09 (permalink)
    #15
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/07 00:54:36 (permalink)
    5 (1)
    Merci pour vos réponses.
    Je regarde ça toute suite.
    boula 
    #16
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/07 00:57:12 (permalink)
    0
    Is it possible to configure the registers of the USB module thanks to the graphical environment ( mcc ) of the Mplab x software?
    #17
    vloki
    Jo, alla!
    • Total Posts : 6815
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/07 01:57:38 (permalink)
    5 (1)
    It is not sufficient to configure some registers. You have to provide the firmware that handles the communication for the desired USB device class. Possibly MCC can do this for you. (Never used it)
     
    Start a new blank project.
    Under "Device Resources" go to USB and select "MLA USB Device Lite".
    In the dialog go for "CDC" and at the bottom there is a checkbox "Generate CDC Example Code"
     
    As a result of this process you should see a lot of files now in your new project.
    THIS is what makes the PIC a USB device. Guess you will not understand a single line of that code ;-)
     

    Uffbasse !
    #18
    boula
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/11/19 01:33:05
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/07 02:29:06 (permalink)
    0
    MERCI 
    #19
    Severino
    Starting Member
    • Total Posts : 29
    • Reward points : 0
    • Joined: 2014/04/30 01:50:28
    • Location: 0
    • Status: offline
    Re: pic-pc communication protocol via usb 2020/01/07 07:31:30 (permalink)
    0
    Did you read the book I recommended a couple of weeks ago?
     
    https://blog.flyingpic24.com/gtsu/
     
    It contains a chapter with USB communication, especially CDC (Communication Device Class) and useful background information about USB, plus well documented code examples.
     
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5