Git Product home page Git Product logo

wpi_soft_i2c's People

Contributors

electronicayciencia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wpi_soft_i2c's Issues

Infinite loop in the function "i2c_reset(i2c_t port)"

Hi,
I am sorry if it's not the right way to bring up this issue. But I found no other option. I wanted to use multiple pins of RPi as SLC and SDA for many PCF8591 and I came across this code. I followed the instructions mentioned in the Readme. But still, it's not working properly. The problem I face is that the code goes into an infinite loop in the function 'i2c_reset(i2c_t port)' when it's calling the function 'digitalRead(port.sda)' which is always returning the value zero [line 88 in the file 'soft_i2c.c'].

i2c scan immediately after an i2c scan causes Warning: I2C Bus busy or defective. Pin 9 is LOW for 5s."

I am using a raspberry pi pico as slave, which is running this program: https://forums.raspberrypi.com/viewtopic.php?p=1823137&sid=43326da88e7966baebc321d17160f848#p1823137

It emulates a 256 byte RAM in raspberry pi pico, each byte can be read and written. I have connected the SCL0 and SDA0 pins of raspberry pi pico to SDA/SCL (GPIO2/3, pin numbers 3 and 5 respectively) of the raspberry pi zero board. If I use the linux functions read() and write(), my setup behaves as expected (I can read and write single/multiple bytes of data in the pi pico)

I am trying out your library because I want to manipulate I2C communication bit by bit. I am using the same program in raspberry pi pico. If I call the scan.c program the first time, I get this output

I2C scan for soft_i2c project
 * Device found at 22h

which is correct. However, if I call the scan program again immediately, I get this


I2C scan for soft_i2c project
 * Device found at 22h
Warning: I2C Bus busy or defective. Pin 9 is LOW for 5s.
Warning: I2C Bus busy or defective. Pin 9 is LOW for 5s.
Warning: I2C Bus busy or defective. Pin 9 is LOW for 5s.
Warning: I2C Bus busy or defective. Pin 9 is LOW for 5s.

This warning then keeps on coming. If I force close the scan program (Ctrl+c) and then run
i2cdetect -y 1
then i2c probing is slower than usual and it does not detect the i2c device at 0x22 again. I have to reset both the pi pico board and the raspberry pi zero board to make things go back to normal.

Is there any way to deinitialize or reset the i2c bus once the scan program finishes, so that the i2c lines go back to their initial settings? My hardware setup works fine if I use linux read and write functions for i2c.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.