I am pulling my hair out. I cannot get any communication from either of the 2 AD7731 ADCs I have. I am creating a new hardware rev of a water sanitation system. The OLD hardware was AD7731 and Atmel128. New hardware is AD7731 and PIC18f45k22.
I have ported the code from the atmel to the PIC. I am confident in the Code as I can talk to other SPI devices on the board just fine. As for the AD7731 I cannot get any response from the IC at all. No !RDY pin low, no ability to read the registers, etc. !RDY stays high at all times. I received the parts as Analog.com samples. The !RDY pin NEVER goes LOW. No matter how long I wait.
Here are snippets of my setup and communication code.
<code>// Initialize SPI
// MCU is running @32Mhz, divide FOSC/64 to run SPI @ 500Khz.