2024-11-06 08:28 AM
Hello,
I would like to use 2x AD7606 for simultaneous sampling of 8 channels, the samples shall be sent to the STM32H753 CPU that will perform some DSP calculations. This system is intended for 3-phase grid monitoring system.
I preferred the SPI mode rather than the FMC mode because it uses less pins and ~5MHz SPI CLOCK is enought to collect the 8x samples every 40µs (Sampling frequency around 40KHz)
The problem with that is that the CPU needs to start the DMA Rx on SPI lane for both AD7606 devices after receiving a falling edge on BUSY pin and send a chunk of data to the dedicated task : meaning that an IRQ shall be sent every 10µs which is quite a lot !
I am thinking of configuring the BUSY pin as External event mode with falling edge detection, the dedicated DMA + SPI (with HW NSS) shall be triggered using this event and create another event upon complete reception that will trigger a MDMA in order to copy N samples to the DTCMRAM and raise an interrupt to notify the CPU.
Is that even possible on STM32H753 ? If so, can someone give me more informations regarding the DTCMRAM + MDMA + GPIO triggering events and SPI triggered by events ?
Is there any application note or document giving all the STM32H7 details ?
2024-11-06 04:07 PM
Hi,
My first question is - how efficient is the code you write - using an OS, HAL, LL, can you write your own interrupt handlers?
Kind regards
Pedro
2024-11-06 11:11 PM
Hello @PGump.1 ,
Yes I can write my own interrupt handler to start the SPI RX DMA within the ISR.
I am just wondering if it can be done using events in order to avoid having CPU doesn't receive 60 000 IRQ/Second regarding this communication alone.
2024-11-06 11:31 PM
Hi,
Possibly. Unfortunately, I find the documentation from ST on the Event plumbing through their devices very poor.
Timers and EXTI seem to be well connected, SPI seems to be the least connected. ST's handling of NSS for SPI is poor as well...
Perhaps feeding the SPI CLK into a Timer can trigger the Events you need...
I hope that helps.
Kind regards
Pedro
2024-11-06 11:41 PM - edited 2024-11-06 11:42 PM
Hi @PGump.1 ,
Thanks foryour reply.
WHat about using FMC + DMA with the AD7606 ?
I said previously that It needs a lot of pins but at this point i'd rather have that than 60k IRQ/second.
Is the AD7606 compatible with the STM32H7 using parallel interface ?
Thanks,
2024-11-10 04:04 PM
Hi,
I don't think that FMC is going to be your solution.
You need to draw up a HW flow / State Machine.
I still think that Timers are a good starting point, as they can connect to Pins, DMA, Events, and Triggers...
The STM32H7 is pretty quick - I wouldn't rule out an efficient IRQ handler in Assembler...
I hope that helps.
Kind regards
Pedro