You are right that it appears to need both grounds hooked up... Not sure what that is telling us...

millis: 605034
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 430E
millis: 606035
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 5F34
millis: 607036
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 5D28
millis: 608037
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 6D91
millis: 609038
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 7AE8
millis: 610039
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 61B9
millis: 611040
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 4DAD
millis: 612041
BEEF F7 F8 F9 DEAD --> Length: 5 --> PacketID: 760F
millis: 613042
643156
State: 0
Detected slaves:
Slave 1 --> ID: 0x1234
Mode: Standalone
Yes (noted in 1902) that it appeared to need both grounds@KurtE - connect the second GND [between VIN & 3.3V] as noted above by Tony - any diff?
@tonton81 - @KurtE
Here is another strange situation. I put the T4.1 as master and the T4 as slave in the setup in post #1889. Notice anything strange:
View attachment 27749
yes, your attachments never work![]()
Yes (noted in 1902) that it appeared to need both grounds
And for another strangeness if I hook up the Logic Analyzer, to the double ground one, it stops working again...
This time I put on both analog and digital capture:
View attachment 27751
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 0x3; /* LPSPI4 SCK (CLK) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_01 = 0x3; /* LPSPI4 SDI (MISO) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_02 = 0x3; /* LPSPI4 SDO (MOSI) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_00 = 0x3; /* LPSPI4 PCS0 (CS) */
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03
uint32_t fastio = IOMUXC_PAD_DSE(6) | IOMUXC_PAD_SPEED(1);
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = fastio;
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_02 = 0x3; /* LPSPI4 SDO (MOSI) */
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02
uint32_t fastio = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_SPEED(2);
//uint32_t fastio = IOMUXC_PAD_DSE(6) | IOMUXC_PAD_SPEED(1);
//uint32_t fastio = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
//Serial.printf("SPI MISO: %d MOSI: %d, SCK: %d\n", hardware().miso_pin[miso_pin_index], hardware().mosi_pin[mosi_pin_index], hardware().sck_pin[sck_pin_index]);
*(portControlRegister(hardware().miso_pin[miso_pin_index])) = fastio;
*(portControlRegister(hardware().mosi_pin[mosi_pin_index])) = fastio;
*(portControlRegister(hardware().sck_pin[sck_pin_index])) = fastio;
uint32_t fastio = IOMUXC_PAD_SPEED(3);
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = fastio;
uint32_t fastio = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02 = fastio;
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = fastio;
SPI_MSTransfer_T4_FUNC SPI_MSTransfer_T4_OPT::SPI_MSTransfer_T4() {
if ( port == &SPI ) {
_LPSPI4 = this;
_portnum = 3;
CCM_CCGR1 |= (3UL << 6);
nvic_irq = 32 + _portnum;
_VectorsRam[16 + nvic_irq] = lpspi4_slave_isr;
/* Alternate pins not broken out on Teensy 4.0/4.1 for LPSPI4 */
SLAVE_PINS_ADDR;
spiAddr[0] = 0; /* PCS0_SELECT_INPUT */
spiAddr[1] = 0; /* SCK_SELECT_INPUT */
spiAddr[2] = 0; /* SDI_SELECT_INPUT */
spiAddr[3] = 0; /* SDO_SELECT_INPUT */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 0x3; /* LPSPI4 SCK (CLK) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_01 = 0x3; /* LPSPI4 SDI (MISO) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_02 = 0x3; /* LPSPI4 SDO (MOSI) */
IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_00 = 0x3; /* LPSPI4 PCS0 (CS) */
[COLOR="#FF0000"] IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);
IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);[/COLOR]
}
}
Sorry was having dinner - just tried it but still needed the 2 gnds connected. Changing it SPI.cpp now to see what happens when you have both configured with the same DSEs and speedshere is the updated patch, red lines need to be added for testing
Code:SPI_MSTransfer_T4_FUNC SPI_MSTransfer_T4_OPT::SPI_MSTransfer_T4() { if ( port == &SPI ) { _LPSPI4 = this; _portnum = 3; CCM_CCGR1 |= (3UL << 6); nvic_irq = 32 + _portnum; _VectorsRam[16 + nvic_irq] = lpspi4_slave_isr; /* Alternate pins not broken out on Teensy 4.0/4.1 for LPSPI4 */ SLAVE_PINS_ADDR; spiAddr[0] = 0; /* PCS0_SELECT_INPUT */ spiAddr[1] = 0; /* SCK_SELECT_INPUT */ spiAddr[2] = 0; /* SDI_SELECT_INPUT */ spiAddr[3] = 0; /* SDO_SELECT_INPUT */ IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 0x3; /* LPSPI4 SCK (CLK) */ IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_01 = 0x3; /* LPSPI4 SDI (MISO) */ IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_02 = 0x3; /* LPSPI4 SDO (MOSI) */ IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_00 = 0x3; /* LPSPI4 PCS0 (CS) */ [COLOR="#FF0000"] IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3); IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3); IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);[/COLOR] } }
so it is SPI library issue? makes sense a bit since T3/LC works without additional ground?
EDIT, nope, doesn't work without the additional ground.
With the patched 3 lines it slave in works without the ground
mike, you said the grounds were joined on your board