2023-11-22 06:41 AM
Hi, I'am currently working on implementing a driver with the AD9959 with the stm32G474re discovery board, I am able to write to all 4 channel to generate any frequencies with any phases with the SPI module, but when I'm trying to read, HAL_SPI_Receive() gives back a receive buffer with zeros values, I don't understand why, is there anyone who is working on some analog device product and encoutered a similar problem, I'm using spi3 on full-duplex master mode, I probe my sck, MISO and MOSI signal, I can see that the MOSI signal have a correct behaviour, but the MISO signal nevet gets updated even though I programed the device to go on single bit 3 wire mode. Insted, the MOSI signal is changing. At first, I though that my write function was wrong, but it doesnt seems to be the case since I can disable the selected channel, and program any frequencies for each channel by having programmed the 3 wire mode, if it's not on 3 wire mode the code don't work anymore. Here is my write and read function. In the read function, the AD9959_SPI_Transfer() function is calling HAL_SPI_Transmit() to send the read byte instruction. In the read function, the received buffer, receidata is always 0.
Any help would be gladly appreciated!
2023-11-22 12:35 PM
Update, I manage to get a response to the MISO line but it is not updated to my receivdata variable for some reason
2023-11-22 12:56 PM
It's only one byte wide, if len > 1 it needs to be bigger.
Perhaps try the Transmit / Receive form?
2023-11-27 07:35 AM
Hi, I tried the Transmit/Receive form and well, the Miso line gets updated but my received buffer in the HAL_SPI_TransmitReceive() is always 0