- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I am using the I2C OpenCores v13.0 from https://fpgawiki.intel.com/wiki/I2C_(OpenCores) with the Platform Designer/Qsys and the Nios II Processor on the Quartus Prime, but it isn't working. I don't know what steps I may have done wrong. First I unzip the .zip and added the path of the files to generate the I2C component in Qsys. So in the _sw.tcl file I've changed the "opencores_i2c" by "i2c_opencores" beacuse the _hw.tcl and _sw.tcl name weren't in agreement (https://forums.intel.com/s/question/0D50P00003yyRELSA2/how-to-use-i2copencoresswtcl-in-i2c-opencores). After that I made the C code in Eclipse, as follow:
#include <stdio.h>
#include "system.h"
#include "i2c_opencores.h"
int main(){
int data;
// address to communicate 0x08
// Frequency 100 kHz
I2C_init(I2C_BASE,ALT_CPU_FREQ,100000);
while(1){
I2C_start(I2C_BASE,0x08,1); // chip address in read mode
data = I2C_read(I2C_BASE,1); // read the input register and send stop
printf("data = %d\n",data);
}
return 0;
}
The code compiles without errors or warnings, all the drivers and libraries (i2c_opencores.c, i2c_opencores.h, i2c_opencores_regs.h) were linked to Eclipse automatically. In the Nios console I see nothing, any value received. I also verified the SDA and SCL lines in an oscilloscope, but no signal. If someone can help me, I appreciate it. Below I've attached the configuration in Qsys. Thanks in advance.
- Tags:
- Include
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you know if using only the Nios II, without the HPS will it work? How did you make to run the C program with the I2C functions in Eclipse? I didn't find the .sopcinfo in your design . Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you know if using only the Nios II, without the HPS will it work? How did you make to run the C program with the I2C functions in Eclipse? I didn't find the .sopcinfo in your design . Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You have the Qsys file, so you can generate the sopcinfo from it easy. After generating the Qsys file, you will get the sopcinfo file. Use this file to create your hello world project.
Yes sure, you can use Nios II only. This was one of my designs which combines Nios II and HPS. I am attaching a simpler version of qsys file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I tried to do my design again based on your Qsys file and it did not work. I put the SCL and SDA on an oscilloscope, but the output was just noise, nor the clock in the SCL was generated. In Qsys, I added the OpenCores I2C component in Tools > Options > IP Search Path, is this correct? Do I need to do anything else? Because the other settings and procedures are the same as your design. Thank you so much for helping me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page