Hey everyone, I’m trying to understand something and I’m not sure where the issue is coming from, but it might be Xavier-related to I’m posting here for ideas. I have an MCP4725 I2C device. I’ve written code to control a voltage, and it works fine if I put a 1ms sleep timer in the loop that takes input and processes signals. If I remove the timer I get an OS error 121 a couple times upon load, then an OS error 110, then an OS error 5 over and over with the loop iterations.
Baud rate is set at 100000. I’ve tried all the baud rates in the datasheet and I get the same result. Wiring is good. i2c address is good. Any ideas?
Yes. I have a while loop that calls a method in a MCP4725 object connecting to bus 8 at address 0x60 (in this case) setting power to normal mode and writing an output digital value for the MCP to convert to an analog signal.
If I throw a 1ms sleep into the loop it works fine, but if I don’t I get the errors mentioned above.
I’ve edited bus block rate in sys/bus/i2c/devices/i2c-/bus_clk_rate. After saving the file, is there a service I need to reload or any other changes I need to make? Or is there a more proper way to handle this?
Also, I’ve noticed that without any sleep commands, the loop establishes a connection and executes successfully the first time, but on the second step of the loop it starts throwing the errors mentioned above. Erro 121 is also the same error I get if I unplug the MCP4725 in the first place.