KrisKasprzak
Well-known member
All,
I have a Teensy 4.1 and I have a W25Q64JVSSIQ-ND soldered to the bottom (larger pads). If I run LittleFS, using the example LittleFS_Program_Simple_Datalogger.ino the chip is found and I can log some data to the chip.
I have written my own database driver for such chips and when used with a Teensy 3.2 and the chip connected to SPI (1), my driver works like a million bucks. I'm trying to get the driver working with a 4.1 and this chip mounted on the bottom.
1. I'm using arduino IDE 2.1.0 and latest libraries
2. I've read as much as I can but no progress
3. I've looked at the LittleFS code but I don't see
4. pin mismatch between chip data sheet and the Teensy card BUT Little FS works
5. I *think* the bottom pads are SPI2 but SPI or SPI to objects not working with below code
I'm really stuck, any help getting the below code working is greatly appreciated.
code prints
Chip JEDEC
byteID[0] FF
byteID[1] FF
byteID[2] FF
I have a Teensy 4.1 and I have a W25Q64JVSSIQ-ND soldered to the bottom (larger pads). If I run LittleFS, using the example LittleFS_Program_Simple_Datalogger.ino the chip is found and I can log some data to the chip.
I have written my own database driver for such chips and when used with a Teensy 3.2 and the chip connected to SPI (1), my driver works like a million bucks. I'm trying to get the driver working with a 4.1 and this chip mounted on the bottom.
1. I'm using arduino IDE 2.1.0 and latest libraries
2. I've read as much as I can but no progress
3. I've looked at the LittleFS code but I don't see
4. pin mismatch between chip data sheet and the Teensy card BUT Little FS works
5. I *think* the bottom pads are SPI2 but SPI or SPI to objects not working with below code
I'm really stuck, any help getting the below code working is greatly appreciated.
Code:
// W25Q64JVSSIQ-ND
// https://www.digikey.com/en/products/detail/winbond-electronics/W25Q64JVSSIQ/5803992
#include "SPI.h"
#define SSD_PIN 51
uint8_t byteID[3];
void setup() {
Serial.begin(115200);
SPI2.setMOSI(52); // MOSI on my FLASH chip is 5
SPI2.setMISO(49); // MOSI on my FLASH chip is 2
SPI2.setSCK(53); // MOSI on my FLASH chip is 6
// chip select on my FLASH chip is 1
SPI2.begin();
// chip needs these high to work
digitalWrite(50, HIGH); // pin 3
digitalWrite(54, HIGH); // pin 7
while (!Serial) {}
SPI2.beginTransaction(SPISettings(30000000, MSBFIRST, SPI_MODE0));
digitalWrite(SSD_PIN, LOW);
delay(10);
SPI2.transfer(0x9F); // this gets the chip id (works when chip is connected to SPI1)
byteID[0] = SPI2.transfer(0x00);
byteID[1] = SPI2.transfer(0x00);
byteID[2] = SPI2.transfer(0x00);
digitalWrite(SSD_PIN, HIGH);
SPI2.endTransaction();
Serial.println("Chip JEDEC");
Serial.print("byteID[0] ");
Serial.println(byteID[0], HEX);
Serial.print("byteID[1] ");
Serial.println(byteID[1], HEX);
Serial.print("byteID[2] ");
Serial.println(byteID[2], HEX);
}
void loop() {
}
code prints
Chip JEDEC
byteID[0] FF
byteID[1] FF
byteID[2] FF