Shop OBEX P1 Docs P2 Docs Learn Events
demo of FullDuplexSerial4port ? — Parallax Forums

demo of FullDuplexSerial4port ?

RS_JimRS_Jim Posts: 1,753
edited 2020-11-16 23:54 in Propeller 1
Does anyone have some code showing the use of this object with 3 or more ports?
Jim

Comments

  • Here are a few.
    --demo1 is a single port of the 4 opened for debug, that's all.
    --demo2 opens 3 ports, one for debug, one for receiving data from outside, and one to fake that external data by sending it from another cog "asynchronously". That uses RTS/CTS flow control between the cogs.
    -- demo4 shows the setup for an open baud mode, as you might use for multidrop or RS485 to a single rx/tx pin.

    There is a fourth file, dataIO4port.spin, that handles the numeric formatting and such for the demos.

    I should note that these are for the original program that Tim Moore developed. He included a demo with the distribution, a demo that involved communication with GPS and other devices.

    I mostly use a version of FDS4port now where I've stripped out the flow control and made other changes and bug fixes as well.

  • Thanks a bunch Tracy
    Jim
  • I need to warn anyone who wishes to use these demo filés, there are some issues impacting the compiling. The current versions of fds4port do not include number and string functions that were moved to dataio4port. example fds.dec is no longer part of the fds obj but part the dataIO4port object. After changing all references of fds.dec to dio.dec, I was able to compile and run Demo2. I did not completely debug the demo2 program, as I was looking for reference data on how to communicate from an incoming port to an outgoing port while monitoring the data with a serial terminal. The final usage maybe outputting to a 2 line display monitoring the incoming data.
    Jim
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2020-11-17 19:15
    I'm hazy on why I included that dataIO4port to handle the decimal output on demo1 and demo4, but not on demo2. All of them compiled fine on my Mac, because it found a library version of fdsrport that does natively include the Dec method. But, at least it does give you a reference. Over time, I did a lot of fiddling around with that object.

    Just to be clear, Tim's ultimate version was pcFullDuplexSerial4FC.spin. <http://forums.parallax.com/discussion/104231/multiple-port-serial-driver/p1&gt;
    Where "FC" stands for flow control. He added flow control in response to forum requests. Some time later I modified his code to the "4port" suffix, and later to the version I use now, which has the flow control stripped out. Other folks here have come up with their own versions as well. So, no wonder there is a bit of confusion!
Sign In or Register to comment.