- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Community
I'm trying to access an I2C Device connected to the LTC 2x7 connector available
on a DE1-SoC Board.
I would like to communicate with the device using the I2C peripheral registers
available for the HPS embedded in the Cyclone V.
Typically I2C communication requires (both in reading and writing)
- the slave address
- the register address
- the data (to write or to read)
Looking at the entire documentation I'm not able to find who to pass the REGISTER ADDRESS
or how the peripheral register must be set!
Thank you in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you
I've made some steps toward the solution:
I write here to help some others:
INITIALIZATION:
1: Disable Controller 0x6C <-- 0
2: Configure Controller to be a MASTER, set lenght to 7 bit, freq 100kH 0x00 <--63
3: Setting Target Address 0x04 <-- I2C address (for MPU6050 = 68)
4: Enable Controller 0x6C <-- 1
WRITE on register 0xXY the data 0xPQ
1: Write Slave address and Register address on I2C WITHOUT releasing bus (NO send STOP) 0x10 <-- 0xXY
2: Write Data: 0x10 <-- 0xPQ
3: you can continue writing the data for reg. (XY+1) , (XY+2) ....
4: to release the bus 0x10 <--0x2PQ (Write data and generate STOP)
READ on register 0XY
1: Write Slave address and Register address on I2C WITHOUT releasing bus (NO send STOP) 0x10 <-- 0xXY
2: Read Data and generate a STOP 0x10 <-- 3ZZ
Please note that the signals generate (on the oscilloscope) seams compatible with the protocol and the data
But data read on the Driver Registers are still instable and quasi-Random.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefano,
I try to look information about who to pass the REGISTER ADDRESS
or how the peripheral register must be set.
currently I dont have instant answer for that yet.
Stay tune
Thank you,
Aliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you
I've made some steps toward the solution:
I write here to help some others:
INITIALIZATION:
1: Disable Controller 0x6C <-- 0
2: Configure Controller to be a MASTER, set lenght to 7 bit, freq 100kH 0x00 <--63
3: Setting Target Address 0x04 <-- I2C address (for MPU6050 = 68)
4: Enable Controller 0x6C <-- 1
WRITE on register 0xXY the data 0xPQ
1: Write Slave address and Register address on I2C WITHOUT releasing bus (NO send STOP) 0x10 <-- 0xXY
2: Write Data: 0x10 <-- 0xPQ
3: you can continue writing the data for reg. (XY+1) , (XY+2) ....
4: to release the bus 0x10 <--0x2PQ (Write data and generate STOP)
READ on register 0XY
1: Write Slave address and Register address on I2C WITHOUT releasing bus (NO send STOP) 0x10 <-- 0xXY
2: Read Data and generate a STOP 0x10 <-- 3ZZ
Please note that the signals generate (on the oscilloscope) seams compatible with the protocol and the data
But data read on the Driver Registers are still instable and quasi-Random.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stephano,
Below is the link to I2C register map for HPS Cyclone
Before i further investigate, are you using creating application for linux or baremetal?
Thank you,
Aliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefano,
Can i have answer from my previous question?
Thank you,
Aliff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As I've already written above:
I found the correct command sequence to read and write on the I2C bus using the embedded registers of the driver.
As a final note: The proposed sequence of commands works pretty well if provided through a suitable algorithm (for instance written in C) while it does not work if provided, writing directly on the peripheral interface address location using Altera Monitor Program, may be because this tool is unable to perform separately the read and write procedure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Stefano,
So, I shall set this case to close pending. If you still need further assistance, you are welcome reopen this case within 20days or open a new case, someone will be right with you.
If you happened to close this case you will receive a survey. If you think you would rank your support experience less than 4 out of 5, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.
Thank you,
Aliff
![](/skins/images/B7BA37F9CE4B52FF7CAE1FB0388839C8/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page