Post Go back to editing

AD9546 Eval Board

Category: Hardware
Product Number: AD9546

Hi eveyone,

I have AD9546 eval board and I used to do my test via Eval Software on my PC.

Now, I would like to control the chip itself with a raspberry pi I2C interface. 

I know that AD9546 works with default SPI mode. 

How can I change this mode to I2C and reach to the AD9546 over header pins ?

What should I change on the eval board?

Thanks,

Oguzhan

Parents
  • HI,

    I always recommend to first read registers that after power up have non zero value. Like the register 0x0004 which has a default value of 0x21. So try to read this register first.

    You need to put the AD9546 in I2C mode first:

    - M4 pin to high (jumper between pins 1 and 2 at P602. I would take out R660 to avoid any contention with the U602).

    - M5 and M6 corresponding the the chip I2C address (see table 103 in the data sheet). Set jumpers at P602 accordingly. Install R521=R519=0 and take out R518 and R520. Take out R661 and R662.

    - you need to  use pin 2 (SCLK/SCL) and pin 4 (SDIO/SDA) for 2C. This means jumper SDIO at P507 between pins 4 and 5 and jumper SCLK at P507 between pins 1 and 2. One thing I realized is that these lines do not have resistor pull ups. So you may need to introduce pull up resistors on the Raspberry PI board. Put the scope probes on these lines and see how they behave before U502 (on Raspberry PI side) and after (on AD9546 side).

    See if you can read the register 0x0004 with these settings. Then you can go to writing a register and read it back.

    Petre

Reply
  • HI,

    I always recommend to first read registers that after power up have non zero value. Like the register 0x0004 which has a default value of 0x21. So try to read this register first.

    You need to put the AD9546 in I2C mode first:

    - M4 pin to high (jumper between pins 1 and 2 at P602. I would take out R660 to avoid any contention with the U602).

    - M5 and M6 corresponding the the chip I2C address (see table 103 in the data sheet). Set jumpers at P602 accordingly. Install R521=R519=0 and take out R518 and R520. Take out R661 and R662.

    - you need to  use pin 2 (SCLK/SCL) and pin 4 (SDIO/SDA) for 2C. This means jumper SDIO at P507 between pins 4 and 5 and jumper SCLK at P507 between pins 1 and 2. One thing I realized is that these lines do not have resistor pull ups. So you may need to introduce pull up resistors on the Raspberry PI board. Put the scope probes on these lines and see how they behave before U502 (on Raspberry PI side) and after (on AD9546 side).

    See if you can read the register 0x0004 with these settings. Then you can go to writing a register and read it back.

    Petre

Children
  • Hello again,

    I have tried what you said and you can follow the steps what I have done below.

     

    1- I wrote a python script which can read the value from "0x0004". The related basic python script;

    import smbus2

    import time

     

    # I2C address of the AD9546 (you need to set this according to your configuration)

    AD9546_I2C_ADDRESS = 0x48  # Replace with the correct I2C address

     

    # Register address to read (0x0004)

    TARGET_REGISTER = 0x0004

     

    # Initialize the I2C bus

    bus = smbus2.SMBus(1)  # 1 indicates /dev/i2c-1

     

    def read_single_register():

        try:

            # Read the value from the target register

            reg_value = bus.read_byte_data(AD9546_I2C_ADDRESS, TARGET_REGISTER)

            

            # Print the raw register value

            print(f"Register 0x{TARGET_REGISTER:04X}: 0x{reg_value:02X}")

            

            return reg_value

        

        except Exception as e:

            print(f"Error reading register 0x{TARGET_REGISTER:04X}: {e}")

            return None

     

    def main():

        while True:

            reg_value = read_single_register()

            if reg_value is not None:

                # Further processing can be done with reg_value if needed

                pass

            time.sleep(1)  # Wait for 1 second before reading again

     

    if __name__ == "__main__":

        main()

    2- I have checked the Raspberry Pi 3 Model B+'s pull-up resistors(GPIO2, GPIO3) and already It has as built-in on board. You can see below;

    Figure1.

    3- I have took out R518, R520, R660, R661, R662 resistors. Install R521, R519 with zero ohm.
    4- Set M4 HIGH, M5 LOW, M6 HIGH from P602 (0x4A address)
    5- Set the jumpers on P507 for SCLK and SDIO. 

    5-  Use the SCLK and SDA from P503.

    When I have check the tool i2cdetect on Raspberry Pi, I see the 0x4A and sometimes it is disappering. It does not work actually again.

  • HI,

     I cannot play with the Raspberry PI and verify you. This is something you have to do it yourself.

    Put the oscilloscope probes on all the pins (M4, M5, M6) involved in the AD9546 selecting I2C communication. See if they have the right levels that you defined.

    You then need to put the oscilloscope probes on the I2C signals as they leave the PI controller and follow them to see if and how they arrive at the AD9546. See if they match the protocol from Table 119, page 204 in the data sheet.

    Petre