Forum Discussion

DChau5's avatar
DChau5
Icon for New Contributor rankNew Contributor
6 years ago

I2C connecting

Hi everyone,

I am a newbie in FPGA-SoC field so forgive me if I ask a silly question.

So, after successfully programming first bare-metal application ( just blink the LEDs, not much ) on my Atlas-SoC board, I continue with my journey to investigate the HPS. I designed my HPS in Platform designer ( Qsys ) with some peripheral and one of them is I2C. Now, a little bit about my setting and how I understand things:

  • My I2C0 is set as HPS I/O set 1

I set it like this because as I understand, with HPS I/O set 0, the I2C is configured on pin A19 and C18 ( by checking on board schematic and Intel Pinout file ). I do not want A19 and C18 because those pins are connected to Acceleration Interface which do not connect to any header or pin so that I can connect to external I2C slave device. Therefore, I go with HPS I/O set 1 because the I2C are now on pin C19 and B16 which are connected to LTC header and I can connect to them by jumpers.

As how I usually work with FPGA, after finishing my HPS and top level entity, I go to Pin planner and start assigning appropriate pins to my signals which here, C19 and B16 to SDA and SCL. However, in the Location tab where we type the pin name, it cannot find the pins C19 and B16 although it recommend to use those in the Fitter location. So, my first assumption is that " It is connected automatically". I leave it like that and go work on preloader, uboot and I2C application. However, when check in on oscilloscope, I do not see any signal coming from those SDA and SCL, which only hold high.

My question is that

  • All the thing I have done so far is correct ?
  • Is it wrong because I do not assign the pins properly ?

If not, then I need to check the C code but well, I want to make sure that all the necessary pins are assign properly.

Thanks in advance and all support is appreciated !

8 Replies

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

      Hi el.ign,

      Thanks for you reply. I see that we can route them to FPGA domain. But I also want to know if can we access directly HPS pins without going to FPGA? As I check the schematic of Atlas-SoC board, the I2C1 is connect to LTC header while I2C0 is connected to Accelerometer and no way to access I2C0 externally. That's why I try to access I2C1 by modifying it in Qsys and connect it with jumper on LTC header.

      Can I do it as I said? Do I miss something or do I understand things in a wrong way? Or else, I will try to route it to FPGA at the end but I would like to if there is any others ways ( I'm learning ).

      By the way, thank you for the answer Mr. el.ign. You have answered almost every questions I made and I really appreciate that.

      • EBERLAZARE_I_Intel's avatar
        EBERLAZARE_I_Intel
        Icon for Regular Contributor rankRegular Contributor

        Hi,

        You mention about the Intel pinout file, can you share to me which is it?

        I'm pretty sure according to the Atlas-SoC user manual the HPS I2C0 for SCL and SDA are as C18 and A19 respectively. Have you tried to assign this before you changing them to C19 and B16?

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

    Hi everyone,

    I found out the solution. It is quite dumb mistake but I explain it here for any self-learning student, who may face this mistake, can get over it.

    First mistake: I did not assign the HPS pin properly. As a student who only worked with FPGA on Quartus, I just relied on Pin Planner without thinking. Yeah, I was dumb and I went through every tutorial without clear view. For any one who first try this, if you want to use any peripheral in HPS, you need to assign the pins with the TCL script ( you can find how to make it on internet, pretty straight forward and easy to learn ).

    Second mistake: After changing the configuration, you need to generate and boot the preloader again to you board in order to configure the peripheral, SDRAM, ...

    Third mistake: Well, it is quite personal mistake but after everything, check your slave address ! I used a wrong address ( screw me ).

    That's all. I know, they are all beginner mistakes but they are pretty hard to notice if you are self-learning student on this field. I hope I can help anyone of you learn from my mistakes and keep on with the journey.

    Cheers !

    • EBERLAZARE_I_Intel's avatar
      EBERLAZARE_I_Intel
      Icon for Regular Contributor rankRegular Contributor

      I don't think it is a dumb mistake, learning from any mistakes is also part of the learning process. :)

      Wish I could assist you better. Keep learning my friend.

      Best Regards.