USB CDC Communications for Dummies!


Closed Thread
Results 1 to 40 of 105

Hybrid View

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

    Default Re: USB CDC Communications for Dummies!

    Might be a problem with the buffer size compared to the data being sent. They are different sizes.

    Here is an example:
    Code:
    Buffer    VAR BYTE[16]
    Cnt       VAR BYTE
    B0        VAR BYTE
    B1        VAR BYTE
    
    ADCON1 = 15               ' Set all I/Os to Digital      
    CMCON = 7                 ' Disable Comparators
    Cnt = 16 
      
    for b0 = 0 to 15
        lookup b0,["USB CONNECTED!",10,13],B1 
        BUFFER(B0) = B1
        NEXT B0
     USBINIT 
    ' Main Program Loop
    Loop:
        USBService        ' Must service USB regularly
        USBOut 3, Buffer, Cnt, loop
        goto loop
    As for your speed test... my brain is ready to fuss out for the day also...
    Dave
    Always wear safety glasses while programming.

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

    Default Re: USB CDC Communications for Dummies!

    Hmmm.. I would think OS should still see it as a new device even if thats the case.

    Well I am studing the schematic now, I am not sure I have the "CAP" on Vusb. But I can say this thing works with a USB bootloader no problem. Now does that mean winblows will see it? IDK

    I see there are pullups on the data lines. And according to the datasheet, The internal pullups must be disabled. I have been looking at the include file, and I think there are being set.

    I am just about to give up on this "pre-configured" answer. After all, it may NOT be the answer for this chip anyway. I will start looking at your solution to see if I can make that work.
    -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!

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

    Default Re: USB CDC Communications for Dummies!

    The VUSB cap is a must.
    I have not used the chip you are using. do you have a 4550 or 2550?
    Dave
    Always wear safety glasses while programming.

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

    Default Re: USB CDC Communications for Dummies!

    In case any one wants to look, here is the schematic and "manual" seeing how I am having trouble with anything tonight, (the pullups do not exist on the board), Maybe I should give this one a break for a bit.

    No, I don't have any of those chips. I was hoping to be able to get this to work on a premade board. Seems like it should be possible. One thing I don't like, with the ready made code provided by melab, It takes more time to chase down what is ( or is not) going on.

    Does it make sense that if I can use microchips USB bootloader, the hardware side of things are ok?
    -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!

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

    Default Re: USB CDC Communications for Dummies!

    Looks like that board can be powered from the USB port. Is that what you are doing? If so, try powering it from another source.

    Are you connecting the board for testing to the same machine PBP is on? If not, did you copy mchpcdc.inf to the PC?
    Dave
    Always wear safety glasses while programming.

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

    Default Re: USB CDC Communications for Dummies!

    So far I have tried powered from USB, and powered from PK3. It is on the same PC as PBP, but it is a win7/64 machine. I see earlier you posted an update for win 64 machines and that file. While I haven't downloaded that yet, I would still expect to get the de-dum when I plug in the cable. Even if win can't figure out what to do with it.
    -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!

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

    Default Re: USB CDC Communications for Dummies!

    If the correct driver is not there the PC will not ding dong. It will just sit there or if you are lucky it will say it does not know what is plugged in. If you have PBP 2.6 you hqve the file needed for win 64. I think.
    Dave
    Always wear safety glasses while programming.

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