2019-06-18 08:25 AM
I'm using the STM32H743ZI with STM32CubeMX and Autollic. with external ADC and DAC with SPI. I have 4 ADC, different CSs, connected to the SPI1 and 1 DAC to SPI2. My DAC works but I get zeros from ADCs. I tested to connected another ADC to SPI3 and disabled SPI1. I saw that when I only used the SPI3, it worked but when I enabled SPI2 (my DAC), SPI3 stopped working. I send some values to my DAC once and read the ADC inside the While(1) loop.
SPI1- mood (Recieve only Master) connected to ADCs
SPI2- mood( transmit only Master) connected to DAC.
I have already checked the spi settings for both ADC and DAC in separate test-board
Solved! Go to Solution.
2019-06-19 01:56 AM
thank you so much for the feekbacks!
Ok my problem was easily solved by settig all CS to high (inactive) in the beggining (it seems that some where low(active) as default. The daisy chained was a good idea that I didn't think about. Thanks!
2019-06-18 08:39 AM
You'd need multiple instances of the SPI structures, and move to a model which allows for parallel/concurrent use rather than sequential and blocking API calls. Putting all your interaction in a singular loop looks like the latter.
2019-06-18 12:33 PM
Well if you use 2 SPI it is probably to have then run at least one in parallel.
don't know the 3rd generation SPI IP on the H7, however would reccomend to still program it as if it was a regular 4 wire SPI and just no activate the pin you don't need (MOSI or MISO).
In the past, use interrupt + DMA ISR state machine to concurrently drive in // 3 SPI Slave devices.
Have you checked DMA channels, GPIOs, Alternates, ISRs are all there?
And by any chance, if your ADC can be daisy chained, it could reduce the NSS numbers down to one which is SW handled.
2019-06-19 01:56 AM
thank you so much for the feekbacks!
Ok my problem was easily solved by settig all CS to high (inactive) in the beggining (it seems that some where low(active) as default. The daisy chained was a good idea that I didn't think about. Thanks!