UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer daniel.kho
Observer
7,542 Views
Registered: ‎09-19-2012

Configuring I2C Mux from PL on ZC702

Hi,

I've read the UG850 (pg. 36 onwards), the ZC702 schematic Rev 1.0, and some online documentation for the PCA9548A (http://www.ti.com/product/PCA9548A/datasheet/detailed_description#SCPS2072141).

 

However, I can't seem to figure out how we can configure the I2C mux chip to select the HDMI path. UG850 mentioned "The bus switch I2C address is 0x74 (0b01110100) and must be addressed and configured to select the desired downstream device". My intention is to select IIC_SCL/SDA_HDMI from the PL fabric from my VHDL.

 

However, I can't figure out how this addressing is being done. Is it done via the A0, A1, A2 address lines on the PCA9548A? If so, from the schematics, I can't find a connection between these address lines with the Zynq 7000 device. Am I missing something?

 

Also, the online datasheet at TI's website mentions that the device has to be addressed as follows:

 

{ Slave Address             }

1   1   1   0   A2  A1  A0    R/W

{ fixed      }{hw

                      selectable}

 

I'm getting a little confused here. Okay, the I2C address (0x74) is the internal bus addressing address of AXI used to address the PCA9548, am I presuming correct? And the Slave Address (0b1110 ----) is the internal address of the PCA9548 used to select the outputs?

 

A bit more clarification and help here would be good.

 

-dan

0 Kudos
11 Replies
Scholar u4223374
Scholar
7,538 Views
Registered: ‎04-26-2015

Re: Configuring I2C Mux from PL on ZC702

It sounds like you're not really familiar with I2C.

 

There can be lots of devices connected to one I2C bus. To talk to one of them, the I2C master (the Zynq in this case) first sends a start code (SDA line transitioning low while the SCL line stays high), then the address of that device and a bit indicating whether it wants to read from the device or write to the device. In this case you probably want to write, so you'll send the address (0x74) and a 0 for the read/write bit, so the first byte sent will be (0x74 << 1 | 0) = 0xE8. Once the device acknowledges this you can proceed to send it the data needed to select the correct downstream device.

 

The A0 ... A2 lines on the chip are used to set its I2C address, so that you can have lots of them on one bus; obviously having two or more chips on the same bus with the same address would cause confusion. On the ZC702 they're hard-wired to set the address to 0x74.

 

 

Observer daniel.kho
Observer
7,488 Views
Registered: ‎09-19-2012

Re: Configuring I2C Mux from PL on ZC702

Thanks for the tips... I must have really forgotten all about I2C - I haven't touched it for a really long time.

 

I still have more questions though. Table 1-19 of UG850 mentioned that IIC_SDA_HDMI has an address of 0b0111001 - which I believe translates to 0x72 after appending '1' to LSb. Not really sure if this is what they mean here, but after checking with ADV7511 Hardware User Guide and the ZC702 schematics, it seems 0x72 is the correct I2C address for the ADV7511 since PD is pulled low in the schematics.

 

However, my real question is what data should I send to the PCA9548 switch to select the HDMI I2C lines? My guess was that the I2C addresses in Table 1-19 should be given as the data to configure the switch. I may be wrong.

 

The following did not work:

 

start   addr      ack    data     ack     stop

'0'       0x8e               0x72                '1'

 

The PCA9548 switch did ACK my request, but I guess the data supplied may be wrong because subsequent writes to 0x72 (ADV7511) did not succeed (ACK was still HIGH).

 

I'm sure I'm missing something again.

 

-dan

0 Kudos
Xilinx Employee
Xilinx Employee
7,479 Views
Registered: ‎08-02-2011

Re: Configuring I2C Mux from PL on ZC702

Hey Dan,

 

Yeah I find those mux chips to be a bit of a pain too (who wants to spend their time trying to figure out how to set a mux... ha!).

 

So I started with some known examples talking to HDMI specifically. Like:

http://www.xilinx.com/support/documentation/application_notes/xapp1205-high-performance-video-zynq.pdf

 

And then go pull out zc702_i2c_utils.c and zc702_i2c_utils.h and use those functions and forget about it.

