Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need for pullup resistors on SDA and SCL pins #6

Open
randmor opened this issue Dec 27, 2018 · 4 comments
Open

Need for pullup resistors on SDA and SCL pins #6

randmor opened this issue Dec 27, 2018 · 4 comments

Comments

@randmor
Copy link

randmor commented Dec 27, 2018

Last year I had no problem making an I2C_1602_LCD display work with your MicroPython driver. But when I tried it again just yesterday, I found that the software no longer worked. I kept getting an error message like "Line 25 OSError I2C write error -1010". Looking at your code, I decided it must be the wrong I2C address, so I found a couple of I2C_1602_LCD displays with known IC2 Addresses (0x27 and 0x3f) which I then tried to make work with the software changing the line which read "LCD_I2C_ADDR=63" to the appropriate decimal value (63 for 0x3F boards and 39 for 0x27 boards) and still could not make the software work. Anyways, I started over from scratch, with all new hardware, and still no luck. Then I remembered I had another Micro:bit breakout board (a Chinese made ElecFreaks Micro:bit Breakout board called "OCTOPUS Bit v 1.6". When I replaced the SparkFun Micro:bit breakout board with the ElecFreaks board, your MicroPython I2C_1602_LCD driver magically worked. So, I guess last year I was using the ElecFreaks Micro:bit breakout board.

So, then I wondered what the difference might be. After a bit more research on the Internet, I came across an article that says a pull-up resistor of from 5K ohms to 20K ohms is sometimes needed, especially when multiple I2C devices are attached to the same bus. So, I tried two 12K ohm pull-up resistors on the SDA and SCL pins of the SparkFun Micro:bit breakout board, and found it would now work with your I2C_1602_LCD driver. I first tried pulling it up to +3V and later tried pulling the 2 pins up to +5V. In both cases, that was enough pull-up to make the 1602_LCD work.

So, if you have other folks having problems running your MicroPython I2C_1602_LCD drivers on their
Micro-bit board, advise them to try a pull-up resistor between SDA and +5V and SCL and +5V. Anything in the range of 5K ohm and 20K ohm should work.

@shaoziyang
Copy link
Owner

micro:bit use a 4.7K resistor in the board, it is suit for most case. If you meet I2C pullup resistor problem, the resistor in board may not work. Internal weak pullup has no effect for micro:bit hardware I2C, and micropython for micro:bit does not support software I2C now.

And which version of micro:bit do you using? Old version 1.3B or new version 1.5?

@randmor
Copy link
Author

randmor commented Dec 28, 2018 via email

@shaoziyang
Copy link
Owner

I think you still use old version micro:bit, because new version has only ship three month ago. The most different is sensor chip, but function is same.

New version micro:bit with small label in the back, and has only one sensor chip:

image

image

@shaoziyang
Copy link
Owner

The problem may cause by LCD1602 module, My LCD1602 is work fine without external res, maybe 4.7K res in micro:bit is too large for some LCD1602 module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants