2024-11-08 02:06 PM - edited 2024-11-08 03:49 PM
There's a ghost in the machine! Look at waveforms; CS randomly goes high during HAL_TransmitReceive.
uint8_t EMIT_REG_I
( uint8_t R_I )
{
uint8_t Ret_D;
CS_0;
DC_0;
// SPI.TX
Ret_D = SPIx_Write ( R_I );
CS_1;
return Ret_D;
}
uint8_t EMIT_REG_V
( uint8_t R_V )
{
uint8_t Ret_D;
CS_0;
DC_1;
Ret_D = SPIx_Write ( R_V );
CS_1;
return Ret_D;
}
uint8_t EMIT_REG_X
( uint8_t R_I, uint8_t R_V )
{
EMIT_REG_I ( R_I );
EMIT_REG_V ( R_V );
return 0;
}
// TX Register Index and Register Index-'s Value
EMIT_REG_X ( 0xEB, 0x20 );
OS: Linux Ubuntu, Noble Numbat
WaveForms (3.23.4) and Adept installed from .deb package
Using Digilent ADP3450 to Measure SPI Protocol Logic Levels on an STM32F446RE.
SPI Baudrate is 4 MHz.
Digital GND on the ADP3450 is connected to GND on the STM32F446RE
DIO_0 is connected to SPI.CS on the STM32
DIO_1 is connected to SPI.SCK on the STM32
DIO_2 is conntected to SPI.MOSI on the STM32
DIO_3 is connected to SPI.MISO on the STM32
Using STM32 API HAL_SPI_TransmitReceive to TX Register Index and Register Value:
On Emit_X( 0xEB, 0x20 ) the logic waveform shows the following:
0xEB split apart, CS mysteriously goes high twice during TX
0x20 split apart, CS mysteriously goes high once during TX
What is the recommended fix?
2024-11-10 12:42 PM
Solved.
Spurious spikes on CS and DNC lines were caused by CrossTalk; forward and backward!