Hi,
i found, that the initialization for non-native CS is in the wrong order in (minimum) two spi libs:
Example:
if you try:
the led stays off.
this, instead works:
So.. the order of setting pin-direction and value is important.
Let's look at flash_spi.cpp:
..so this does not work, i think.
SPIFIO:
is the wrong order, too.
Maybe there are more places that need to be fixed ?
Together with missing pullups, i think this causes problems at the time when the very first initialzations are done, because more than one SPI-Device is selected.
Edit: tested with Teensy 3.1
Edit: could this be an explanation for some strange effects ?
i found, that the initialization for non-native CS is in the wrong order in (minimum) two spi libs:
Example:
if you try:
Code:
const int ledPin = 13;
void setup() {
digitalWrite(ledPin, HIGH); // set the LED on
pinMode(ledPin, OUTPUT);
}
void loop() {}
this, instead works:
Code:
const int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH); // set the LED on
}
Let's look at flash_spi.cpp:
Code:
digitalWrite(10, HIGH);
pinMode(10,OUTPUT);
// Set up the chip select pin (6)
digitalWrite(f_cs, HIGH);
pinMode(f_cs,OUTPUT);
SPIFIO:
Code:
*reg = 1;
pinMode(pin, OUTPUT);
Maybe there are more places that need to be fixed ?
Together with missing pullups, i think this causes problems at the time when the very first initialzations are done, because more than one SPI-Device is selected.
Edit: tested with Teensy 3.1
Edit: could this be an explanation for some strange effects ?
Last edited: