Forums - Simple SPI communication

4 posts / 0 new
Last post
Simple SPI communication
Carvrenato
Join Date: 15 Sep 17
Posts: 9
Posted: Fri, 2017-09-15 13:21

Hi, I want to send data to some shift registers, so I want to use SPI.

I have taken a look into the spi_master example and changed some things. OK, it works, but it is also a lot of code. I just want to get an array of 6 bytes and send them.

Reading the documentation it looks like it is something very simple to accomplish, SpiInit(...) with the pins I want and then SpiWrite(...) with the array address. Nothing more is mentioned as crucial for this to work. What am i missing?

CLK goes high after the SpiInit() as expected since it's SPI mode 3, but when SpiWrite() is executed nothing happens.

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, 2017-09-15 14:03

You can shift  every bit in byte and mask one bit as &0x01 and test bit 0.  send high or low based on ihat bit 

No need SPI setting. 

You can call my Skype nissim.test

  • Up0
  • Down0
Carvrenato
Join Date: 15 Sep 17
Posts: 9
Posted: Sun, 2017-09-17 08:33

Hi, Dr Nissim, thanks for your answer.

Actually, I have already developed a code that sends serial information just like that you have mentioned, and it is working fine in my device. I am making some changes on the hardware project and also revising the code and just wanted now to use the library that exists for this purpose, but the docummentation doesn't help.

I will try to figure that out for some time more, if I can't, I'll follow with my previous code.

Thank you again! 

  • Up0
  • Down0
Dr. Nissim Zur
Profile picture
Join Date: 6 Jun 16
Location: Skype: nissim.test CSR1010 External design house
Posts: 235
Posted: Sun, 2017-09-17 09:14

You can call my Skype anytime :)

  • 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.