2012-05-27 01:40 AM
Hi,
I am using the STM32F107 micro, and tied an SD card into its SPI3 remmaped pins. As i saw in the datasheet the RXNE bit responce after the trasnmission is at worse 1 bit clock in duration. As you can see from the DSO timmings i measured this time response to be much worse , leading into a degradation of tranfer rate significantly. Also the returns from, while () and function call _spi_read_write(data) seems also to last too much for a 72MHz proccessor clock. So i am giving you the main code , and the settings of the peripheral clocks and SPI settings also. If you have any suggestions , please feel free to reply :) P.S. I used a simple loop in the main just send a byte after checking the TXE flag , then waited for RXNE flag to get high ''1'', then opened a debug I/O pin (PD2) then closed it ''0'' then read the RX register so the RXNE bit gets cleared, and then reloop.2012-05-27 06:44 AM
You should probably review the code generated by the compiler. You don't mention which tool chain this is. APB access isn't particularly fast.
If timing is critical, I probably wouldn't bury the test with so much abstraction. DebugPinOn(); //Open Oscilloscope debug pin ''1'' datum= SPI_I2S_ReceiveData(SPI3); //Read the RX buffer data byte DebugPinOff(); //Close Oscilloscope debug pin ''0'' Becomes : #define DEBUGPINON GPIOD->BSRR = GPIO_Pin_2; #define DEBUGPINOFF GPIOD->BRR = GPIO_Pin_2; DEBUGPINON datum = SPI3->DR; DEBUGPINOFF2012-05-27 07:43 AM
2015-02-27 11:09 AM
Have you ever figured out the solution to this? Looks like I bumped into a same problem, where I have a large gap between bytes because of the RXNE delay.