Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20984 Discussions

How Change I2C clock on Cyclone V HPS , Terasic DE10-Nano

Yakov_E
Novice
1,392 Views

We use Terasic DE10-NANO with Linux Console (kernel 4.5), copied from DE10-Nano Kit .

It works fine.

We recently started using LTC I2C interface for our I2C device with no success.

After some investigations we found that CLOCK of LTC I2C is 400 KHz (fast mode), but our I2C device works with CLOCK 100 KHz (standard mode). This is the problem.

How we can change CLOCK of LTC I2C from 400 KHz to 100 KHz?

 

We found that we need to configure some HPS registers to enable the standard mode.

Here is the Cyclone V HPS Register Address Map of I2C: HPS  I2C Config Register

 

To change the register value we need to modify Linux device tree and insert this change into Preloader or Uboot sources and that prepare image. I not speciqalist in Linux configuration. Please help to do that.

Labels (1)
0 Kudos
1 Solution
Yakov_E
Novice
1,211 Views

Hi Tiwari

Thank you for the help

 Link that you send me, HOWTO Create a Devicetree for Cyclone V SoC, is good, but our team found a way to do that much more simpler and faster. I described all the details in attached Word document and also other files for reference.

Note: attatched .dts file ise renamed to .dts.txt to be attached here

  Bast Regards,

     Yakov

View solution in original post

0 Kudos
5 Replies
Jeet14
Employee
1,334 Views

Hi,


Are you using HPS I2C controller? If yes then what is the I2C number?


Regards

Tiwari



0 Kudos
Yakov_E
Novice
1,318 Views

Hi Tiwari,

Thank you for help. 

We use i2c of HPS.

We did different experiments: started from i2c-1 (we moved its 2 pints to JP7 connector in Quartus design).

But when we encountered with its 400 KHz clock, we tryed to use i2c-0.

In our surpizing, its real clock is 50 KHz (I have photos), not 100!

This is good for us also ( less than 400), but It revealed, that i2c-0 allows one i2c address only: 0x53 (G-sensor). 

Command i2cdetect shows that too.

So, we can use any i2c-0, i2c-1, but we have not experience with device tree and have no sourses

0 Kudos
Jeet14
Employee
1,273 Views

Hi,


You can follow below link on HOWTO Create a Devicetree for Cyclone V SoC.

https://www.rocketboards.org/foswiki/Documentation/HOWTOCreateADevicetreeForCycloneVSoC#:~:text=Plug%20the%20micro%2DSD%20card,for%20that%20Linux%20kernel%20environment.


This will help to config I2C device node.


Regards

Tiwari




0 Kudos
Jeet14
Employee
1,224 Views

Hi,


I believe your inquiry has been answered. With that, now I transition this thread to community support. 

Thank you.


Best regards,

Tiwari


p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.



0 Kudos
Yakov_E
Novice
1,212 Views

Hi Tiwari

Thank you for the help

 Link that you send me, HOWTO Create a Devicetree for Cyclone V SoC, is good, but our team found a way to do that much more simpler and faster. I described all the details in attached Word document and also other files for reference.

Note: attatched .dts file ise renamed to .dts.txt to be attached here

  Bast Regards,

     Yakov

0 Kudos
Reply