Shop OBEX P1 Docs P2 Docs Learn Events
Weird serial problem — Parallax Forums

Weird serial problem

pedwardpedward Posts: 1,642
edited 2012-04-29 20:14 in Propeller 1
So I downloaded the SIDE to play with my PropKey prototype and test some of the LMM/XMM modes.

I loaded the hello.c file into the PropKey and it worked as expected.

Next I removed the waitcnt and loaded the program to see if XMMC was significantly slower than COG mode (just a quick test).

What I noticed was odd output from the serial console, I reloaded in COG memory model and got the same result:
Hello World 792
Hello World 793
World 1543
Hello World 1544
Hello World 1545
Hello World 1546

This is what I get in the serial console without the delay, and the USB activity LED flashes on and off at about .5HZ, which would suggest it's buffering large chunks of data somewhere.

To replicate the bug:
  1. Comment out "waitcnt" in hello.c
  2. Select COG memory model
  3. Hit "run" button

Comments

  • jazzedjazzed Posts: 11,803
    edited 2012-04-29 18:56
    Hi Perry.

    This is the expected behavior on Windows with the driver package I'm using in SimpleIDE. The Qt serial package in event driven mode can get into a bad state on close. I was forced to switch into polled mode. Unfortunately the Qt code can't keep up and the output gets dropped.

    There is a work-around for this using the command line propeller-load program. Get a CMD window, then cd "your path". Copy the propeller-load line from the build status and add "-t" without quotes to the command. The command line program has less overhead and will not back up (as I recall).

    Thanks,
    --Steve
    pedward wrote: »
    So I downloaded the SIDE to play with my PropKey prototype and test some of the LMM/XMM modes.

    I loaded the hello.c file into the PropKey and it worked as expected.

    Next I removed the waitcnt and loaded the program to see if XMMC was significantly slower than COG mode (just a quick test).

    What I noticed was odd output from the serial console, I reloaded in COG memory model and got the same result:
    Hello World 792
    Hello World 793
    World 1543
    Hello World 1544
    Hello World 1545
    Hello World 1546
    

    This is what I get in the serial console without the delay, and the USB activity LED flashes on and off at about .5HZ, which would suggest it's buffering large chunks of data somewhere.

    To replicate the bug:
    1. Comment out "waitcnt" in hello.c
    2. Select COG memory model
    3. Hit "run" button
  • pedwardpedward Posts: 1,642
    edited 2012-04-29 19:57
    Oh, you mean I should just use Linux then?! ;)

    I did some Qt on Linux a number of years ago. I wrote my own comms functions for it then. At the time I was planning on borrowing the comms code from MegaTune to implement on windows.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-29 20:14
    pedward wrote: »
    Oh, you mean I should just use Linux then?! ;)

    I did some Qt on Linux a number of years ago. I wrote my own comms functions for it then. At the time I was planning on borrowing the comms code from MegaTune to implement on windows.

    I'm using QextSerialPort. It works fine as event driven on Linux/Mac and is tolerable on Windows.

    The other approach is to use process pipes with the loader.
    That works great on Linux and Windows but fails miserably on the MAC.
    The look and feel is a little different though - I have it wrapped in #ifdef just in case.
Sign In or Register to comment.