This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AFE4490 spi communication problem

Other Parts Discussed in Thread: AFE4490

Hi,

I am facing a problem with SPI communication between AFE4490 and my controller(atmega8).

spi read function always returns 0.

in BG, TX_ref pins i am getting voltages, mentioned in the datasheet

i am writing to a register(0x02) a value and reading it. spi_read bit in CONTROL0 register is enabled. but it is returning 0 whille reading.

the frame i am sending is in the format mentioned in the datasheet. ie first 8 bits address(A7-A0), 24 bits data(D23-D0).

SPISTE pin is enabled by pulling down to low. AFE_PDN, reset pins are connected to high.

Please let me know is there any mistake in the above setup.  

  • Hello Ajay,

    CONTROL0 register is a write only register.

    If you are reading the CONTROL0 register as part of your procedure, the SPI register read will not work. You will need to skip the CONTROL0 register read.

    Also ensure the data is written on the falling edge of the clock from the MCU so that the AFE captures (reads) the data on the rising edge of the clock.

    Similarly, the AFE writes the data on the falling edge of the clock and the MCU reads the data on the rising edge of the clock. (CPOL = 0 and CPHA = 0)