No announcement yet.

COM performance

  • Filter
  • Time
  • Show
Clear All
new posts

  • COM performance

    I am trying to write a serial communication routine using PowerBASIC.
    Unfortunately, I can't get any kind of reasonable performance and am
    looking for some suggestions. I am communicating with a micro-
    controller at 38400 baud. Sending a 5 byte message and receiving
    a 1 byte reply. I am only able to send about 70 messages per
    second. With the VB program I was using before, I was getting
    about 150 messages per second. When I use another microcontroller to
    operate the interface, I get over 350 messages per second. The
    theoretical maximum at this baud rate (assuming zero delays), is
    about 640 messages per second. I know I won't come close to that
    but 70 is way too slow.

    I can post code if that will help - right now I'm looking for
    some general suggestions about where to look for the problem.
    I converted to PB with the idea that it would really improve the
    performance, but I'm not seeing it at this point!


  • #2

    Better post some of the code. I've done a lot with PB and serial
    and it works just fine.

    "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers


    • #3

      are you by chance using the Powerbasic CC compiler, and PRINTing results to the screen?

      If that's the case then you can stop searching, it's the PRINT statements that's holding you back.


      [email protected]
      [email protected]


      • #4
        Chuck --

        Peter may well be right, but he neglected to add that there are things that can be done to speed up the console display. If that is, in fact, your program's problem, lots of people will chime in with suggestions.

        -- Eric

        Perfect Sync Development Tools
        Perfect Sync Web Site
        Contact Us: mailto:[email protected][email protected]</A>
        "Not my circus, not my monkeys."


        • #5

          you're right, I was in a hurry and decided to let him verify first.
          I knew lots of people would jump in once it was verified. Sorry for being short (my message that is).


          [email protected]
          [email protected]


          • #6
            The answer was similar to what has been indicated here. I was
            using EZGUI and updating a few text boxes on the screen between
            messages. Chris Boss suggested I remove all updates to the screen
            and sure enough, when I did, the rate went from 70 a second up
            to 340 per second. Still not as good as my microcontroller (which
            has no UI of course), but certainly in the ballpark I was
            looking for.

            The reason VB did better was that I was only updating 2 items on
            the screen in the VB program, versus 5 in this program. However,
            even removing all the updates from the VB program netted only a
            marginal improvement.

            Thanks everyone!