Feather M0 Lora not able to use spi

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
blackburndefense
 
Posts: 3
Joined: Sat Nov 28, 2020 7:28 pm

Feather M0 Lora not able to use spi

Post by blackburndefense »

I am trying to use an spi chip with a feather m0 express lora. My code works fine on a non-lora feather, but there is a problem with lora already using the spi bus. I have tried setting the lora CS to high to disable it, but it is not working. How can I disable lora so that I can initialize my other chip?

Code: Select all

#include <SPI.h>
#include <SCL3300.h>

SCL3300 inclinometer;

void setup() {
  Serial.begin(115200);
  delay(3000); //SAMD boards may need a long time to init SerialUSB
  Serial.println("Reading basic Tilt values from SCL3300 Inclinometer");
  pinMode(10, OUTPUT);
  pinMode(8, OUTPUT);
  digitalWrite(8, HIGH);
  digitalWrite(10, LOW);

  if (inclinometer.begin(10) == false) {
    Serial.println("Murata SCL3300 inclinometer not connected!");
  }
}

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0 Lora not able to use spi

Post by adafruit_support_mike »

Setting GPIO-8 high will disable the radio module's SPI connection.

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

User avatar
blackburndefense
 
Posts: 3
Joined: Sat Nov 28, 2020 7:28 pm

Re: Feather M0 Lora not able to use spi

Post by blackburndefense »

Here is how I've wired it up. I used the same configuration on a feather RP2040 and it worked with no problems.
Attachments
IMG-1247-min.jpg
IMG-1247-min.jpg (861.92 KiB) Viewed 96 times
IMG-1248-min.jpg
IMG-1248-min.jpg (854.67 KiB) Viewed 96 times

User avatar
blackburndefense
 
Posts: 3
Joined: Sat Nov 28, 2020 7:28 pm

Re: Feather M0 Lora not able to use spi

Post by blackburndefense »

After additional investigation, I don't think it's the lora radio that's interferring with spi, as I'm not initializing it. I turned on debugging for the library I'm using and it's getting data, but it is getting a lot of crc errors, and errors with the wrong data being returned:

Code: Select all

Reading basic Tilt values from SCL3300 Inclinometer
FC000073 FC 0 0 73  3 0 48 86   CMD:3  DATA:48  CRC:86  calcCRC:86  crcerr:0  statuserr:1
B4002098 B4 0 20 98  FF 0 0 FF   CMD:3  DATA:0  CRC:FF  calcCRC:FF  crcerr:0  statuserr:1
B4000338 B4 0 3 38  0 0 0 F1   CMD:0  DATA:0  CRC:F1  calcCRC:F1  crcerr:0  statuserr:1
B0001F6F B0 0 1F 6F  37 0 2 E   CMD:3  DATA:2  CRC:E  calcCRC:69  crcerr:1  statuserr:1
180000E5 18 0 0 E5  3 0 0 7D   CMD:3  DATA:0  CRC:7D  calcCRC:7D  crcerr:0  statuserr:1
180000E5 18 0 0 E5  1B 0 5A 65   CMD:3  DATA:5A  CRC:65  calcCRC:65  crcerr:0  statuserr:1
180000E5 18 0 0 E5  1A C 1 6   CMD:2  DATA:C01  CRC:6  calcCRC:8C  crcerr:1  statuserr:1
40000091 40 0 0 91  3 0 48 30   CMD:3  DATA:48  CRC:30  calcCRC:86  crcerr:1  statuserr:1
40000091 40 0 0 91  3 0 48 86   CMD:3  DATA:48  CRC:86  calcCRC:86  crcerr:0  statuserr:1
I wonder if the feather m0 has some different spi config going on?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather M0 Lora not able to use spi

Post by adafruit_support_mike »

What are you using as an SPI library?

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”