Roter Baron
New member
Hi,
i'm currently working on a project where the Teensy 4.1 sends data over SPI. When I reset the slave device, the master MOSI signal becomes stuck at 0 for the entirety of each transfer (and therefore the slave only receives zeros). The slave doesn't sent anything back, SS and SCK seem to work.
i'm currently working on a project where the Teensy 4.1 sends data over SPI. When I reset the slave device, the master MOSI signal becomes stuck at 0 for the entirety of each transfer (and therefore the slave only receives zeros). The slave doesn't sent anything back, SS and SCK seem to work.
Code:
#define LOOP_TIME_MS 10
#define SS_PIN 10
uint8_t tArr[] = {4,2,3,4};
#include "SPI.h"
void setup() {
pinMode(SS_PIN, OUTPUT);
digitalWrite(SS_PIN, HIGH);
SPI.begin();
}
void loop() {
uint32_t timestamp = millis();
SPI.beginTransaction(SPISettings(100000U, MSBFIRST, SPI_MODE0));
digitalWrite(SS_PIN, LOW);
SPI.transfer(tArr, 4);
digitalWrite(SS_PIN, HIGH);
SPI.endTransaction();
while(millis() - timestamp < LOOP_TIME_MS);
}