Post Go back to editing

Reading the AD9959 registers

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!