Shop OBEX P1 Docs P2 Docs Learn Events
Is There A Real UART for the Propeller 1? — Parallax Forums

Is There A Real UART for the Propeller 1?

I have seen many examples of "UART" objects written in assembly language and SPIN for the Prop-1. But a "real" UART should offer a choice of number of data bits (usually 7, 8, or 9), number of stop bits (1, 2, or even 1.5), and parity (none, even, odd). None of the code I've examined so far provides for these options. Have I missed something?

There are 9-bit UARTs; the ninth bit used as an indicator for an address or control byte. This mode is common in some industrial controls and data-acquisition equipment.

I'd rather use a Propeller for an application that scrounge on Ebay for an 8251 chip or switch to a different MCU.

Thanks for any help or suggestions.

Comments

  • The great thing about the "virtual" UART objects is that they're easily modified to suit your specific needs. Sometime back a person needed a 9-bit (RX only) UART for a vending machine -- I was able to put that together in a matter of minutes. You're asking for something very flexible, hence the code will be a little more involved than what we typically use. Still, it's -- as my friend would say -- SMOP (a small matter of programming).
  • PublisonPublison Posts: 12,366
    edited 2017-12-13 17:22
    There have been many variants over the years. It may take a while to find one that suits your needs, but if you type "FullDuplexSerial" into the search box in the upper right, it will bring up many threads where FSD has been tweak for many applications.
  • Heater.Heater. Posts: 21,230
    What do you mean "real UART" ?

    UARTs on the Propeller are made in software. There are many examples. They can be adapted to whatever data bits, parity, stop bits you want.

    They can be adapted to do things "real UARTs" could not.

    It's not so hard.

  • This is not a problem unique to the Propeller. For example, I needed to provide an open baud mode for an Arduino in order to run one of my sensors that uses one and the same pin for receive and transmit. I was surprised to find how hard it was to find such a library object and with how much misinformation was contained in online threads. To keep with the standard objects, I ended up suggesting a simple hardware trick with a diode and resistor, a hack that also works with PC serial ports, which also do not usually provide open modes. But on the Propeller it is an easy matter, almost every object provides open baud modes starting with Chip's original fullDuplexSerial. Echoing Jon's friend, "SMOP (a small matter of programming)". What do you really need that doesn't bloat in trying to include the kitchen sink?


  • I think the idea is that the person using the code is left to determine the details. However,I see your point. Your not way out in left field,seeing code that says its a "Uart" and expecting it implement all the features that you find in a good uart chip. (Not that I mean that we are "entitled" to any expectations regarding something someone puts on the internet for free, just saying your not stark raving mad and ready for a strait jacket for asking the question)
  • By "real" I guess you mean "real limited" UART vs the real unlimited UART of the Prop that can have any word length/parity/baud rate including "DMA" to buffer directly with memory and built-in high-level protocols etc. There are thousands of chips with the former but how many can you find that can do as much as a Prop UART?

    As for 9th bit mode I use it all the time for my own one-wire/RS485 networking that also handles commands at the protocol level without disturbing or interrupting the "main CPU". Real smart UART, hey?

    The OBEX is another matter though and if you can't find the one you need then you either modify one or roll your own to suit. It's all a small matter of programming :)
  • JonnyMacJonnyMac Posts: 9,104
    edited 2017-12-13 19:25
    Been there.... New EFX-TEK designs can be configured (cut a trace, solder a jumper) for 2-wire serial to deal with the Arduino.

    Ditto on the bloat thing. If id does everything for everybody, probably nobody is going to be thrilled with it.
    This is not a problem unique to the Propeller. For example, I needed to provide an open baud mode for an Arduino in order to run one of my sensors that uses one and the same pin for receive and transmit. I was surprised to find how hard it was to find such a library object and with how much misinformation was contained in online threads. To keep with the standard objects, I ended up suggesting a simple hardware trick with a diode and resistor, a hack that also works with PC serial ports, which also do not usually provide open modes. But on the Propeller it is an easy matter, almost every object provides open baud modes starting with Chip's original fullDuplexSerial. Echoing Jon's friend, "SMOP (a small matter of programming)". What do you really need that doesn't bloat in trying to include the kitchen sink?

  • AribaAriba Posts: 2,690
    I've posted here a variation of FullDuplesSerial, that let you configurate datasize and parity-options.
    forums.parallax.com/discussion/comment/962586/#Comment_962586

    Andy
  • Thanks, Andy. I appreciate your help.
    Jon
Sign In or Register to comment.