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,

    we put the connector P503 to interface a Raspberry PI Model B+ to the AD9546.

    Put all the jumpers at P507 between middle pins 2, 5, 8, 11, 14 and the pins labelled COMMUNICATE VIA P503 4,7,10,13. THis connector manages the SPI or I2 C ports.

    Put the jumpers at P508 between the middle pins 2, 5, 8, 11, 14 and the pins labelled COMMUNICATE VIA P503 4, 7, 10, 13. This connector manages M0, M1, M2, M3 and M4 pins.

    Petre

Reply
  • HI,

    we put the connector P503 to interface a Raspberry PI Model B+ to the AD9546.

    Put all the jumpers at P507 between middle pins 2, 5, 8, 11, 14 and the pins labelled COMMUNICATE VIA P503 4,7,10,13. THis connector manages the SPI or I2 C ports.

    Put the jumpers at P508 between the middle pins 2, 5, 8, 11, 14 and the pins labelled COMMUNICATE VIA P503 4, 7, 10, 13. This connector manages M0, M1, M2, M3 and M4 pins.

    Petre

Children
  • Hi,

    We put the jumpers but we still could not reach to the AD9546 via I2C.

    When we check the P503 interface pinout. It's not matching with raspberry pi model B. 

    Somehow we can see the I2C device (4A, 4B, 48 ,49) adress on raspbery pi console but when we want to read temperature data, it returns nothing.

  • HI,

    I'm sorry, I was not quite correct in identifying the Raspberry PI board that can be connected to the AD9546 evaluation board. It is Raspberry PI 3 Model B+.

    We give more info about P503 here: https://wiki.analog.com/resources/eval/ad9546-user-guide#p503_connectorusb_interface

    Petre

  • Hello again,

    We use the Raspberry Pi 3 Model B+ board. When we check the P503, It is not compatible for I2C. Because It does not match with the I2C pins on 40-pin header of Raspberry Pi 3 Model B+. There is nothing on 3-5 pin numbers as you see below. It is designed for SPI communication.

    Figure1. 

    As a reference you can check the Raspberry Pi 3 Model B+ pin out.

    Figure2.

    Anyway, We have tried the communicate through the SDIO_SDA_DUT and SCLK_SCL_DUT pins(P512 header), we have changed the "0(zero) ohm" resistors and wished to see different something but nothing changed. We have changed the related pins as you can see from the datasheet as well and attached here.

    Figure3.

    Figure4.

    We have configured the M4 pin as HIGH, M5 pin as LOW and M6 pin as HIGH. I can see the address on Raspberry as 0x4A, When I want to read something It just throws the unrelevant values.
    We use the this script;

    github.com/.../adi-ad9546

    If there is anything I missed that needs to be changed, I would be happy if you could help me. Thank you.

  • HI,

    I'm sorry, but I do not support the script you found on github. I do not know who created it and what it does.

    I recommend using the evaluation software to create the AD9546 configuration you target, then use the Raspberry PI to download it into the AD9546. But you are on your own doing the Raspberry PI implementation. I do not know how to do it.

    Petre

  • I wrote a simple python script which can read the temperature sensor from 0x3003 and 0x3004 register but it gives just "0". As I said, I can see the address and reach it but I can not read the data accurately. What can be the main reason ? Are you able to check the I2C configuration which I have provided for you in my last post ? Is it totally true way to configure I2C ? 

    The python script is :

     

    import smbus2

    import time

     

    # I2C address of the AD9546 

    AD9546_I2C_ADDRESS = 0x4A 

     

    # Register addresses for temperature sensor output

    TEMP_SENSOR_REG_LOW = 0x3003

    TEMP_SENSOR_REG_HIGH = 0x3004

     

    # Initialize the I2C bus

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

     

    def read_temperature():

        try:

            # Read the lower 8 bits of the temperature value

            temp_low = bus.read_byte_data(AD9546_I2C_ADDRESS, TEMP_SENSOR_REG_LOW)

            

            # Read the upper 8 bits of the temperature value

            temp_high = bus.read_byte_data(AD9546_I2C_ADDRESS, TEMP_SENSOR_REG_HIGH)

            

            # Combine the two bytes to form the 16-bit signed temperature value

            temp_raw = (temp_high << 8) | temp_low

            

            # Convert from 16-bit signed to proper negative value if needed

            if temp_raw & (1 << 15):  # if sign bit is set

                temp_raw -= (1 << 16)

            

            # Calculate the temperature in Celsius

            temperature = temp_raw * (2 ** -7)

            

            return temperature

        

        except Exception as e:

            print(f"Error reading temperature: {e}")

            return None

     

    def main():

        while True:

            temp = read_temperature()

            if temp is not None:

                print(f"Current Temperature: {temp:.2f} °C")

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

     

    if __name__ == "__main__":

        main()