Forum Discussion

Yakov_E's avatar
Yakov_E
Icon for New Contributor rankNew Contributor
2 years ago
Solved

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

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.

  • 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

5 Replies

  • Jeet14's avatar
    Jeet14
    Icon for Frequent Contributor rankFrequent Contributor

    Hi,


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


    Regards

    Tiwari



  • Yakov_E's avatar
    Yakov_E
    Icon for New Contributor rankNew Contributor

    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

  • Jeet14's avatar
    Jeet14
    Icon for Frequent Contributor rankFrequent Contributor

    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.



    • Yakov_E's avatar
      Yakov_E
      Icon for New Contributor rankNew Contributor

      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