Shop OBEX P1 Docs P2 Docs Learn Events
"Parallax Serial Terminal.spin" vs "FullDuplexSerialPlus.spin" vs "FullDuplexSerial.spin" — Parallax Forums

"Parallax Serial Terminal.spin" vs "FullDuplexSerialPlus.spin" vs "FullDuplexSerial.spin"

The documentation at the top of PST says:
This object is heavily based on FullDuplexSerialPlus (by Andy Lindsay), which is itself heavily based on FullDuplexSerial (by Chip Gracey).

But doesn't go into explaining what the differences are. Does anyone know, or will I need to look them over myself?

Comments

  • "Parallax Serial Terminal.spin" is an easier to use version of FDS intended for use with Parallax Serial Terminal. FDS Plus is the same as FDS, but it has more formatting methods.

    If I only need one serial port, I use FDS or FDS Plus. Otherwise, I use a four port version.
  • While we are talking about terminal displays/interfaces, I have idly wondered why so many OBEX and forum programs use FDS for terminal displays/interfaces rather than PST.
    I always find PST much easier to use, so I guess there must be other advantages to FDS for displays/terminal which I am not aware of.
    Although this observation is non-critical (both FDS and PST work very well) I would be interested to hear any expert thoughts on it.
  • "Parallax Serial Terminal.spin" is an easier to use version of FDS intended for use with Parallax Serial Terminal. FDS Plus is the same as FDS, but it has more formatting methods.

    If I only need one serial port, I use FDS or FDS Plus. Otherwise, I use a four port version.

    So quite literally the only reason to use FDS over FDS Plus is if you are using a Spin compiler without unused method removal?

    You mention PST is "easier" than FDS but that you prefer FDS. What is it that FDS does better? Faster? More flexible?
  • DavidZemon wrote: »
    The documentation at the top of PST says:
    This object is heavily based on FullDuplexSerialPlus (by Andy Lindsay), which is itself heavily based on FullDuplexSerial (by Chip Gracey).

    But doesn't go into explaining what the differences are. Does anyone know, or will I need to look them over myself?

    I was confronted with this question when I started working on the Spin Standard Library, and ended up creating com.serial and com.serial.terminal, which is what I use for new projects now; com.serial is the base serial driver and com.serial.terminal adds formatting methods.
  • Some of the early version of FDS had a small bug in the DEC method. IIRC, it didn't display one of the maximum values correctly.
  • MikeDYurMikeDYur Posts: 2,176
    edited 2016-08-20 12:59
    DavidZemon wrote: »

    You mention PST is "easier" than FDS but that you prefer FDS. What is it that FDS does better? Faster? More flexible?



    Maybe TC has a comment on this, he seems to prefer FDS over PST.

    @Duane, after a week of school, kids are not so easy to get involved with math.
  • Okay, so the DAT section of all three should be the same then?
  • The documentation in pst.spin says it should be good up to 250kbaud. The assembly looks the same as FullDuplexSerial with the exception of a few constants at the top - shouldn't make a difference I assume. I seem to be getting some corrupt data when attempting to receive data at 230,400 baud with only one stop bit. Can anyone confirm whether or not these serial drivers are capable of 8 data bits, one stop bit, no parity, continuous receive?
  • kwinnkwinn Posts: 8,697
    I have used all three at 115Kbaud, one stop bit with no errors, but it could be that one stop bit at 230Kbaud or higher may not provide enough time to transfer the byte to hub. Try it with 2 stop bits to see if the errors go away.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-08-21 20:15
    kwinn wrote: »
    I have used all three at 115Kbaud, one stop bit with no errors, but it could be that one stop bit at 230Kbaud or higher may not provide enough time to transfer the byte to hub. Try it with 2 stop bits to see if the errors go away.

    I'm using propeller-load within CLion, and CLion is buffering my input (so propeller-load receives an entire line of input at once, therefore transmitting the minimum number of stop bits). I don't know how to configure propeller-load to increase the stop bits.
  • MikeDYur wrote: »
    DavidZemon wrote: »

    You mention PST is "easier" than FDS but that you prefer FDS. What is it that FDS does better? Faster? More flexible?

    Maybe TC has a comment on this, he seems to prefer FDS over PST.

    @Duane, after a week of school, kids are not so easy to get involved with math.

    As far as I know, PST goes only to the screen. I used Fds to talk to a lcd. And then I stole just enough to do dec and wrote my own bit-banger so as to save a cog.

  • Cluso99Cluso99 Posts: 18,069
    I modified FDX (FullDuplexSerial_rr00? in OBEX) to allow for larger buffers (configurable in source).
    There was a golden version of FullDuplexSerial but it did not have my mods.
  • Cluso99 wrote: »
    I modified FDX (FullDuplexSerial_rr00? in OBEX) to allow for larger buffers (configurable in source).
    There was a golden version of FullDuplexSerial but it did not have my mods.

    Found it: http://obex.parallax.com/object/249
  • DavidZemon wrote: »
    The documentation in pst.spin says it should be good up to 250kbaud. The assembly looks the same as FullDuplexSerial with the exception of a few constants at the top - shouldn't make a difference I assume. I seem to be getting some corrupt data when attempting to receive data at 230,400 baud with only one stop bit. Can anyone confirm whether or not these serial drivers are capable of 8 data bits, one stop bit, no parity, continuous receive?

    I extensively tested FDS several years ago. I could receive reliably over 230400, but only after commenting out the ping-pong multi tasking for transmit.

    For my project I had plenty of free pins so I used the FT245. I re-wrote FullDuplexSerial to work with the FT245 and have been *VERY* happy with the results.

    http://obex.parallax.com/object/247
  • ke4pjw wrote: »
    I extensively tested FDS several years ago. I could receive reliably over 230400, but only after commenting out the ping-pong multi tasking for transmit.

    By "commenting out the ping-pong multi tasking for transmit" you mean you changed FDS to be half-duplex, receive only? And then you were able to hit 230k?
    ke4pjw wrote: »
    For my project I had plenty of free pins so I used the FT245. I re-wrote FullDuplexSerial to work with the FT245 and have been *VERY* happy with the results.

    http://obex.parallax.com/object/247

    I'm not familiar with the FT245 so I took a quick gander at http://www.ftdichip.com/Products/ICs/FT245R.htm. So is this basically just a buffer for your UART bus, so that the Propeller doesn't have to be always-listening? Sounds like a really good idea! I may want to provide an object for that in PropWare. But, as for this thread, it only exists to help me decide which buffered UART driver PropWare should use, so the FT245 doesn't help me too much on that quest.
  • ElectrodudeElectrodude Posts: 1,657
    edited 2016-08-22 19:41
    Isn't the whole point of the Propeller that you can just have a cog do it instead of requiring external hardware to do serial buffering and such for you?

    There's fullDuplexSerial4port.spin that does 4 full duplex UARTs in a single cog. One cog can be transmitting 4 different bytes on different pins at different bauds and receiving 4 different bytes on different pins at different bauds all at the same time. It can do flow control too, but I've never needed it. I always use this object or one of its many variants when I need more than one serial port.

    Why don't you add fullDuplexSerial4port.spin or a variant of it to PropWare, but remove the transmit channels so the receive channels can do faster bauds and use your PropWare transmit code instead? Then, you can do up to four (or eight if you replace the transmit channels with more receive channels instead of just removing them) asynchronous receives, with flow control if desired, with no external hardware.
  • DavidZemon wrote: »
    By "commenting out the ping-pong multi tasking for transmit" you mean you changed FDS to be half-duplex, receive only? And then you were able to hit 230k?

    Correct. As I recall there is a set of jump returns that check to see if TX the buffer ring was updated. I commented the jmpret in the receive section, if I remember correctly.
    DavidZemon wrote: »

    I'm not familiar with the FT245 so I took a quick gander at http://www.ftdichip.com/Products/ICs/FT245R.htm. So is this basically just a buffer for your UART bus, so that the Propeller doesn't have to be always-listening? Sounds like a really good idea! I may want to provide an object for that in PropWare. But, as for this thread, it only exists to help me decide which buffered UART driver PropWare should use, so the FT245 doesn't help me too much on that quest.

    Instead of it being a serial FIFO, it is a parallel FIFO. It transfers data in parallel, so there is no bit banging. Theoretically it should be at least 8 times faster than serial. It requires 12 propeller pins for operation, so that is the down side.

    Using the FT245, I send data to the prop at 3,000,000 bps without issue. Keep in mind this is a USB device, so it is only good for talking between a PC and the prop.

    Regards,
    Terry
  • Isn't the whole point of the Propeller that you can just have a cog do it instead of requiring external hardware to do serial buffering and such for you?

    Well, yes. But the Propeller isn't so hot at doing async receive comms. Aka: receiving UART or being a slave on an SPI bus. Probably others too but those are the only two I've had to deal with. So, putting that FT245 inbetween the Prop and something else allows the Propeller to become the master, and therefore increase comm speed significantly. I think the FT245 was also a parallel interface, so that would make it even faster.
    There's fullDuplexSerial4port.spin that does 4 full duplex UARTs in a single cog. One cog can be transmitting 4 different bytes on different pins at different bauds and receiving 4 different bytes on different pins at different bauds all at the same time. It can do flow control too, but I've never needed it. I always use this object or one of its many variants when I need more than one serial port.

    Why don't you add fullDuplexSerial4port.spin or a variant of it to PropWare, but remove the transmit channels so the receive channels can do faster bauds and use your PropWare transmit code instead? Then, you can do up to four (or eight if you replace the transmit channels with more receive channels instead of just removing them) asynchronous receives, with flow control if desired, with no external hardware.

    I can definitely add the 4-port object, and probably will someday. But first, I want to start with a single-port, reasonably fast (230,400 doesn't seem too unreasonable to me), 8N1 object. If it can be configured to do more than that, great, but not required. I think these three requirements probably fill the single largest need. I know there are a lot of other needs for UART around here, but I'll bet that fills a lot of them. I thought FDS would fit this bill right out of the box, but apparently not. Do you know off the top of your head if the 4-port object would work with those requirements?

    And PropWare provides great integration with spin2cpp, which is part of the reason I'm not all too concerned with porting every object in the obex over to PropWare right away :).
  • http://tymkrs.tumblr.com/post/25786123323/noob-view-on-differences-between-two-serial <-- on very very basic differences I found between PST and FullDuplexSerial. (But it sounds like you're /way/ above my skill level :p)
Sign In or Register to comment.