"Adafruit_SPIFlash.h": Change SPI speed ATSAMD21

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Tipo1000
 
Posts: 7
Joined: Thu Aug 19, 2021 11:04 am

"Adafruit_SPIFlash.h": Change SPI speed ATSAMD21

Post by Tipo1000 »

Hi,

I'm trying to change SPI clock speed from default 12MHz to 1MHz. How can I do this with ATSAMD21? I'm using Adafruit_SPIFlash library.

I tried what is below but it didn't work with ATSAMD21. With older Arduinos this was trivial I think...

Code: Select all

SPI.beginTransaction(SPISettings(1000000, MSBFIRST, SPI_MODE0));  //This doesn't do anything
if (!flash.begin()) {
  Serial.println("Error, failed to initialize flash chip!");
  while(1) yield();
}

Code: Select all

 SPI.setClockDivider(4); //Tried different dividers but code just hangs...
if (!flash.begin()) {
  Serial.println("Error, failed to initialize flash chip!");
  while(1) yield();
}
Thanks,
Tipo

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

Return to “Arduino”