USBIN pain


Closed Thread
Results 1 to 11 of 11

Thread: USBIN pain

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    20

    Default Re: USBIN pain

    That might explain why garbage appears on the lcd at switch on, however as its confihured as virtual serial and not pure USB as in hid I would,nt have thought that [0] would be reserved, but it does make me think its worth another look. So you think that the buffer size should be at least 8 bytes?

  2. #2
    Join Date
    Sep 2009
    Posts
    755

    Default Re: USBIN pain

    I'm not sure, but I think it should be at least 8 bytes...
    If you are using CDC, than it maybe different... Best choice is that you leave USB variable, as is. Don't change anything.
    And for CDC I think that numbers of bytes in packet is not constant... It can be one, it can be more... But again, I'm not sure... I don't have much experience with usb.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170

    Default Re: USBIN pain

    Darn, can't remember where I read about buffer length. I would go with 8 bytes too.

    It's not going to affect performance much anyways.

    Robert

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133

    Default Re: USBIN pain

    I think it is in USB Complete, but have to search and the book is far away right now...

    Ioannis

  5. #5
    Join Date
    Mar 2008
    Location
    Gerogetown, Texas
    Posts
    94

    Default Re: USBIN pain

    You can have the buffer any length as long as the discriptor is set correctly.

    example

    Code:
    USBBufferSizeMax   con 16  ' maximum buffer size
    USBBufferSizeTX    con 16  ' input 
    USBBufferSizeRX    con 16  ' output

    Code:
      ; report count (number of fields)
        retlw	0x95
        retlw	0x10   ; 16 byte buffer
    it could be 3 bytes, 5 bytes as many as you want up to 64 bytes

Similar Threads

  1. What a Pain In The USB-utt
    By Cobra_Phil in forum USB
    Replies: 19
    Last Post: - 23rd January 2015, 14:15
  2. PIC18F14K50 and USBin
    By ybosco in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th November 2013, 04:52
  3. Replies: 6
    Last Post: - 4th November 2009, 13:36
  4. Usbin and hserin
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th October 2007, 15:26
  5. Need help with USBIN
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th June 2007, 18:51

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