Forum Discussion

greenlantern01's avatar
greenlantern01
Icon for Occasional Contributor rankOccasional Contributor
1 month ago

LTC Connector DE10-Standard FPGA

I am trying to access the I2C bus on the LTC connector on the DE10 Standard FPGA board. 

I have enabled the i2c controllers on the HPS.

How do I now gain access to the i2c2 pins that are connected to the ltc connector from the HPS? 

I was able to communicate to the g-sensor that shares the same bus with the ltc connector, but I need to access the LTC  connector to communicate with a separate board.

 

 

 

 

 

 

I see that there is a TS3A5018 switch. Am I required to set the HPS_LTC_GPIO to low to switch communication from spi to i2c? 

Kindly help. 

9 Replies

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

    Hi greenlantern01​ ,

    Judging from the schematic , the signals on the LTC connector are multiplexed between SPI and I2C through the TS3A5018 switch which is controlled by the HPS_LTC_GPIO , you will need to set it to Low to switch to I2C2 pins

     

    Thanks

    Regards

    Kian

  • greenlantern01's avatar
    greenlantern01
    Icon for Occasional Contributor rankOccasional Contributor

    According to the schematic, since the HPS_LTC_GPIO at GPIO40, I exported the GPIO40 of HPS from the Platform designer and connected it with the HPS_LTC_GPIO in my top level design.

     

    Could you kindly guide me on how to switch it to low? 

    What would be the address of the GPIO40 that I can access from Linux to set the GPIO40 to low? 

  • greenlantern01's avatar
    greenlantern01
    Icon for Occasional Contributor rankOccasional Contributor

    I was able to figure out the way to control the HPS GPIO using the GPIO controllers. HPS_LTC_GPIO is at GPIO40 and HPS_LED is at GPIO53.

     

    GPIO[57:29] are controlled by GPIO1 Controller. Below is the address map for the GPIO controllers:

     

     

     

     

     

     

     

     

     

     

    I wrote a C program to be able to control the LED and set the HPS_LTC_GPIO to low. The code works for blinking the HPS LED. It should also work for the HPS_LTC_GPIO and I should be able to access the I2C bus on the LTC Connector, however, the HPS still communicates with the Gsensor. 

    Could you suggest what other things I could try? 

    I have attached my code to this message. 

     

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

      Sorry for the delay in responding back, is it possible for you to probe the physical HPS_LTC_GPIO/GPIO40 to see whether it toggles when your code set the pin to low to confirm whether it is switching (via multimeter ?)

      How about the I2C2 pin mux settings? Pins are assigned to HPS ?

      Did a search on past topics and looks like there is some discussion on the clock , see whether is it similar issue

      https://community.altera.com/discussions/fpga-device/how-change-i2c-clock-on-cyclone-v-hps--terasic-de10-nano/266788

      Thanks

      Regards

      Kian

       

      • greenlantern01's avatar
        greenlantern01
        Icon for Occasional Contributor rankOccasional Contributor

        Hello Kian,

        Thanks for sharing this information. I will work on it and give an update on this.

        Regards

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

    Hi,

    Just wondering what's the status on this case , whether the issue been resolved?

    Thanks

    Regards

    Kian

    • greenlantern01's avatar
      greenlantern01
      Icon for Occasional Contributor rankOccasional Contributor

      Hi Kian,

      I'm still working on this issue. 

      Regards

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

    Thanks for the reply. I will be out of office next week for a week thus response will be slower.

    Regards

    Kian

  • greenlantern01's avatar
    greenlantern01
    Icon for Occasional Contributor rankOccasional Contributor

    Hi Kian,

    I tried working on the solution provided.

    I appended the dts file as shown below:

     

    Added the i2c1 device and then converted the dts file to dtb as shown in the document. Copied the dtb file on the sd card and tried to boot the fpga however, I think it crashes at boot. 

    It doesn't go beyond this point.

    Kindly direct on the next steps. 

    Thank you & Regards