Read all channels from AD7927

Hi friends.

I try AD7927 and read from 1 channel is OK.

But ho to read all channel without stop communication?

How to set SEQ and SHADOW? And what I must send to device?

For example:

Register value is: 0xC3B

I send this value to device.

Send new value: 0x43B

After this I send a new value: 0xC33

And Start read 8 bytes?

How to scan 8 channels without stop communication?

  • 0
    •  Analog Employees 
    on Jun 6, 2018 1:29 AM

    Hi jirkaj4,

       I There are several ways to read on more channels of the AD7927. One way is to write on the ADD[2:0] bits. Writing on this bits allows the AD7927 what channel to read on the next CS falling. Please refer to Table 7 of the datasheet for details. This means every CS falling , a write to the DIN is required with SEQ=SHADOW=0.

     Another would be writing to DIN with SEQ=0 and SHADOW=1. After the write, the next CS falling edge is a 16 bit data for the SHADOW register. Each bit represent a channel from Vin 0 to Vin7, and the 8 MSB bits are for the first sequence of channels and the 8 LSB are for the second sequence. a 1 on the bit means channel will be read. This is best describe in table 10 of the datasheet, SHADOW register section. The sequence will be in ascending order.

      When SEQ=1 and SHADOW=0, same with the previous but with this setting, a write to the other register is allowed via DIN.

    Regards,

    Jonathan

  • Ok. Now I have got function read from X channel:

    MP_AD7927__SPI_read(SPI1, (control_register << AD7927_SHIFT_REGISTER), 0x0000, 2, return_val);

    Where:

    • SPI1 - number of SPI
    • control_register - settings ADC and shift it
    • 0x0000 - dummy cycle to read from ADC
    • 2 - number of bytes for SPI communication
    • return_val - return value of ADC

    And control register set is here:

    control_register =
             AD7927_WRITE_CR \
           | AD7927_SEQUENCE_WRITE(AD7927_SEQUENCE_OFF) \
           | AD7927_CHANNEL_WRITE(AD7927_ADC_INPUT_CHANNEL0) \
           | AD7927_PM_MODE_WRITE(AD7927_ADC_MODE_NORMAL_OPERATION) \
           | AD7927_CODING;

    Here is screen shot. It is OK:

    MP_AD7927__SPI_read(SPI1, (control_register << AD7927_SHIFT_REGISTER), 0x0000, 2, return_val);

    And I'm working on AD7927_SEQUENCE_CHANNEL now.

    Is there any picture of communication with settings AD7927_SEQUENCE_CHANNEL (SEQ = 0, SHADOW = 1)??

    I'm looking for in datasheet, and I don't understand it.  

  • 0
    •  Analog Employees 
    on Aug 24, 2018 12:51 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin