Funny pin behavior with RF24 and Teensy 4.1

Status
Not open for further replies.

kdharbert

Well-known member
I'm using a version of the RF24 library. It seems that pins are being put into a 'funny' mode by the library. I have the SCK pin configured for output via pinMode. I can do a write\read cycle and output makes sense. If I call the begin function on the RF24 object, the write\read cycle fails and the output value remains the same. If I call pinmode to reset the mode on SCK to output, I can regain proper write\read behavior, but the RF24 seems to stop working. It seems for the RF24 library, SCK would have to be configured for output. Is there another mode where the pin is in output mode but is protected from manipulation in some way?

Here's my test code:

digitalWrite(SCK_pin,1);
Serial.println(digitalRead(SCK_pin));
digitalWrite(SCK_pin,0);
Serial.println(digitalRead(SCK_pin));

radio.begin();

digitalWrite(SCK_pin,1);
Serial.println(digitalRead(SCK_pin));
digitalWrite(SCK_pin,0);
Serial.println(digitalRead(SCK_pin));
 
Status
Not open for further replies.
Back
Top