1 2 Previous Next 15 Replies Latest reply on Feb 27, 2015 8:31 PM by userc_41577 Go to original post
      • 15. Re: How to use SPI with ADXL345 accelerometer and PSoC 5 board

        So you switched from I2C (the easier interface) to SPI.


        For every bit (byte) the SPI interface gets one bit (byte) is returned immediately. When the very first byte is sent, the interface does not "know" yet what to answer, so a dummy byte is returned which must be skipped.
        SPI has no read command, so you must send dummy bytes to retrieve the information wanted.
        A pitfall is the select line which is automatically taken low when a byte is sent. When the buffer is empty it is taken high again. This can lead to interface errors when the byte sequence is not provided fast enough resulting in ss-line glitches.


        As I said: I2C is easier to handle.





        1 2 Previous Next