Post Go back to editing

How to use AD7998 with BeagleBone

Hello,

I use the AD7998BRUZ-0 with a BeagleBone Black  via I2C and want to read a simple battery-value via V_in_1-Pin.

But I don't know how to configure the control register with shell-commando "i2cset". To get the digital value a have to configure the control register for the next conversion signal but I don't know how.

Thanks!

Parents
  • I tried this here without the CONVST-Signal for a 3,3 volt battery:

    root@beaglebone:/# i2cset -y 1 0x22 0x02 0x1000 w (set Config-Register for Vin_1, 0x1000 == 0x010 )

    root@beaglebone:/# i2cset -y 1 0x22 0x80 (Vin_1, Page. 29)
    root@beaglebone:/# i2cset -y 1 0x22 0x02
    (write Conf-Reg. to Adress Pointer Reg.)

    Maybe in Mode 2 it's also possible to use 0x80 / 0x82
    root@beaglebone:/# i2cget -y 1 0x22 0x00 w

    0xad09

    because we have 12 bits and LSB is first.--> result: 0x9ad=2V

    ---------------------------------------------------------------------------

    Batterie mit 1,5V

    root@beaglebone:/# i2cset -y 1 0x22 0x80
    root@beaglebone:/# i2cset -y 1 0x22 0x02
    root@beaglebone:/# i2cget -y 1 0x22 0x00 w

    0xf604

    Whats wrong with my command? Did I forget something?

Reply
  • I tried this here without the CONVST-Signal for a 3,3 volt battery:

    root@beaglebone:/# i2cset -y 1 0x22 0x02 0x1000 w (set Config-Register for Vin_1, 0x1000 == 0x010 )

    root@beaglebone:/# i2cset -y 1 0x22 0x80 (Vin_1, Page. 29)
    root@beaglebone:/# i2cset -y 1 0x22 0x02
    (write Conf-Reg. to Adress Pointer Reg.)

    Maybe in Mode 2 it's also possible to use 0x80 / 0x82
    root@beaglebone:/# i2cget -y 1 0x22 0x00 w

    0xad09

    because we have 12 bits and LSB is first.--> result: 0x9ad=2V

    ---------------------------------------------------------------------------

    Batterie mit 1,5V

    root@beaglebone:/# i2cset -y 1 0x22 0x80
    root@beaglebone:/# i2cset -y 1 0x22 0x02
    root@beaglebone:/# i2cget -y 1 0x22 0x00 w

    0xf604

    Whats wrong with my command? Did I forget something?

Children
No Data