View previous topic :: View next topic |
Author |
Message |
cfernandez
Joined: 18 Oct 2003 Posts: 145
|
SPI and UART Question |
Posted: Tue Oct 10, 2006 10:50 am |
|
|
Hi,
Is possible control (send and received) a SPI device (example PIC) with the UART from a PC ??. Somebody make this?.
Thank you very much for help me!!
Best Regards, |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 10, 2006 11:47 am |
|
|
In this example, the PIC talks to the PC with RS-232.
c:\program files\picc\examples\ex_spi.c
The example file above uses this driver file to talk to the 9356 eeprom
with SPI.
c:\program files\picc\drivers\9356spi.c |
|
|
cfernandez
Joined: 18 Oct 2003 Posts: 145
|
|
Posted: Tue Oct 10, 2006 11:59 am |
|
|
Dear PCM,
I need to comunicate with a SPI device (this is not a PIC) and I need to know if is possible to make this comunication SPI over the UART from a PC, usign control signal for CLK & Data.
Over Parallel port is more easy but I dont know if possible control SPI comunication from the UART.
What you do think? |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue Oct 10, 2006 12:56 pm |
|
|
It is not possible from the UART. The Data line needs to be bidirection. Why not add a very low end PIC to handle serial to SPI translation? _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Oct 10, 2006 1:08 pm |
|
|
asmallri wrote: | It is not possible from the UART. The Data line needs to be bidirection. Why not add a very low end PIC to handle serial to SPI translation? | SPI data lines are not bidirectional, so that is not the problem. You could use RTS for generating the clock output and DTR as the data output line, for the data input line you can choose one of CTS, DSR, CD or RI. Don't forget to add a MAX232 or similar chip for the voltage level conversion.
That said, I don't think it will going to be easy and speed will be low. You are probably better of using the suggestion of a simple and cheap PIC processor. |
|
|
cfernandez
Joined: 18 Oct 2003 Posts: 145
|
|
Posted: Tue Oct 10, 2006 1:14 pm |
|
|
Hi,
I think too that is very complicate this way, is better put a little PIC or user a SPI/UART Converter, for example this http://www.nxp.com/pip/SC16IS752IBS.html
Thank you very much to all!! |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Tue Oct 10, 2006 1:25 pm |
|
|
asmallri wrote: | It is not possible from the UART. The Data line needs to be bidirection |
Asleep at the keyboard again. I was thinking I2C bus.... _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|