PIC18F14K50 and USBin


Results 1 to 10 of 10

Threaded View

  1. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: PIC18F14K50 and USBin

    Quote Originally Posted by ybosco View Post
    I send 3 bytes and hope that all of them would be sent into the buffer (array of 3). But really after the first received byte the program writes something to the other 2 buffer bytes and begins receiving next byte. Then adds to it 2 its own etc...
    With CDC, you have no control over how many bytes are received at a time. That depends on the operating system of the PC.
    You may get 3 bytes, or you may only get 1, you have to account for the number of bytes received.

    Your belief that USBIN is writing characters that it didn't receive, is completely incorrect.
    Those characters are already in the buffer array.
    If you clear the array before doing the USBIN you will see the difference.

    Read Post #2 again, which will fix your sample code.
    Last edited by Darrel Taylor; - 3rd November 2013 at 18:38.
    DT

Similar Threads

  1. Pic18f14k50
    By JoeyWallice in forum mel PIC BASIC
    Replies: 2
    Last Post: - 23rd October 2012, 11:13
  2. Pic18f14k50
    By JoeyWallice in forum mel PIC BASIC
    Replies: 1
    Last Post: - 17th October 2012, 02:16
  3. Pic18F14K50 when?
    By Free_Flow in forum PBP Wish List
    Replies: 16
    Last Post: - 17th August 2009, 02: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 : 1

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