Connect with us

emulate SPI using UART

Discussion in 'Electronic Design' started by Kelvin Chu, May 11, 2005.

Scroll to continue with content
  1. Kelvin Chu

    Kelvin Chu Guest

    Hi Group,

    I'm a hardware newbie, so please excuse me if this seems like a dumb
    question.

    I have a UART connection here which I'm trying to use to communicate with a
    SPI port...
    Is it possible to emulate SPI using a UART port?

    I'm trying to do that, but I have read much documentation and it seems that
    it is impossible, but is there a really smart way that this can be done?

    Thanks

    Kelvin
     
  2. kelvin,
    You didn't say what processor you are trying to do this with, but the
    answer is, probably not.

    Standar UARTs have an asynchronus receive, and an asynchronus transmit,
    and maybe a few handshaking signals. SPR requires a SYNCHRONOUS clock,
    transmit, and receive, as well as a chip select signal. They are very
    different beasts. If you have spare pins, you can bit-bang an SPI in
    software easier than try to manipulate the UARTs pins to emulate an SPI
    port.

    Charlie
     
  3. Luhan Monat

    Luhan Monat Guest

    If you want to talk to a UART, either choose a micro with UART
    (PIC16F628), or bit-bang async serial data from the one you have.

    Also, you could, in theory, set the UART for 7 bit data, one stop. Then
    'fake' the start bit with a leading Zero from the SPI. The trailing One
    (past the end of the data) will be interpeted as a stop bit.
     
  4. Dave

    Dave Guest

    How would you ever get the data to agree with the SPI clock edges?
     
  5. James Meyer

    James Meyer Guest

    Where is the UART? Is it on a microprocessor? Or is it on a desktop
    computer?

    Jim
     
  6. Kelvin Chu

    Kelvin Chu Guest

    Hi guys,

    Thanks for all the replies so far, you guys have given me another direction
    to look at it from

    I'm using a CC1010 processor by Chipcon (SPI to program it)
    and a FTDI232BM (provides a USB->UART, so PC->ftdi->chipcon)

    (I know the FTDI2232C provides a SPI out front, but my school has too many
    FTDI232BMs left over :p)

    After reading some of your suggestions, I did some more research, and found
    that the FTDI232BM supports bit-bang mode !!! (I didn't think of this
    before), so I'm now looking into this direction

    Again, thanks heaps!,

    Kelvin
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-