News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

TE0720, Vivado 2014.1 Ref Design - I2C / RTC problem

Started by GuinnessTrinker, October 17, 2014, 01:55:40 PM

Previous topic - Next topic

GuinnessTrinker

I am a bit confused about your top.vhd to connect I2C_1 to RTC.

I tried a StandAlone configuration (no Linux).

Doing so I can't connect to RTC. What am I missing?

Xilinx "Test_Peripherals" says I2C_1 is ok.


-------------------------------------------------------------------------------
   -- CPLD I2C
   I2C1_SCL_I            => i2c1_scl_i,
   I2C1_SCL_O            => i2c1_scl_o,
   I2C1_SCL_T            => i2c1_scl_t,
   I2C1_SDA_I            => i2c1_sda_i,
   I2C1_SDA_O            => i2c1_sda_o,
   I2C1_SDA_T            => i2c1_sda_t,
-------------------------------------------------------------------------------
-- Glue logic for CPLD I2C
cpld_x0         <= not gpio_o(0);            -- I2C bus switch

cpld_x1         <= i2c1_scl_o or i2c1_scl_t;   -- CPLD <= SCL
i2c1_scl_i   <= i2c1_scl_o or i2c1_scl_t;   -- SCL feedback
cpld_x7         <= i2c1_sda_o or i2c1_sda_t;   -- CPLD <= SDA
i2c1_sda_i      <= cpld_x5;                  -- CPLD => SDA
-------------------------------------------------------------------------------
# CPLD connections
set_property PACKAGE_PIN R15 [get_ports cpld_x0]
set_property PACKAGE_PIN L16 [get_ports cpld_x1]
set_property PACKAGE_PIN P22 [get_ports cpld_x5]
set_property PACKAGE_PIN N22 [get_ports cpld_x7]
set_property IOSTANDARD LVCMOS33 [get_ports cpld_x*]
-------------------------------------------------------------------------------


Oleksandr Kiyenko

Hello,

RTC is behind I2C mux, which controlled by GPIO. If you don't need accelerometer you can connect cpld_x0 to logic '1'.
cpld_x1 is I2C clock signal SCL (you will need also return it via feedback)
cpld_x7 is SDA output and cpld_x5 SDA input
The code is very simple and should simply works (you should see RTC on address 0x6F)
I did't work with RTC using standalone app only from linux.

Best regards
Oleksandr Kiyenko

GuinnessTrinker

Hi Oleksandr Kiyenko,
thanks for your answer.


We do use PCB revision "TE0720-02".
According to "TE0720 Product Change Notifications" on
https://wiki.trenz-electronic.de/display/TE0720/PCN-20140730+TE0720-01+to+TE0720-02
there are no MEMS chips on our boards.

I have to pull cpld_x0 to net_vcc like you said.

Item #7 of the PCN says that
"I2C Multiplexing no longer needed (to select between RTC and MEMS) .."

It would be nice to have the latest schematics and the source of the PLD by hand.
Is there a chance get them?



Oleksandr Kiyenko

Hello
Latest schematics you can found at http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/documents.html
Antti already give you link to CPLD project http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0701/d2/CPLD%20Sources.html
I did some test with I2C on baremetal project and it's working, so there should be no problems to implement software part.

Best regards
Oleksandr Kiyenko

Antti Lukats

Quote from: GuinnessTrinker on October 27, 2014, 08:25:21 AM
Hi Oleksandr Kiyenko,
thanks for your answer.


We do use PCB revision "TE0720-02".
According to "TE0720 Product Change Notifications" on
https://wiki.trenz-electronic.de/display/TE0720/PCN-20140730+TE0720-01+to+TE0720-02
there are no MEMS chips on our boards.

I have to pull cpld_x0 to net_vcc like you said.

Item #7 of the PCN says that
"I2C Multiplexing no longer needed (to select between RTC and MEMS) .."

It would be nice to have the latest schematics and the source of the PLD by hand.
Is there a chance get them?

rev -02 CPLD does not use the pin "X0" at all, it is left for compatibility only.

I just checked with 2014.2 reference design, I2C works to test RTC

hwclock -w

once, after that it will start running

then if you reboot and type

hwclock -r

it shows the time that was set during first boot, that is the RTC value is really kept in RTC registers

CPLD code does nothing except converting from 3 wires to 2 wires, that is the SDA line is routed from ZYNQ to the I2C bus transparently.












GuinnessTrinker

Ok, I see.
Thanks for these replies!

Don't get me wrong, but if you cant get a simple design working and found some mystical parts around, you better ask a professional before spending a lot of time for investigation..

Thanks again.