Loading ...
Sorry, an error occurred while loading the content.

Serial port 'write' LB implementation detail question

Expand Messages
  • Brian Schmalz
    Carl, Whenever I use the print #comprt, MyString$ command, I can see (by using Portmon) that liberty.exe is only writing one byte at a time to the serial port
    Message 1 of 2 , Jul 3, 2005
    • 0 Attachment
      Carl,
      Whenever I use the

      print #comprt, MyString$

      command, I can see (by using Portmon) that liberty.exe is only writing one byte at a time to the serial port (i.e. each IRP_MJ_WRITE command to the port only contains one byte of data). Why not just write the entire string using one IRP_MJ_WRITE call?

      The reason this matters to me is that I'm using LB as the PC front end of a generic USB peripheral based upon the Microchip PIC18F4550 microcontroller and their example CDC (i.e. virtual COM port) demo code. Because LB only writes one byte at a time, Windows creates a separate USB packet for _each_byte_, and thus restricts my maximum bandwidth significantly. If you were to write the entire string as one write call, Windows would (I believe) put the entire string into a USB packet, or at the most break it up into 64 byte chunks (maximum USB packet payload size). This would really help out with throughput to USB peripherals.

      Any idea if this is possible?


      As always, very thankful for LB,
      *Brian
    • carlgundel
      ... only writing one byte at a time to the serial port (i.e. each IRP_MJ_WRITE command to the port only contains one byte of data). Why not just write the
      Message 2 of 2 , Jul 4, 2005
      • 0 Attachment
        --- In libertybasic@yahoogroups.com, "Brian Schmalz" <brian.s@l...>
        wrote:
        > Carl,
        > Whenever I use the
        >
        > print #comprt, MyString$
        >
        > command, I can see (by using Portmon) that liberty.exe is
        only writing one byte at a time to the serial port (i.e. each
        IRP_MJ_WRITE command to the port only contains one byte of data).
        Why not just write the entire string using one IRP_MJ_WRITE call?
        >
        > The reason this matters to me is that I'm using LB as the PC
        front end of a generic USB peripheral based upon the Microchip
        PIC18F4550 microcontroller and their example CDC (i.e. virtual COM
        port) demo code. Because LB only writes one byte at a time, Windows
        creates a separate USB packet for _each_byte_, and thus restricts my
        maximum bandwidth significantly. If you were to write the entire
        string as one write call, Windows would (I believe) put the entire
        string into a USB packet, or at the most break it up into 64 byte
        chunks (maximum USB packet payload size). This would really help out
        with throughput to USB peripherals.
        >
        > Any idea if this is possible?
        >
        >
        > As always, very thankful for LB,

        Hi Brian,

        Let me look into that.

        -Carl
      Your message has been successfully submitted and would be delivered to recipients shortly.