www.xilinx.com
Observer daniel.kho
Observer
7,469 Views
Registered: ‎09-19-2012

Re: Configuring I2C Mux from PL on ZC702

Hi bwiec,

Exactly... I think I've wasted too much time figuring out how to set the mux...

 

The example you provided seems to require the use of the PS. I prefer not to tinker too much with the C codes, and thought there was a straight-forward way to do this purely in the PL, since the ADV7511 is accessible from the PL anyway.

 

Well, I guess I'll just have to try your suggestion for now. However, do let me know if you have any examples that use only the PL. These days, I try to keep my solution (and tools and languages) as simple and minimalistic as possible.

 

-dan

0 Kudos
Visitor xiaoyao533
Visitor
7,434 Views
Registered: ‎06-20-2016

Re: Configuring I2C Mux from PL on ZC702

Hi @u4223374, I was wondering what if i want to read one device connected to I2C. Which pins should I select to read data from the device? And also if I want to put those data into BRAM in PL. does it mean that I should maybe set I2C in PS to connect EMIO so that PL can access data from I2C, therefore put data into BRAM?

 

Thanks.

0 Kudos
Xilinx Employee
Xilinx Employee
7,427 Views
Registered: ‎08-02-2011

Re: Configuring I2C Mux from PL on ZC702

Hi Dan,

 

Yes, this solution will require you to use the PS.

 

To do it purely from the PL, you'll have to implement an I2C master and write the correct registers. If you're going down that route, you'll need to take the time to learn the details anyway, as u4223374 suggested. I don't know of any examples for doing that to setup the ADV7511 on this board.

www.xilinx.com
Observer daniel.kho
Observer
7,415 Views
Registered: ‎09-19-2012

Re: Configuring I2C Mux from PL on ZC702

Hi bwiec, Yes, I already have an I2C Master in VHDL that's writing (trying to at least) to the registers of the I2C Mux and the ADV7511. I downloaded the example you mentioned, and took a look at the zc702_i2c_utils.c and zc702_i2c_utils.h you mentioned. From zc702_i2c_utils.c, I found out the I2C addresses was defined as: 60 // ZC702 I2C Addresses 61 #define ZC702_I2C_MUX_ADDR 0x74 // (PCA9458) 63 #define ZC702_HDMI_ADDR 0x39 // (ADV7511) and the I2C HDMI bus select data to give the I2C mux is 0x02: #define ZC702_I2C_SELECT_HDMI 0x02 I believe if we include the RD/nWR bit, we should be using the following I2C addresses for I2C Mux and ADV7511? I2C Mux: 0x74 sll 1 & '0' = 0xe8 ADV7511: 0x39 sll 1 & '0' = 0x72 This again confirms the ADV7511 I2C address to be 0x72. However, the ADV7511 is still not ACK-ing. This is the SDA output I see from the logic analyser: start i2c mux addr ack from data ack from repeated ack from stop mux mux data mux 0 1110 1000 0 0000 0010 0 0000 0010 0 1 (continued) start adv7511 addr NACK! data NACK! repeated NACK! stop 0 0111 0010 1 0100 0001 1 0001 0000 1 1 I received NACKs when trying to address the ADV7511... I'm not sure. I think it's either the ADV7511 not responding, or the Mux isn't enabling the ADV7511 I2C correctly. I wanted to try the downloaded example, but after trying a couple of times I gave up because I need to have the exact software versions of Vivado and SDK to get it to work without tweaking anything. I don't have much time left, so I think I'm stuck with VHDL for now. I also tried the ADV7511 example design from Analog Devices. I have problems running their Makefile, some of their Tcl scripts are giving errors even after I tweaked it to use my current Vivado version (2015.3). I gave up on that as well. -dan
0 Kudos
Observer daniel.kho
Observer
7,412 Views
Registered: ‎09-19-2012

Re: Configuring I2C Mux from PL on ZC702

[Fixed formatting]

 

Hi bwiec,
Yes, I already have an I2C Master in VHDL that's writing (trying to at least) to the registers of the I2C Mux and the ADV7511. I downloaded the example you mentioned, and took a look at the  zc702_i2c_utils.c and  zc702_i2c_utils.h you mentioned.

