In my current project I am using a STM32H723ZG Nucleo board on a custom shield PCB with two AD7380 ADC's which amount to 4 signal channels. The goal is for the next PCB revision, to read out all 4 channel in sync with a sampling rate of 100kHz to 200kHz(more if possible), do some DSP calculations each sampling cycle, run a Decimation to have an appropriate data rate to send the data out over some Bus. All on a completely integrated PCB, without a Nucleo Dev-Boad.
At the Moment the ADC's get sampled with a normal SPI connection one after the other using the SPI4 peripheral for channel "1+2" and SPI1 for channel "3+4". Both SPI peripherals run at 40MHz each with hardware chip select. Both ADC's run in "single-wire-mode" with a sampling frequency up to 100kHz, however i did manage 200kHz at some point but with almost no time to do DSP calculations.
However there are a few problems I would like to fix with the next version. The way I see it I can do a few things to improve sampling frequency and DSP plus housekeeping time.
- Use the ADC's two wire (parallel) mode. This will improve the time spent receving data also by two.
- increase clock frequency for communication at best to the ADC's maximum of 80MHz again reducing the time spent receiving data by 1/2.
- Configure the interface such that both ADC's sample and send data at the same time and not one after the other.
I don't know how to tackle these problems mainly because of my lack of knowlege about the STM32H723 and Programming skills, hence this post. I thought about a few different ways, which maybe solve some or all my issues. But there are a few unknowns for me so I will list them below.
- Use 4 SPI peripherals which give me two MISO for each ADC and configure them as one master and three slaves when receving data. When configuring the ADC's switch to two master SPI's and do it as before.
Problem:
- there will be the speedlimit of at least the max SPI clock around 133MHz/2 for SPI1 but even worse for SPI4. Tests showed I could run around 40MHz in a stable manner.
- How and when can I service the slave's SPI data when the Master SPI itself gets Interrupt triggered from a timer.
- Use the OctoSPI to receive the Data from all channels in parallel and do the bit sorting in code using masks or union bitfields. This would be able to run at much higher clockspeeds such that i can get to the 80MHz ADC limit.
Problem:
- I don't know if one can use a OctoSPI Peripheral in such a way, since all examples I could find did some conection to a flash or something.
- How to configure the peripheral eg. as dual Quad or one Octo?
- What problems come from the fact that this peripheral is in the D1 memory domain, where as the normal SPI is in the D2 domain especially if I want to use the DMA channels from D2?
- Can the OctoSPI peripheral be used alone or do i need to use two normal SPI's to configure the ADC's too?
- Someone suggested in the ST community to look at the PSSI periperal, which seems to to do just what i need. Basically a simple SPI with a configureable number of dataline's. Again with the possibility to achieve max ADC clockspeed.
Problem:
- It seems that the peripheral can not generate a clock and receive Data (correct me I simply don't know).
- In combination with the point above, do I need normal SPI's to generate the clock and to configure the ADC's here too? this would limit me again to the SPI clock limit.
- Tell me somthing even better.
Right now I am working a the new schematic and this is one of the bigger problems which I need to fix in this revision. Therefore I tried to use OctoSPI with a Nucleoboard and some wires connecting to the ADC on the shield, but with no success. I have read parts of the reference manual for the PSSI interface but not about its registers and what they do. All I found on the internet did not fit my problem so far.
All in all I think there has to be a way to make this happen with this big MCU that runs up to 550MHz, I simply don't know how because I lack the programming skill and experience with this MCU.
I hope I made my point clear and someone might be able to point me in the right direction, at best with a small example :)
Best Cem