- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Currently I am trying to interface PSOC 4 ble with LIS2DH12 accelerometer. This is the first time I am using SPI interfacing.
So if you have any sample codes or any application notes would be good.
Thanks.
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From Bob in a prior post on SPI -
Reading from an SPI slave takes a little bit of getting used to.
SPI is organized, so that for every bit written to the slave a bit is returned by the slave at the very same time.
So the usual procedure to read from a slave is:
- Assert ss
- Write byte(s) to slave to indicate what the slave has to answer (commands).
- When done (transmitted), clear the recieve buffer
- Write as many dummy bytes to the slave as you want to read.
- When done (transmitted), de-assert ss
- Now your RX-buffer is filled with the required information which you can read out now.
Seems to be a bit (or byte) weired, but that's the way SPI works.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are example projects for PSoC4 and SPI. Just use the "Find Example Project" from Creator's start page. From the component's view there is not much difference between a PSoC4 and the BLE-version.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some accelerometer projects over here -
PSOC 4 element14.com
|
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Psoc 4 m kit has a program to read this kind of data.check this http://www.cypress.com/?docID=53577 look at section 4.7 for information about its accelerometer. The program also sends the data to Micrium μC/Probe .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An accelerometer sample project can be obtained from: http://www.cypress.com/?rID=111982
This uses Analog accelerometer. SPI interface should be simple. You can refer the Creator example projects to understand SPI interfaces.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From Bob in a prior post on SPI -
Reading from an SPI slave takes a little bit of getting used to.
SPI is organized, so that for every bit written to the slave a bit is returned by the slave at the very same time.
So the usual procedure to read from a slave is:
- Assert ss
- Write byte(s) to slave to indicate what the slave has to answer (commands).
- When done (transmitted), clear the recieve buffer
- Write as many dummy bytes to the slave as you want to read.
- When done (transmitted), de-assert ss
- Now your RX-buffer is filled with the required information which you can read out now.
Seems to be a bit (or byte) weired, but that's the way SPI works.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Finally I am able to interface both accelerometer and flash over the SPI bus.
Thank you very much guys for your help.