CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

SPI and UART Question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cfernandez



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

SPI and UART Question
PostPosted: Tue Oct 10, 2006 10:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 10, 2006 11:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 10, 2006 11:59 am     Reply with quote

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: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Oct 10, 2006 12:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 10, 2006 1:08 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Oct 10, 2006 1:14 pm     Reply with quote

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: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Oct 10, 2006 1:25 pm     Reply with quote

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!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group