I am using ADC AD7176-2 with PIC18f.
But i don't know how to read any register from AD7176-2.
Can any one tell me the flow of commands to be send to AD7176-2 to read reg. or code samples?
We're looking in your query. We'll provide you feedback as soon as possible.
Please tell me the commands to write in AD7176-2 register also.
Hope you will reply soon.
Writing/Reading registers always begin by writing to the communications register. The timing for writing/reading from a register can be found on P. 17 of the AD7176-2 datasheet. Refer to P. 46 for the communications register details. For example, if I want to read the data register, I have to write to the communications register with 0x44 indicating that the next operation is a read of the data register. You can refer to P. 34 for continuous conversion mode which is the default on power-up. /CS must be low and the DOUT//RDY line goes low telling that a conversion is complete. Following this, write 0x44 to the ADC. Once the instruction has been sent to the ADC, then apply 24 SCLK pulses and the 24-bit data word is placed on the DOUT/RDY line.
The data register is a register that contains the ADC conversion result. By default, it is a 24-bit register but If DATA_STAT is set in the Interface Mode Register, then the Status Register is appended to this register when read, making this a 32-bit register. If WL16 is set in the Interface Mode Register, then this register is rounded to 16 bits.
In general, the read to any register, a command is written to the communications register, the address of the register to be read being part of the command written to the ADC. When the command has been written, then apply the correct number of SCLK pulses and the value contained in the register is placed on the DOUT/RDY pin. To write to a register, write to the communications, giving the address of the register to which you wish to write. Following this, load the value that is intended for the selected register.
The /CS line must be low before writing to the communications register and also when writing or reading a value to/from a register. The DOUT//RDY line indicates when conversions are available. Take note that the data length on DOUT is dependent on the register selected. It can be 8, 16, 24, or 32 bits of data.
I am have somewhat of a similar issue with AD7176-2 device.
Now, I am able to communicate with the device. I was actually able to read out the device ID (register 0x07), and the result is 0x0C94 <-- which is as expected.
I was also able to wiggle the GPIOs by writing to register 0x06 with value of 0x000F, and I can readback the register, and it does retain the value I have written.
I am however having problem with two registers.
I was try to do a write and read verify on these two register.
Write seem to proceed as planned, but when I read, the device never respond back with data.
I can capture a few scope traces later. But do you have any pointer in what could be going on?
Both of these registers are marked as RW on the datasheet. Just want to make sure I am doing this correctly.
shown above is what the lines look like when reading device ID.
This is writing to GPIO register with 0x000F
Here is the read from GPIO register, it match what I wrote
here is the write to ADCMODE Register
Here the clock stopped, because my state machine in the FPGA is waiting for RDY to go low, but it will never go low.
DOUT/RDY pin will work as a ready signal only when the serial interface is NOT in a read/write process.
So after the write to communication register indicating which register you are reading, just apply more cycles of serial clock and record whatever appears on the DOUT pin, that should be the data you want.
Retrieving data ...