AD7793 Spidev1.1 increasing delay length

Mar 05, 2010 1 Replies

Hello All!



I'm trying to read back all of the registers from a AD7793 which is on a custom board. I've been successful reading back most of them, however, on a couple of registers bit 1 is incorrect.



For example, when I read back the AD7793 identification register I get back a 0x4A instead of a 0x4B. Sometimes, sporadically I'll read the correct value but not always. It seems as if I do a few reads before reading the ID register I get back the correct value.



This seems to have something to do with timing so I'm wondering if I can increase the delay length? I know there is a parameter delay_usecs in the spi_ioc_transfer struct but I would like to use the half duplex read and write()'s to access my A/D. Any ideas how I can do this? A code snippet would be an immense help.



Thanks!


Have you checked that your SPI is configured properly? As in clock polarity and phase? You might be reading the data while the bits are in transition. Check the AD7793 spec, and compare with what you're doing (I like to verify with an oscilloscope, too).

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required