WiPy LoPy I2C with ATMEGA
-
I tried to to connect my LoPy with an Arduino Pro Mini @ 8MHz 3.3V via I2C. The results were not the expected.
The reason I want to do this, is that I must count pulses from various devices. ESP8266 and ESP32 are not stable with ISR so I decided to keep the ATMEGA with the bug free hardware interrupts at PINS 2,3. Currently I use Software Serial with UART and it works just fine. But I would like to go further using I2C.
I tested the solution but it didn't work. I was getting wrong bytes from time to time and that's why the setup is considered as not reliable.
Does anybody managed to achieve this?
Thanks
Constantinos -
@constantinos
Maybe because I2C is still software implementation... -
@constantinos
Have you tried lowering your I2C speed (baurate= init parameter)?Also how long is your cable? You can try adding external pull-up (to 3.3V) resistors too (maybe 4.7K)
-
Are you using the Arduino libraries with your ATMEGA? If so those enable AVR's internal pull-ups too, so you have two devices enabling weak, not really up to the job, pull-ups at both ends. I guess it's very possible the bus isn't really running on spec doing that.
I don't know if you can disable the pull-ups on the Arduino or Pycom side, but maybe worth investigating.
Edit : On the Arduino side you should be able to
digitalWrite(SDA, 0); digitalWrite(SCL, 0);After calling Wire.begin to disable the pull-ups? Maybe that could help.
-
@jmarcelino Cables are really very short. Can't be shorter... Baud rate is 100000. I tried different baud rates but this value seems to be the correct.
I will try the pullup resistors today
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login