USB CDC Communications for Dummies! - Page 3


Closed Thread
Page 3 of 3 FirstFirst 123
Results 81 to 105 of 105
  1. #81
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: USB CDC Communications for Dummies!


    I ment post 54!

    Sorry for the confusion
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #82
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: USB CDC Communications for Dummies!

    Back to your question about speed....
    I think it runs at USB speeds....

    Universal Serial Bus Features:
    • USB V2.0 Compliant
    • Low Speed (1.5 Mb/s) and Full Speed (12 Mb/s)
    Dave
    Always wear safety glasses while programming.

  3. #83
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588

    Default Re: USB CDC Communications for Dummies!

    Just tech notes about USB speeds:

    The original USB 1.0 specification, which was introduced in January 1996, defined data transfer rates of 1.5 Mbit/s "Low Speed" and 12 Mbit/s "Full Speed". The first widely used version of USB was 1.1, which was released in September 1998. The 12 Mbit/s data rate was intended for higher-speed devices such as disk drives, and the lower 1.5 Mbit/s rate for low data rate devices such as joysticks.

    The USB 2.0 specification was released in April 2000 and was standardized by the USB Implementers Forum (USB-IF) at the end of 2001. Hewlett-Packard, Intel, Lucent Technologies (now Alcatel-Lucent), NEC and Philips jointly led the initiative to develop a higher data transfer rate, with the resulting specification achieving 480 Mbit/s, a fortyfold increase over the original USB 1.1 specification.

    The USB 3.0 specification was published on 12 November 2008. Its main goals were to increase the data transfer rate (up to 5Gbps), to decrease power consumption, to increase power output, and to be backwards-compatible with USB 2.0. USB 3.0 includes a new, higher speed bus called SuperSpeed in parallel with the USB 2.0 bus. For this reason, the new version is also called SuperSpeed. The first USB 3.0 equipped devices were presented in January 2010.
    http://en.wikipedia.org/wiki/Universal_Serial_Bus

  4. #84
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: USB CDC Communications for Dummies!

    I don't know whether I'm too dumb or not dumb enough to grasp all the intricacies of CDC but, if I understand it, there are virtual serial port drivers for interfacing on the PC side. When these are used, there's likely to be a slight speed hit as the data needs to be 'translated' from its RS232-ish form before transmitting and the reverse is true when receiving.

    This may not be noticed for normal communications but can be readily apparent when doing something like a firmware download which usuall includes short bits of data and CRC which is ACKed or NAKed from the embedded device. Of course, the faster the version of USB, the less this is a big factor.
    Last edited by dhouston; - 31st May 2011 at 00:16.

  5. #85
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    For CDC, baudrate is a meaningless parameter. You can set hyperterminal/vbSerialPort a whatsoever baudrate, the usb engine will emulate a serial communication as fast as it can
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #86
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by mister_e View Post
    For CDC, baudrate is a meaningless parameter. You can set hyperterminal/vbSerialPort a whatsoever baudrate, the usb engine will emulate a serial communication as fast as it can
    I'm not talking about transmission speed and I agree that baudrate has little meaning in this context. However, I have had a lot of experience downloading firmware files which might be as big as 64KB and there is a very noticeable difference between sending them via Serial->USB->Serial vs. sending them Serial->Serial with the latter being much faster as a result of the translation that must occur (on both ends). CDC should only need to translate on the PC end but I suspect there will be a significant speed hit never-the-less on certain applications.

  7. #87
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    True that. CDC is really handy for older software unable to deal with USB, somehow easier to program on both side... but to me, IN 20XX... it still sucks.

    I know your arguments... but ...Pure USB for me... all the way.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #88
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: USB CDC Communications for Dummies!

    Steve, when do we get the pure USB for dummies? Both ends, PiC and PC??
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  9. #89
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    USBDemo was a kickstart for many. Time changed, PBP work tad different now, mcHID.dll/MCSP/EasyHid = somehow a dead duck, VB6 is a long time outdated thing, seems Jan Axelson code examples are not for everyone... so yeah I think it's about time.

    I know how, I know something rock solid. Keyword: be patient...

    (Still, there's LOAD of ressource/ready to go components/lib over the net on the PC side)
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #90
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: USB CDC Communications for Dummies!

    and I quote:

    AAwwww come on guy, don't be lazy
    After spending my weekend searching and reading. I have come to the conclusion there is in fact - tons of examples and ready stuff all over the net. But does this help if one doesn't know where to start? Even bought Jan's book to help me. And it did. Now I assume my weekends work would amount to 30 minuites for someone able to write a picmulticalc. So a quick VB express (cuz it free to all) example passing a byte or 2 back and forth. Nothing more then that as it will overwhelm those who don't get it. ( read as ME ME ME)
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  11. #91
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by mister_e View Post
    Keyword: be patient...
    Ahh, you mean like waiting for the long-promised Tibbo EM500/GA1000 firmware. I'm down with that.

  12. #92
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by cncmachineguy View Post
    After spending my weekend searching and reading. I have come to the conclusion there is in fact - tons of examples and ready stuff all over the net. But does this help if one doesn't know where to start? Even bought Jan's book to help me. And it did. Now I assume my weekends work would amount to 30 minuites for someone able to write a picmulticalc. So a quick VB express (cuz it free to all) example passing a byte or 2 back and forth. Nothing more then that as it will overwhelm those who don't get it. ( read as ME ME ME)
    Everyone must start somewhere. Been there done that. I'm not more clever than anybody, but maybe I put more time & effort. I never found a magic potion to know everything and how to do things in a snap.
    1) have a project
    2) find information, read, digest them
    3) try something
    4) wash & rinse 'till it works

    You CAN'T learn VB (or else) in a day. It take months, years. I learnt the hard way too. The more you do, the more you develop tricks....the easier it gets.

    Don't give up!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #93
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by dhouston View Post
    Ahh, you mean like waiting for the long-promised Tibbo EM500/GA1000 firmware. I'm down with that.
    OH Really? Weird, It's the really first time I hear you about this long-promised Tibbo EM500/GA1000 firmware.

    Ham Mucus
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  14. #94
    Join Date
    Dec 2005
    Posts
    1,073

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by mister_e View Post
    OH Really? Weird, It's the really first time I hear you about this long-promised Tibbo EM500/GA1000 firmware.
    Yeah - I've probably made my point so I guess I'll go back to patiently waiting in silence.

  15. #95
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    Humanity have been created in 7 days (or so) ... this ought to be a huge firmware


    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  16. #96
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by mister_e View Post
    Don't give up!
    NEVER!!

    I learned ASM with nothing more then the datasheet for my chip I wanted to use. So I won't give up. But its nice to have people to ask for help. No, I don't profess to even come close to knowing all there is to know about ASM, but I can get by.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  17. #97
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default Re: USB CDC Communications for Dummies!

    Keep it for yourself, I'll share a secret with you... I'm a forum addicted guy They are golden opportunities to learn faster... grab someone's problem, work on, find a solution... then someone else post an alternative, observe, wash & rinse.

    Again... keep it for yourself
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  18. #98
    Join Date
    Apr 2013
    Posts
    2

    Default Re: USB CDC Communications for Dummies!

    Hi guys,
    can you help me with program USB CDC Communicator on uC PIC18F47J53?
    I never use USB, this is my first try.
    I tried use the sample code from USB18 (CDC_demo). I tried rewrite the code but without success.
    Thx.

  19. #99
    Join Date
    Apr 2013
    Posts
    2

    Default Re: USB CDC Communications for Dummies!

    Proglem solved:

    Must use #congif for PIC.

    ' USB sample program for PIC18F47J53 CDC serial port emulation
    ' Requires PBP 2.60 or later

    Include "cdc_desc.bas" ' Include the HID descriptors

    Define OSC 48

    #CONFIG
    CONFIG WDTEN = OFF ;WDT disabled (enabled by SWDTEN bit)
    CONFIG PLLDIV = 3 ;Divide by 3 (12 MHz oscillator input)
    CONFIG STVREN = ON ;stack overflow/underflow reset enabled
    CONFIG XINST = OFF ;Extended instruction set disabled
    CONFIG CPUDIV = OSC1 ;No CPU system clock divide
    CONFIG CP0 = OFF ;Program memory is not code-protected
    CONFIG OSC = HSPLL ;HS oscillator, PLL enabled, HSPLL used by USB
    CONFIG FCMEN = OFF ;Fail-Safe Clock Monitor disabled
    CONFIG IESO = OFF ;Two-Speed Start-up disabled
    CONFIG WDTPS = 32768 ;1:32768
    CONFIG DSWDTOSC = INTOSCREF ;DSWDT uses INTOSC/INTRC as clock
    CONFIG RTCOSC = T1OSCREF ;RTCC uses T1OSC/T1CKI as clock
    CONFIG DSBOREN = OFF ;Zero-Power BOR disabled in Deep Sleep
    CONFIG DSWDTEN = OFF ;Disabled
    CONFIG DSWDTPS = 8192 ;1:8,192 (8.5 seconds)
    CONFIG IOL1WAY = OFF ;IOLOCK bit can be set and cleared
    CONFIG MSSP7B_EN = MSK7 ;7 Bit address masking
    CONFIG WPFP = PAGE_1 ;Write Protect Program Flash Page 0
    CONFIG WPEND = PAGE_0 ;Start protection at page 0
    CONFIG WPCFG = OFF ;Write/Erase last page protect Disabled
    CONFIG WPDIS = OFF ;WPFP[5:0], WPEND, and WPCFG bits ignored
    #ENDCONFIG


    buffer Var Byte[16]
    cnt Var Byte


    OSCTUNE.6 = 1 ' Enable PLL for 18F47J50 family
    Pause 10

    USBInit ' Get USB going

    '************************************************* ***************
    '* Set PORTA, PORTB, PORTC, PORTD PORTE to input/output *
    '************************************************* ***************
    TRISA = %00100010 ' Set PORTA to output
    TRISB = %00001000 ' Set PORTB to output
    TRISC = %00---000 ' Set PORTC to output

    PortA = %00000000 ' Set PORTA to 0
    PortB = %00000000 ' Set PORTB to 0
    PortC = %00000000 ' Set PORTC to 0
    PortD = %00000000 ' Set PORTD to 0
    PortE = %00000000 ' Set PORTE to 0


    '************************************************* ***************
    '* SET LCD *
    '************************************************* ***************
    ' Define LCD registers and bits
    Define LCD_DREG PORTD
    Define LCD_DBIT 4
    Define LCD_RSREG PORTB
    Define LCD_RSBIT 0
    Define LCD_EREG PORTB
    Define LCD_EBIT 1
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 1500
    DEFINE LCD_DATAUS 50

    Pause 1000 ' Wait for LCD to start up

    '************************************************* ***************
    '* LOOP *
    '************************************************* ***************
    ' Wait for USB input
    idleloop:
    USBService ' Must service USB regularly
    cnt = 16 ' Specify input buffer size
    USBIn 3, buffer, cnt, idleloop

    ' Message received
    buffer[0] = "O"
    buffer[1] = "K"
    buffer[2] = 13
    buffer[3] = 10
    buffer[4] = 0

    outloop:
    USBService ' Must service USB regularly
    USBOut 3, buffer, 5, outloop

    Goto idleloop ' Wait for next buffer

  20. #100
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: USB CDC Communications for Dummies!

    Hi.. I have windows 7 64bit machine... I download the 64_mchpcdc.inf provided by mackrackit...and copy and paste it in the Windows\sysWOW64 folder, I also reboot the machine but I'm getting exclamation icon(CDC - R232 Emulation Demo) in the devices and printers window. What do you think I'm doing bad? Please give advice.

    Thanks in advance,
    tacbanon

  21. #101
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: USB CDC Communications for Dummies!

    The driver provided with PBP now has 64 bit support added. So you do not need the one I linked to, although it should still work.
    I think your problem might be that you copied it to a directory rather than letting the OS install it. Try deleting the file from the sysWOW directory, then do a reboot.
    When your project is plugged into your PC windows should bring up the usual dialog asking to install a driver. Do not let windows look for it, point to where the file has been saved to and let windows do the installing. You then should see a virtual com-port in device manager.
    Dave
    Always wear safety glasses while programming.

  22. #102
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Re: USB CDC Communications for Dummies!

    Hello macrackit, thank you so much for replying...I got it working now.

  23. #103
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default Re: USB CDC Communications for Dummies!

    Good day,
    I have PBP 250_b running on a windows_7 64 bit.
    What files are required in my PBP to update it to the 2.60 version and use the USB programs ?
    Where could I download them ?
    Thanks for helping
    Ambrogio

  24. #104
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: USB CDC Communications for Dummies!

    You will have to go to MeLabs website and pay for the upgrade.
    Dave
    Always wear safety glasses while programming.

  25. #105
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,795

    Default Re: USB CDC Communications for Dummies!

    Quote Originally Posted by mister_e View Post
    I know how, I know something rock solid. Keyword: be patient...
    Hi Steve. Any news about this promised demo?

    Ioannis

Similar Threads

  1. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 21:17
  2. One USB keyboard to Two USB Ports
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th June 2009, 01:04
  3. USB CDC help..
    By jchandir in forum USB
    Replies: 6
    Last Post: - 22nd November 2008, 22:23
  4. Replies: 4
    Last Post: - 5th November 2008, 17:21
  5. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 18:39

Members who have read this thread : 3

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