PULP Community
I2C on Pulpissimo - Printable Version

+- PULP Community (https://pulp-platform.org/community)
+-- Forum: PULP's Community forum (https://pulp-platform.org/community/forumdisplay.php?fid=1)
+--- Forum: PULP General questions (https://pulp-platform.org/community/forumdisplay.php?fid=2)
+--- Thread: I2C on Pulpissimo (/showthread.php?tid=38)



I2C on Pulpissimo - magseet - 12-03-2018

Hi,
I'm trying to use the I2C controller to communicate with my own I2C peripheral. First, I was trying to build the tb by including the I2C EEPROM (I've followed the README instructions). The problem is that, when using the example program for I2C, the RTL simulation gets stuck at the first write operation. Moreover, SDA and SCL signals never toggle during RTL simulation.

Do you have an example program I can use to make I2C work? I guess I need to make some initialization..


RE: I2C on Pulpissimo - kgf - 12-04-2018

Hello,

There is actually a small test program on the pulp_rt_examples 
  https://github.com/pulp-platform/pulp-rt-examples/tree/master/periph/i2c

You probably want to clone the 'pulp-rt-examples', as explained in the README.md of pulpissimo 
  https://github.com/pulp-platform/pulp-rt-examples

That should give several examples for coding. Hope that helps,
KGF


RE: I2C on Pulpissimo - magseet - 12-04-2018

(12-04-2018, 08:58 AM)kgf Wrote: Hello,

There is actually a small test program on the pulp_rt_examples 
  https://github.com/pulp-platform/pulp-rt-examples/tree/master/periph/i2c

You probably want to clone the 'pulp-rt-examples', as explained in the README.md of pulpissimo 
  https://github.com/pulp-platform/pulp-rt-examples

That should give several examples for coding. Hope that helps,
KGF

I've already tried with the example in that repo, but it doesn't work as expected: the first write operation waits forever. I was trying to interpret the API provided by pulp-rt and tried to set an event, but then the wait operation is again waiting forever. Probably I need to program the UDMA or to manage interrupts, but I would need a working example to start.


RE: I2C on Pulpissimo - kgf - 12-05-2018

(12-04-2018, 11:11 AM)magseet Wrote:
(12-04-2018, 08:58 AM)kgf Wrote: Hello,

There is actually a small test program on the pulp_rt_examples 
  https://github.com/pulp-platform/pulp-rt-examples/tree/master/periph/i2c

You probably want to clone the 'pulp-rt-examples', as explained in the README.md of pulpissimo 
  https://github.com/pulp-platform/pulp-rt-examples

That should give several examples for coding. Hope that helps,
KGF

I've already tried with the example in that repo, but it doesn't work as expected: the first write operation waits forever. I was trying to interpret the API provided by pulp-rt and tried to set an event, but then the wait operation is again waiting forever. Probably I need to program the UDMA or to manage interrupts, but I would need a working example to start.

Hello, we are trying to see if there is an issue is on the I2C setup for PULPissimo. We will get back soon.


RE: I2C on Pulpissimo - kgf - 12-05-2018

Thanks to you we have identified one issue. The pad cell used in the  

  rtl/pulpissimo/pad_frame.sv

was (mistakenly) a pull down pad and not a pull up pad. This is now fixed. We did not yet try a full application, but a smaller test showed us that tis seemed to be the issue. We will be looking into it, but you could maybe give it a try to see if this solves the issue.


RE: I2C on Pulpissimo - magseet - 12-05-2018

(12-05-2018, 02:11 PM)kgf Wrote: Thanks to you we have identified one issue. The pad cell used in the  

  rtl/pulpissimo/pad_frame.sv

was (mistakenly) a pull down pad and not a pull up pad. This is now fixed. We did not yet try a full application, but a smaller test showed us that tis seemed to be the issue. We will be looking into it, but you could maybe give it a try to see if this solves the issue.

Thanks for your effort. As soon as I have time to try it, I'll let you know.

I was doing some reverse engineering on the RTL and noticed that the event signals coming out from I2C modules are always X. This is due to the err_o port of udma_i2c_control, which is not connected in the port map (check
udma_i2c_top.sv). Is this disconnection intentional? I guess it doesn't affect the synchronous way of using I2C ..