SPI2_READ not working

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
edward08
Posts: 5
Joined: 14 Feb 2011 07:58

SPI2_READ not working

#1 Post by edward08 » 23 May 2011 12:24

Im trying to communicate with a slave device. Data sample in the middle and CPHA = 1 and CPOL = 1.

My initilization is:
SPI2_Init_Advanced(_SPI_MASTER,
_SPI_8_BIT,
160, _SPI_SS_DISABLE,
_SPI_DATA_SAMPLE_MIDDLE,
_SPI_CLK_IDLE_HIGH,
_SPI_ACTIVE_2_IDLE);

When I write:

Code: Select all

data = SPI2_READ(0xFF)
the value of data is always 0xFF. Thanks

Muphy
Posts: 318
Joined: 24 Feb 2008 14:05
Location: Stonehaven Scotland

Re: SPI2_READ not working

#2 Post by Muphy » 24 May 2011 08:34

What hardware are you using, what PIC and what SPI device??

M

edward08
Posts: 5
Joined: 14 Feb 2011 07:58

Re: SPI2_READ not working

#3 Post by edward08 » 24 May 2011 11:26

Im using P32MX795F512L and LTC6802-02 as my slave

Post Reply

Return to “mikroC PRO for PIC32 General”