- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using LPC55S06-EVK. I have downloaded SDK_2_12_0_LPCXpresso55S06.
As per development kit connection, I'm using the following 4 MCU pins for SPI interface.
- Pin-59: SCK SPI_FLASH_PIO0_6
Pin-55: MOSI SPI_FLASH_PIO0_3
Pin-57: CS SPI_FLASH_PIO0_4
Pin-54: MISO SPI_FLASH_PIO0_2
I'm using ADXL345 as a SPI slave device.
Question:
Which command to use for 1-byte data Write & Read?
--------------------------------------------------
SPI-Write:
Byte-0 = 0x00 (MOSI, Command/Address. Output from MCU)
Byte-1 = 0x55 (MOSI, Write 1-byte data. Output from MCU)
SPI-Read:
Byte-0 = 0x80 (MOSI, Command/Address. Output from MCU)
Byte-1 = 0xXX (MISO, Read 1-byte data. Input to MCU)
ADXL345's SPI timing waveform attached
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I recommend use an example of the SDK from the MCU [spi_interrupt_b2b_transfer_master] then in the library fsl_spi.h you can find some functions to write and read. If you are searching for a command to read and write the part of ADXL it will show it in the datasheet of this part.
In the SDK you will found some examples.
Best regards,
Pavel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I review your case, unfortunately, this does not represent an NXP issue, I suggest reviewing the datasheet from the ADXL part, I think it will show you what command is for reading and writing, or in another way contact the vendor.
Then when you have this information you can structure the frame in the example from the LPC.
Best regards,
Pavel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have already tested ADXL345 part with STM32 MCU’s using STM32CubeIDE. It works great. As I explained in the initial post. I would like to know how to write & read registers from MCUXpressoIDE using LPC55S06-EVK?
I know what data to be written from NXP MCU to access ADXL registers. Those details provided below.
--------------------------------------------------
SPI-Write:
Byte-0 = 0x00 (MOSI, Command/Address. Output from MCU)
Byte-1 = 0x55 (MOSI, Write 1-byte data. Output from MCU)
SPI-Read:
Byte-0 = 0x80 (MOSI, Command/Address. Output from MCU)
Byte-1 = 0xXX (MISO, Read 1-byte data. Input to MCU)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I recommend use an example of the SDK from the MCU [spi_interrupt_b2b_transfer_master] then in the library fsl_spi.h you can find some functions to write and read. If you are searching for a command to read and write the part of ADXL it will show it in the datasheet of this part.
In the SDK you will found some examples.
Best regards,
Pavel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, this helps..!
