2015-11-10 02:26 AM
Hi.
I am tying to connect my STM32F4 (or F1) with external ADC. Data from ADC can be received by SPI after ADC set ''ready'' flag.So the task for controller is to read by SPI 16 bit data on external event.The easiest way I've tried is:- enable SPI in ''external event'' handler,- disable SPI in ''16 bits recieved'' after reading data.The problem is that on the high enough SPI clock frequency, SPI has time to start generating more 16 clock pulses before SPI diasbling command occurs. So I have two ''16 bits recieved '' exeptions instead of the correct one.I've got some ideas how to solve the problem, but they are little rough.Can somebody please tell me the way to solve the problem. I particularly appreciate the hardware solution of the problem. #stm32-spi2015-11-10 02:41 AM
> disable SPI in ''16 bits recieved'' after reading data.
What???
If you set SPI to transfer 16-bit, it's one single write to the data register, wait until receiver ready, then a read from data register. Read the fine manual. JW