Forums - SPI reading

6 posts / 0 new
Last post
SPI reading
Shumin1992
Join Date: 6 Jun 16
Posts: 5
Posted: Fri, 2016-06-17 02:54

hello everyone,

      I am using the CSRmesh development kit, and I try to connect one of the boards to a sensor(LPS25HB), using the SPI interface. But I am reading nothing from the spi. 

      Is there any document that clairifies the detailed behaivier of the firmware SPI APIs (for example, the timing diagram) ?

       I connect the 4 lines of spi to my sensor,disconnect the SPI download line,  call the  SpiInit(), and then SpiReadByte(), but the returned value is not correct, am I missing somthing ? 

       thanks.

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Fri, 2016-06-17 06:29

See x:\CSR_uEnergy_SDK-2.5.0.20\tools\include\CSR101x_A05\spi.h for SPI settings

Working with CSR1010 need a unique setting of the CSR1010 SPI PIO.
Read the PDF in the demo apps. x:\CSR_uEnergy_SDK-2.5.0.20\apps\spi_master\CS-304125-AN_SPIMasterExampleApplicationNote.pdf 

I offer to use the I2C pins of LPS25HB to power saving and save free PIO.
It will work for you without changing any hardware PIO to LPS25HB
LPS25HB pin 2 SPI serial port clock (SPC) will be I2C I²C serial clock (SCL)
LPS25HB pin 4 SPI serial data input (SDI) will be I²C serial data (SDA)
LPS25HB pin 6 CS has to be high,  1 =  I2C communication enabled;

Define the I2C on the CSR1010 to be peripheral I2C,  And all will work in 10 min .

The slave address (SAD) associated to the LPS25HB is 101110xb. The SDO/SA0 pad can be used to modify the less significant bit of the device address. If the SA0 pad is connected to the voltage supply, LSb is ‘1’ (address 1011101b), otherwise, if the SA0 pad is connected to ground, the LSb value is ‘0’ (address 1011100b). This solution permits to connect and address two different LPS25HB devices to the same I²C lines.

See x:\CSR_uEnergy_SDK-2.5.0.20\tools\include\CSR101x_A05\i2c.h

Use extern void I2cInit(uint8 sda_pio, uint8 scl_pio, uint8 power_pio, pio_pull_mode pull);

 

  • Up0
  • Down0
Shumin1992
Join Date: 6 Jun 16
Posts: 5
Posted: Mon, 2016-06-20 05:40

Thank you for your help. I just got another question, 

Is it safe to change the PIO of the I2C interface ? Since the I2C is already connected to a EEPROM, the main storage of the system. I use the uEnergoy development board. 

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Mon, 2016-06-20 11:23
Yes, it is 100% save to work with Peripheral I2C settings. Just do not write/read to EEPROM without changing it to the default I2C settings.
  • Up0
  • Down0
sorynory
Join Date: 24 Oct 17
Posts: 2
Posted: Tue, 2017-10-24 03:57

When I see CSR8670 Block diagram, I can see i2c/SPI serial interface on it. 

Can I work the SPI serial interface in order to connect some SPI slave chip with i2c serial interface on CSR8670. ?

In manual, spi debugging interface is available with dedicated pins, but spi serial interface is not available, but Block diagram is defined i2c/SPI Master/Slave  is available. 

 

Can you explain it in detail? 

Because we shoud select a heatbeat chip about some project. 

But SPI or I2C supporting is very important for me which chip is selected? 

Please reply me urgent.

 

My CSR partner said that CSR8670 is not support SPI serial interface except SPI debugging port. 

Is it right? 

 

 

 

 

 

 

 

 

  • Up0
  • Down0
liem
Join Date: 6 Jun 16
Posts: 14
Posted: Tue, 2017-10-24 07:48

Hi Raymondchoi2009,

This forum is dedicated for the CSR101x family of chipset, please consult your local sales rep for questions concerning the CSR867x chipset.

 

@Liem

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.