From zc702_i2c_utils.c, I found out the I2C addresses was defined as:
  60 // ZC702 I2C Addresses
  61 #define ZC702_I2C_MUX_ADDR   0x74 // (PCA9458)
  63 #define ZC702_HDMI_ADDR      0x39 // (ADV7511)

and the I2C HDMI bus select data to give the I2C mux is 0x02:
#define ZC702_I2C_SELECT_HDMI      0x02

I believe if we include the RD/nWR bit, we should be using the following I2C addresses for I2C Mux and ADV7511?
I2C Mux: 0x74 sll 1 & '0'  = 0xe8
ADV7511: 0x39 sll 1 & '0' = 0x72

This again confirms the ADV7511 I2C address to be 0x72. However, the ADV7511 is still not ACK-ing.
This is the SDA output I see from the logic analyser:

start     i2c mux addr     ack from    data                ack from       repeated      ack from      stop
                                         mux                                      mux         data                  mux          
0           1110 1000          0                0000 0010          0               0000 0010         0                 1

(continued)
start     adv7511 addr     NACK!        data                NACK!       repeated           NACK!      stop
0           0111 0010           1                0100 0001          1              0001 0000         1                 1

I received NACKs when trying to address the ADV7511... I'm not sure. I think it's either the ADV7511 not responding, or the Mux isn't enabling the ADV7511 I2C correctly.

I wanted to try the downloaded example, but after trying a couple of times I gave up because I need to have the exact software versions of Vivado and SDK to get it to work without tweaking anything. I don't have much time left, so I think I'm stuck with VHDL for now.

I also tried the ADV7511 example design from Analog Devices. I have problems running their Makefile, some of their Tcl scripts are giving errors even after I tweaked it to use my current Vivado version (2015.3). I gave up on that as well.

-dan

0 Kudos
Observer li_zicong
Observer
2,273 Views
Registered: ‎04-28-2017

Re: Configuring I2C Mux from PL on ZC702

Hi!

 

I got a similar problem. My development kit is ZC706 which has a same ADV7511 on board.

According to PCA9548A Product data sheet, ADV7511 Hardware Users Guide and ADV7511 Programming Guide, I want to configure I2C from PL like:

assign memory[0]  = 24'he80200;
assign memory[1]  = 24'h724110;
...

...
assign memory[15] = 24'h724c04;
assign memory[16] = 24'h724000;

 

Here are the first two configurations:

start     i2c mux addr     ack from    data                ack from            stop
                                         mux                                      mux                
0           1110 1000          0                0000 0010          0                     1

(continued)
start     adv7511 addr     ACK        data                ACK            data          ACK      stop
0           0111 0010           0         0100 0001          0          0001 0000         0           1

 

(continued)..

 

From ILA, I can see that there are always ACK after I write byte to I2C. The weird thing is LCD does not respond at all which means that ADV7511 does not work properly. Do you have any suggestion? Thanks.

 

Regards,

 

Zicong Li

0 Kudos
874 Views
Registered: ‎12-12-2017

Re: Configuring I2C Mux from PL on ZC702

 

I am also struggling the same as each person commenting.  Why does XILINX not respond with accurate answers to these problems?

 

 

If i understand correctly the issues are:

 

I2C writes to AVD7511 do not work. 

Address in ZC702 do not appear to be the same as those spelled out in PCA9548A documentation

No available low level configuration file (verilog / VHDL) for getting the ZC702 board running with HDMI output

 

The scripts I have work fine with VGA output.  When I try to configure I2C for HDMI, I am not having any luck.

 

Can anyone provide a working script for a test pattern on HDMI ?

 

 

0 Kudos
Visitor vanidasari
Visitor
518 Views
Registered: ‎11-12-2018

Re: Configuring I2C Mux from PL on ZC702

Hi,

I too looking for similar solution to configure and communicate to I2C through PL. Please provide any solutions if anyone had already resolved on this? or 

 

Xilinx,

Could you please respond to this thread so that people like me get some guide to proceed?

Thanks!

 

DV
0 Kudos