I have a AD5522 Evaluation Board,and it's work well on Evaluation Software 1.6.1.
Now I want to use my STM32F103ZE to control the AD5522,but I can't communicate with AD5522 via SPI.
It's Evaluation Software timing,I want to read system control register,so I click READ SYSTEM CONTROL REGISTER ,and then, the software will send 0x10000000 to AD5522,and AD5522 will return 0x00000020 to me, it's work well in anytime.
Read 0x000020 (Default value when AD5522 power on)
Now,I want to use my STM32F103ZE to read system control register,so I connect STM32F103ZE and AD5522,and remove the LK9 to disable USB function.As show below picture.
The first time,STM32F103ZE will send the command 0x10000000 to AD5522,that meaning read system control register
And then,STM32F103ZE will send 0xFFFFFF try to read data from AD5522, but the Busy pin goes low when 19th rising clock edge of SPI-CLOCK? Even so the result is 0x000020,that is true.
But the second time,STM32F103ZE send the command 0x10000000 to AD5522 again,the Busy pin goes low when 5th rising clock edge of SPI-CLOCK and 31th rising clock edge.
And then ,result is 0x000000,that's wrong(0x000020 is true).
Simulation SPI Code:
uint32_t AD5522_SPI(uint16_t bits, uint32_t dat)
uint32_t Recvice = 0;
//bits = 32 when write data to AD5522 and bits = 24 when read data from AD5522
for(i = 0; i < bits; i++)
if(dat & 0x80000000) //MSB
dat <<= 1;
Recvice <<= 1;
if(AD5522_MISO) //Read data when CLOCK falling edge.
AD5522_CLK_L; //Idle time,CLOCK is low
AD5522_MOSI_L; //Idle time,MOSI is low
This problem puzzle me three days,can you help me?
sorry for my bad English.