Lykos1986
Joined: 26 Nov 2005 Posts: 68
|
Problem with SPI interface to the TSC2000 |
Posted: Sat Apr 12, 2008 4:08 am |
|
|
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? |
|