2

Try SD SPI code and ADXL345 SPI code separately and both are fine. When merge the codes, ADXL345 reading okay (not plug in MicroSD Adapter). Pin should bo okay.

Every time MicroSD is plugged (the same pin working with above code), ADXL345 reading suddenly becomes 0g, 0g, 0g. Pull it out then reading is good.

See https://forum.arduino.cc/index.php?topic=360718.0 and not sure if this is due to a hardware defect on MicroSD Adapter.

Already read many post like https://forum.sparkfun.com/viewtopic.php?f=14&t=38072 and the code produce 0g result, too.

Is it purely a hardware problem? Anyone suggest another one? Is there any way to fix in software?

More details: I am using Nodemcu v1. and arduino library. The connected pins for SD and ADXL345 both at HSPI pins. I understand Nodemcu has another SPI (or even for SD card (SD0, SD1, ...etc), but I did not see any example by using those two and integrate with ADXL345 on HSPI.

1

You may have the same problem as my answer in Multiple SPI device answer ... not all devices supports another SPI device on the same port

That is (one of the) reasons I use STM32 instead of Arduino, since the Arduinos have 'only' one SPI port.

  • 1
    And one of the many reasons I use PIC32 instead of Arduino ;) – Majenko Aug 16 '17 at 15:53
  • 1
    I actually use Nodemcu, but coding on Arduino library, not lua. And YES, I did use the MicroSD card adapter mentioned your link. It does not work with other SPI device. I will try the other SD Recorder (the bigger one) and I can take a look at STM32 and PIC32. – Paul Stewart Aug 16 '17 at 17:11
  • I found some other posts stating about this type of micro sd card adapter has a design flaw. – Paul Stewart Aug 17 '17 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.