Serin and usbout in the same code-problem?


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    May 2012
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Serin and usbout in the same code-problem?

    Thanks Charile,

    In fact I can send data thru USB using the USB CDC demo I found on this forum.

    On the other hand, isn't there any way to get serial data with Serin or Serin2 and send this data thru USB? This seems a very basic operation.

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


    Did you find this post helpful? Yes | No

    Default Re: Serin and usbout in the same code-problem?

    This may help you in setting up the USB.
    http://www.picbasic.co.uk/forum/cont...USB-SD-LOGGING
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: Serin and usbout in the same code-problem?

    Quote Originally Posted by rubisharmax View Post
    Thanks Charile,

    In fact I can send data thru USB using the USB CDC demo I found on this forum.

    On the other hand, isn't there any way to get serial data with Serin or Serin2 and send this data thru USB? This seems a very basic operation.
    The issue is that the USB is very time critical and really needs to be interrupt driven. SERIN does not use interrupts, so if you are in the middle of receiving something with SERIN, and the USB demands attention, you drop the packet, or worse, part of the packet on the floor. HSERIN can use interrupts, and so you can manage the 2 independent flows, by requesting a pause, or bouncing back and forth between the two workflows.

    Still tricky to acomplish, but at least there's hope of success. A lot depends on your application. For example, you might be able to only have information sent by request, and only request when you are sure you'll have uninterrupted time to process, and thereby get away with SERIN. But a truly asynchronous SERIN or SERIN2 and an asynchronous USB is bound to be unreliable and error prone.
    Last edited by Charlie; - 12th June 2012 at 19:16.

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