2013-02-05 12:46 AM
Hello, I have 16b parallel bus, 8MHz adc, and I need to read as fast as I can data to memory array which is 128 point long. So far I overclocked stm32f4 to 250MHz so I could do it faster. Original code is :
while(i<128)
{array[i]=GPIOC->IDR;
i++;
while((GPIOA-IDR & GPIO_Pin15)==GPIO_Pin15)
while((GPIOA-IDR & GPIO_Pin15)! =GPIO_Pin15)
}
Can I do it faster with fsmc or dma ? A15 is clk from adc, sync should be done on rising edge
2013-02-05 08:10 AM
The STM32's are not well architected to handle such interfaces, can you mitigate the interface through a buffer, FIFO, or FPGA?
Say a FIFO with a half-full line that can generate an EXTI interrupt and you can burst read half the words in the FIFO?2013-02-05 10:02 AM
i tried to use clk as interrupt signal, it didn't helped.
it looks like it reads data bit by bit to memory, not all 16b at once. Compiler looks like efficient, it can toggle gpio bit at 1/2 cpu speed (prescaler = 2 ) Does any FSMC mode use CLK, so it could be moved to memory by dma ?2013-02-05 10:48 AM
The FSMC doesn't provide for an inbound interface like you are describing, it can fetch data very quickly but via the outbound signals from the STM32, and you would need some external logic to mitigate the differences in the interfaces.
Interrupts probably won't work/help because of the latency and speed. A buffer/latch may permit you to tolerate this, but might not give you the bandwidth required. You need a hardware REQ/ACK type interface, the STM32 does not have one. You might be able to fashion something with a TIM input, and a DMA request, but it would require a bunch of time to investigate and test.2013-02-06 09:29 AM
Not REQ/ACK, but the camera interface present in some models is a form of parallel slave interface. It *may* fit the OP's purpose.
I has its specifics, though. JW