Post Go back to editing

Reading the AD9959 registers

Thread Summary

The user is facing issues reading from the AD9959 registers using the STM32 microcontroller and HAL library. Despite correctly writing to the registers and setting the CS pin low, the MISO line does not update, resulting in 0x00 reads. The user has confirmed the initialization and write functions work, but suspects a problem with the 3-wire mode configuration or the need to transfer the register length during read operations. The final answer suggests ensuring the CS pin is low and checking the STM32 initialization, while also confirming that unused pins like SDIO_3 should be grounded.
AI Generated Content
Product Number: AD9959

Hi, I'm trying to work on implementing my own driver for the AD9959 with the stm32 microcontroller. I wrote down a write function that works for now. I am able to write the wanted frequency, phase an amplitude to the respected register in order to have the right input. But for some reason , I am unable to read form the registers through my function AD9959_read() which takes on parameter the register address I want to access. Here is what am I doing for now.

1. Sending the read instruction to the device with SPI , in my case if I want to read the CFR register, it would be (10000011)

2. Set the CS pin to LOW

3. Receiving the register bytes and store it into a variable with SPI 

4. Set the CS pin to HIGH

I am using the HAL library for the SPI , so i am using the function HAL_SPI_Transmit() ad HAL_SPI_receive(). I am not sure of the step 3 and 4 since I'm not writing to the registers. For the test , I'm first doing a master reset which should put all the registers to their defautl state but when I'm trying to read for example the CSR I get 0x00 instead of 0xF0.

It seems like I'm missing something here.

Thank you for your time!