I finally have some more time for experimenting with OpenMV. Since I want it to control a hexapod robot, that’s a lot of servos to take care of. So I built myself a simple servo controller based on a Pro Mini, with which I can communicate over I²C, basically just sending the servo positions to the registers. I have tested it with Raspberry Pi and PyBoard, and it all works perfectly fine there.
Today I tried connecting it to OpenMV. Here are my results:
It is related, but it seems you’re getting an error first that triggers the DMA issue. When IRQs are disabled, I2C doesn’t use DMA.
.
I’ll apply that patch, thanks!
I know this is pretty much beta, and I don’t expect everything to work out of the box. I’m experimenting with this because it’s fun (at least when you don’t do it as a job) and I hope it’s helpful. Thanks for your hard work!
Yes, I noticed that you use that in the mlx python module. Is that because you also had problems with I2C?
By the way, that code also has the SDA and SCL pins swapped, I think?
I am using bus #2. I would like to use the openMV cam as a master to an arduino uno using the slave sketch here: https://www.arduino.cc/en/Tutorial/MasterWriter
I was able to send a few bytes of data, but after some time, the cam gives the OSError 16. I’m not entirely sure what I am doing incorrectly.
Ibrahim will have to take a look at this. It’s highly likely there’s a firmware bug for this. And… if there’s a bug a firmware fix can be put out very quickly.
We’re using soft_i2c for MLX because it’s more flexible, it allows you to control the STOP condition after a read/write, the sthal I2C driver on the other hand always generates a STOP after a read/write.