FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6463 Discussions

i2c communication with itg-3200

Altera_Forum
Honored Contributor II
1,489 Views

Hello everybody, 

I want to connect a 3axis digital gyroscope ITG-3200 with cyclone FPGA kit(EP1C12Q240C8) of iisc Bangalore.II have hardware setup.My board does not contain nios ii processor or any I2C EEPROM.I have the following quarries: 

 

1.Whether i2c communication is possible in my kit or not?Which pins can be used for this connection? 

 

2.The i2c library of itg-3200 are written in c for aurdino driver.How to define this library for our kit. 

 

3.I am attaching my board details(BOOK II-CHAP 2),itg-3200 datasheet.If anyone know how to interface itg-3200 with this kit  

Please give me your valuable suggestion. 

 

Thank you
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
607 Views

You can use the digital I/O pins for the I2C bus. The SDA pin needs to be birectional so you will probably have to use a hole 8-bit group just for this signal. 

There are several ways to implement an I2C bus, with a hardware controller (there is one on Opencores) or by software using bit banging. Do you have a CPU in your project? What is it, if it isn't a NIOS?
0 Kudos
Altera_Forum
Honored Contributor II
607 Views

I tell you my experience to communicate with a I2C memory. I used 2 pins of the FPGA to communicate with the chip. One output for clock, and other bidirectional ( inout std_logic ) for data. The pin has an external pull-up and behaves like an open-collector as I2C needs. 

 

First I wrote a component, based on a state machine, to send a byte to the memory. I used this component in other state machine to send some bytes, and make a complete trasaction of writing a byte in the memory. In a similar fashion a make a component to read a byte from the memory and used in the read operation. 

 

You need a lot of pacience and a digital oscilloscope to debug this.
0 Kudos
Reply