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

Problem with SPI interface to the TSC2000

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



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

Problem with SPI interface to the TSC2000
PostPosted: Sat Apr 12, 2008 4:08 am     Reply with quote

Hi…


I am trying to interface a TSC2000 chip to my PIC 16F877A microcontroller but I have got a problem with the SPI. I have set up the SPI interface (setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_64 ); ) and I have connect the wires properly. The problem is that I cannot sent the commands that I want thru the SPI using the spi_write() command.


I was trying to find what is happening and I run the debugger from MpLab. I have found that the SSPBUF (the buffer that sends the commands) is always loaded with the FF value independent of the value that I want to write. If I connect the SDI pin (data in) and the SDO pin (data out) of the PIC together then I am having the data that I want but is I connect the pins to the TSC2000 I always have got FF.


I am sure that I have made the interface between the PIC and the TSC2000 without any problem (I am not so sure about the SS pin, but I think that is OK). What I have to do to solve the problem?
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