Skip to content

Nano 33 BLE: SPI Max Freq is 8 Mhz? #66

Open
@mjs513

Description

@mjs513

Testing on the nano 33 (ble and sense) shows the Max SPI is 8Mhz. According to the data sheet the Max clock for SPI is suppose to be 32Mhz.

Setting the clock to 30 mhz in begin transaction:

Image

Sketch used:

#include <SPI.h>
#define SPIX SPI
#define CS_PIN 6
void setup() {
  Serial.begin(115200);
  while (!Serial && millis() < 5000) {}
  Serial.print("\nBefore SPI.begin: type any character to start\n");
  while (!Serial.available()) {
    yield();
  }
  SPIX.begin();
  Serial.print("\nAfter SPI.begin: type any character to start\n");
  while (!Serial.available()) {
    yield();
  }
  SPIX.beginTransaction(SPISettings(30000000, MSBFIRST, SPI_MODE0));

  pinMode(CS_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH);
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);
  Serial.print("paused setup");
  while(Serial.read() == -1){}
  while(Serial.read() != -1) {}

}

void loop() {
  digitalWrite(CS_PIN, LOW);
  digitalWrite(LED_BUILTIN, HIGH);
  for(uint8_t i = 'a'; i <='f'; i++) SPIX.transfer(i);
  digitalWrite(LED_BUILTIN, LOW);
  digitalWrite(CS_PIN, HIGH);
  delay(50);
  //Serial.print("paused");
  //while(Serial.read() == -1){}
  //while(Serial.read() != -1) {}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions