Maker Pro
Maker Pro

emulate SPI using UART

K

Kelvin Chu

Jan 1, 1970
0
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
 
C

Charlie Edmondson

Jan 1, 1970
0
Kelvin said:
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
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
 
L

Luhan Monat

Jan 1, 1970
0
Charlie said:
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

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.
 
D

Dave

Jan 1, 1970
0
Kelvin said:
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?

How would you ever get the data to agree with the SPI clock edges?
 
J

James Meyer

Jan 1, 1970
0
I have a UART connection here which I'm trying to use to communicate with a
SPI port...

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

Jim
 
K

Kelvin Chu

Jan 1, 1970
0
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
 
Top