Shop OBEX P1 Docs P2 Docs Learn Events
What is better/faster? — Parallax Forums

What is better/faster?

TCTC Posts: 1,019
edited 2014-05-24 12:36 in Propeller 1
Hello all,

I have a display that I can select what serial interface I want to use.
  1. Asynchronous @115,200 baud
  2. Synchronous
  3. SPI

I am not worried about prop pin count, so I could use anyone of them. But I don't know the pros and cons of each of them. Could someone please help me out?

Thanks
TC

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-05-24 08:37
    Unless a cog is going to interact with the display in PASM, then asynchronous is probably your best option. Spin can only move bytes around so fast so it doesn't do you much good to have a data rate higher than 115,200 anyway.

    Plus, asynchronous is dead easy.

    I'd say #1 is a safe bet unless there's a good reason to use synchronous. (BTW, SPI is one of several many synchronous protocols).
  • Mike GreenMike Green Posts: 23,101
    edited 2014-05-24 08:38
    Asynchronous typically uses only one I/O pin for the data although sometimes you'd use a 2nd I/O pin for handshaking (CTS - "clear to send"). It's standardized and there's a lot of "canned" drivers that can be used. FullDuplexSerial is one and there's a 4-port serial driver as well.

    SPI is a clocked (synchronous) protocol, not really standardized, that uses two I/O pins, one for data and one for a clock. Because it's clocked, it can generally run faster than asynchronous. Because it's not standardized, you generally have to write (or modify) your own specific driver.

    Synchronous doesn't tell us much. It could mean SPI or some other "custom" protocol. It's clocked ("synchronous"), so it would run faster than an asynchronous connection
  • TCTC Posts: 1,019
    edited 2014-05-24 08:54
    Duane Degn wrote: »
    Unless a cog is going to interact with the display in PASM, then asynchronous is probably your best option. Spin can only move bytes around so fast so it doesn't do you much good to have a data rate higher than 115,200 anyway.

    Plus, asynchronous is dead easy.

    I'd say #1 is a safe bet unless there's a good reason to use synchronous.

    That is what I was assuming, but I still wanted to check. Thanks

    Mike Green wrote: »
    Asynchronous typically uses only one I/O pin for the data although sometimes you'd use a 2nd I/O pin for handshaking (CTS - "clear to send"). It's standardized and there's a lot of "canned" drivers that can be used. FullDuplexSerial is one and there's a 4-port serial driver as well.

    I can see that. My other display I used serial_ASM with no problems.
    SPI is a clocked (synchronous) protocol, not really standardized, that uses two I/O pins, one for data and one for a clock. Because it's clocked, it can generally run faster than asynchronous. Because it's not standardized, you generally have to write (or modify) your own specific driver.

    I am assuming if a driver was done in PSAM it would be faster. If so, guess that will be another project/learning added to my list of stuff to do.
    Synchronous doesn't tell us much. It could mean SPI or some other "custom" protocol. It's clocked ("synchronous"), so it would run faster than an asynchronous connection

    From the datasheet, the only difference I can find between Synchronous and SPI, is SPI has a Chip Select input.
  • Mike GMike G Posts: 2,702
    edited 2014-05-24 12:36
    Asynchronous means no synchronizing clock signal. The transmitter and receiver agree on the data rate. There's a little overhead in the data as the received needs to know how\when to synchronize to to incoming bit stream; start and stop bits. The receive must also have a clock faster than the received data bit rate as the receiver needs to know when to sample a bit to determine if it is a one or zero.

    Synchronous means clocked. The receiver knows when to sample the incoming data due to the synchronizing clock signal.

    These definitions are openly available in Wikipedia or a general internet search.

    Which is better or faster Asynchronous, SPI, or other is a bit like comparing apples and oranges.
    From the datasheet, the only difference I can find between Synchronous and SPI, is SPI has a Chip Select input.
    SPI is a type of synchronous serial interface. Synchronous is a property of the SPI protocol. There are many types of synchronous interfaces.
    I am assuming if a driver was done in PSAM it would be faster. If so, guess that will be another project/learning added to my list of stuff to do.
    Sure, because PASM is faster than SPIN but only if written well. It's certainly possible to write a serial PASM driver that is slower than its SPIN counter part.
Sign In or Register to comment.