Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Help: HSMC and I2C

I am having a hell of a time trying to interface a camera through an HSMC - Santa Cruz adapter board (THDB-H2S - http://www.terasic.com.tw/cgi-bin/page/archive.pl?language=english&categoryno=39&no=219)

On a typical HSMC connector, are the I2C pins electrically different than PIO pins? If so this would indicate that my problem has been a failure in sending I2C reliably through PIO pins.

If not, could the level shifter on this adapter be causing my problems?

The THDB-H2S uses the regular HSMC I2C pins for accessing EEPROM storage on the adapter.

Any help with this would be greatly appreciated.

17 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Are there any parameters or tricks one can use to "tweak" the pull up values that Quartus II implements on the Cyclone fpga's?

    Or if not, what would be the best way to implement i2c using my own resistors?

    I am using an EP3C120F780C7 in a video development kit
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Weak pull-ups are definitely too weak for regular I2C speed at some load capacitance. They can't be set to a higher strength. You should use external resistors of 1K to 4.7K maximum. As said, for SCL a push-pull driver can be used instead for most I2C applications, so basically an approriate SDA pull-up is what you need urgently.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ah I see.

    I am a little cloudy on how I would go about using an external pull up. I suppose I would connect a 3.3V source behind a 1k-4.7k resistor connected to the i2c data line. But can I connect this anywhere along the signal path?

    Another idea:

    What if I turned off pci coupling and interfaced the boards as 3.3v - 3.3v? Might this reduce capacitance from level shifting and help the internal weak pull up to work?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What I mean by where do I connect the pull up resistor is that the daughter board interfaces with an hsmc port and from there I am not able to access any pins along the i2c line.

    I've noticed an option to define a pin as an external input... but how would I connect anything external to it? The only accessibly pins on this board are the hsmc ports or external clock.

    Anyone?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I don't have schematics or other documentation of the said daughter board. Technical, you can place the pull-up anywhere at the I2C bus. This results from the fact, that the resistor value is high compared to trace impedances.

    I guess, there should be a place, where you can solder an SMD chip or leaded resistor. I also don't know, why the board designers didn't think about this issue. But there's definitely no software method to replace a regular I2C pull-up, except for considerably slowing down the transmission speed, as said.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm not sure how I missed this, but the camera I am interfacing with does have 1k resistors pulling up the sda and scl lines to 3.3 V.

    I am having some success reading from the camera if I slow it down far enough, but not consistently. Writing to the board never seems to work though. I looked into the schematic of some generic i2c level shifters online, and they seem to use a pull up resistor on either side of the conversion. Ie, up to 2.5 on the fpga side, and up to 3.3 on the slave. It seems that now I have to figure out how to get an external resistor hooked up to the fpga side. Unfortunately this seems impossible...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Without knowing the level shifter details, I can't say. There are different devices in use for this pupose. I don't even know the I2C voltage level at the camera module.