2013-02-28 05:40 AM
Hello everyone,
We are using STM32F215VGT on our project. When we send data over SPI from STM32F2, clock and data signals are not square wave. i attached clock signal. On our board, there is TXB0106 between STM32F2 and receiver. We removed TXB0106 but signals didn't change. Also output signal of TXB0106 is corrupted. I also attached SPI clock signal of STM32F2 and output signal of TXB0106. Blue signal is SPI clock signal of STM32F2 and yellow signal is output signal of TXB0106. Also we tried the codes on STM3220E eval kit but result is same. How can we fix it? Our SPI configuration is: SPI_InitTypeDef SPI_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; SPI_CLK_INIT(SPI_CLK, ENABLE); RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); GPIO_PinAFConfig(GPIOB, GPIO_PinSource10, SPI_SCK_AF); GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, SPI_MOSI_AF); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; /*!< SPI SCK pin configuration */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_Init(GPIOB, &GPIO_InitStructure); /*!< SPI MOSI pin configuration */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15; GPIO_Init(GPIOB, &GPIO_InitStructure); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_High; SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_Init(SPI, &SPI_InitStructure); SPI_Cmd(SPI, ENABLE); Thanks. #stm32f2-spi-txb01062013-02-28 07:24 AM
2013-02-28 10:29 PM
There is 5-6 cm distance between MCU and TXB0106, but we use another SPI connected device (AT45DB161). The distance between MCU and AT45DB161 is 2 cm, but signals are same.
2013-03-01 05:09 AM
If i see it right, you have a clock frequency of 4Mhz
With a typical pin capacitance of 5pF you have 15pF (uc + tbx.. + at45..), lets at another 5pf for the pcb track so we have 20pF. I thing with this capacitance, this waveform is normal and not corruptive. (As long as the SPI spec of the tbx and at45 are met) But check the OSPEEDRy I/O speed is configuration register and the I/O AC characteristics in the STM32 data sheet. This can make the pins faster. regards timon2013-03-03 11:25 PM
If you mean GPIOSpeed_TypeDef parameter on stm standart peripheral library, we set it to 100 MHz. Also we set this parameter for all values (2, 25, 50 and 100 MHZ) but there is no difference
2014-02-03 06:05 PM
That's a pretty normal waveform for that high of frequency. You've got parasitics that are creating a high time constant in reference to your clock signal. Especially at 2 cm. I would take a waveform generator and inject a signal along your line to your device and compare it to your generated SCK signal.
2014-02-03 06:48 PM
That, and people using 1X/10X probes in 1X mode, unaware of the awful bandwidth they have.