You are here

Programming XRT8000 Clock divider using SPI-- IN PSO3 | Cypress Semiconductor

Programming XRT8000 Clock divider using SPI-- IN PSO3

Summary: 10 Replies, Latest post by rom17 on 15 Jul 2015 06:40 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
viji's picture
User
19 posts

Actually i am facing problem in configuring the XRT-8000(exar corportation)  clock divider which has a spi interface to configure the internal registers  to output a specified clock frequency... In that , the CS/ is not becoming low.. and also pls tell me what the following function does  for the spi, specifically for the spi communication.. pls explain in detail...

 

SPIM_start();

SPIM_WriteTxData(value);

 

viji's picture
User
19 posts

In the same project above mentioned, with the use of internal clock, the SCLK clock is not output at the GPIOS, can i have a example project for spi master alone....  i am facing problems using the example master slave spi communication  with the development kit,,,,

dasg's picture
Cypress Employee
730 posts

Hi Viji,

 

You can use the same example project by deleting the slave part of it.

 

SPI has 4 modes, depending on 2 bits (CPOL and CPHA). By looking at the Timing diagram of XRT8000, you can decide which mode to use.

 

Make sure that the MOSI and MISO pins are unsynchronized on the SPI master component.

SPIM_Start( ) - initializes and starts the SPI component.

SPIM_WriteTxData(value) - is a blocking statement wich writes into the Write Buffer of the SPI Master component. The data will not over-write and will wait till the previous data is sent out.

 

You will observe the clock on sclk pin whenever the WriteTx command is issued. For a duration of 1 byte, the ss (Slave Select) will also go low (since it is an active low logic).

 

 

viji's picture
User
19 posts

Hi dasg,

            Thanks for ur reply, how to read the spi slave registers, according to my SPI BASED CLOCK DIVIDER CHIP, it requires to send a 8bit value specifying read enable,and address to be read,  so that when this value for read is written to spi, on the next  (sclk) clock cycle spi value will output that value, i want to know in this case, what is API to be written for getting the data out from the SPI SLAVE.  as u told the sclk will be available only on the SpiWriteData API execution.  for ex:       i have to write like this

1. 0x00 (write enable and address value)

2. 0x30 ( data to be written)

3. 0x80 (read enable and address value)

4. next sclk register data will out from spi.

 

i am attaching the datasheet of the spi clock divider IC, pls if possible give a sample code for the above.

 

with regards,

vijay s

Attachments: 
dasg's picture
Cypress Employee
730 posts

Hi Vijay,

 

Based on your previous comment, a project is created and attached along with this mail.

Try interfacing the PSoC with XRT8000 using this code.

 

Based on your previous comment, the following is done in the project.

1) Four SPI Master writes are done.

    a) First one is for Write Enable (0x00).

    b) Second is the data to be written (0x30).

    c) Third is the read enable and address value (0x80).

    d) Fourth is a dummy byte write. This generates SCLK (clock) and SS (Slave Select) signals and the slave (XRT8000) will send the byte requested.

 

2) In the SPI protocol implementation, when the Master writes a byte into Slave, the Slave will also Write a byte into the Master's Rx Buffer (it may be a junk or valid data depending upon the command sent). Hence, the first 3 write operations will result in the accumulation of 3 junk values received from the slave. So, the first 3 read operation is done to read the junk values available in the Rx buffer. The 4th value read is the desired value and is displayed on LCD.

Attachments: 
sivananda's picture
User
59 posts

 hi viji...

      May i know from where u got XRT8000 device.........actually i also need it for my project....do you have any idea about its availability in India ?

user_81899650's picture
User
19 posts

sivananda,

It looks like it is there on digikey and they do ship to India. You can order it from them.

sivananda's picture
User
59 posts

 hi QuickSilver.........thak you very much...........hope it will be useful to me........

rom17's picture
User
91 posts

Hello Reshmi,

The PSoC Creator  3.0 SP2 (3.0.0.3140) and the miniprog3 revision B.

The picture is attached. 

I use the psoc program and have error. Check the image

 

Regards,

Romil 

user_14586677's picture
User
7648 posts

Did you make the recommended change in red by the programmer utility ?

 

Regards, Dana.

rom17's picture
User
91 posts

hi Dana,

i try and the program failed.... see the image...
 

Log in to post new comments.