Setup
- Teensy 4.1
- TLC9547 LED driver which is a slave only SPI device; its connected via SPI1 with alternative pins (MOSI1:26, SCK1:27, CS1:38); MISO is not used or connected for this component as its not needed*
- Serial1 with pins (RX1:0, TX1:1)
- Digital input switch on pin 39
All three components work fine on their own. I had to use the alternate SPI1 pins as the normal SPI1 pins conflict with Serial 1 (0, 1).
Problem
The problem comes from an unexpected place. Since the TLC9547 is a slave I didnt wire up MISO for the purpose of SPI. I used pin 39 for a digital input switch. However pin 39 is the alternate MISO for SPI1. When I created a sketch that uses all three components it craps out, the Serial1 stops working. I found that since Im using the alternate pins for SPI1, I must also set the MISO alternate pin 39 so it stops interfering with Serial1 (pin 1). But Im using pin 39 as a digital input!!
Questions
- Am I correct in my understanding of this?
- Is there any way to "turn off" MISO on SPI1 so it doesnt conflict with either Serial1 (pin 1) or my digital input (pin 39)?
- What if any side effects will happen if I just roll forward and set the alternate MISO pin 39 for SPI1 but continue to use it as a digital input? The code never reads from SPI1, but will it cause some internal issue?
- Teensy 4.1
- TLC9547 LED driver which is a slave only SPI device; its connected via SPI1 with alternative pins (MOSI1:26, SCK1:27, CS1:38); MISO is not used or connected for this component as its not needed*
- Serial1 with pins (RX1:0, TX1:1)
- Digital input switch on pin 39
All three components work fine on their own. I had to use the alternate SPI1 pins as the normal SPI1 pins conflict with Serial 1 (0, 1).
Problem
The problem comes from an unexpected place. Since the TLC9547 is a slave I didnt wire up MISO for the purpose of SPI. I used pin 39 for a digital input switch. However pin 39 is the alternate MISO for SPI1. When I created a sketch that uses all three components it craps out, the Serial1 stops working. I found that since Im using the alternate pins for SPI1, I must also set the MISO alternate pin 39 so it stops interfering with Serial1 (pin 1). But Im using pin 39 as a digital input!!
Code:
SPI1.setMOSI(this->pinDat_);
SPI1.setMISO(39); // < issue
SPI1.setSCK(this->pinClk_);
SPI1.begin();
Questions
- Am I correct in my understanding of this?
- Is there any way to "turn off" MISO on SPI1 so it doesnt conflict with either Serial1 (pin 1) or my digital input (pin 39)?
- What if any side effects will happen if I just roll forward and set the alternate MISO pin 39 for SPI1 but continue to use it as a digital input? The code never reads from SPI1, but will it cause some internal issue?