Closed jerryneedell closed 3 years ago
Also ran against current tip of main -- same result
Adafruit CircuitPython 6.2.0-beta.1-68-gcd616f639 on 2021-02-03; Raspberry Pi Pico with rp2040
>>> import charlcd_i2c_rgb_simpletest
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "charlcd_i2c_rgb_simpletest.py", line 18, in <module>
File "adafruit_character_lcd/character_lcd_rgb_i2c.py", line 75, in __init__
File "adafruit_mcp230xx/mcp23017.py", line 52, in __init__
File "adafruit_mcp230xx/mcp23017.py", line 102, in iodir
File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
OSError: [Errno 19] Unsupported operation
>>>
Looks like we could be getting an error from pico-sdk: https://github.com/adafruit/circuitpython/blob/main/ports/raspberrypi/common-hal/busio/I2C.c#L148-L157
I have the same issue when running the mcp230xx_simpletest.py with an MCP23017:
Traceback (most recent call last):
File "<stdin>", line 9, in <module>
File "adafruit_mcp230xx/mcp23017.py", line 52, in __init__
File "adafruit_mcp230xx/mcp23017.py", line 102, in iodir
File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
File "adafruit_mcp230xx/mcp230xx.py", line 49, in _write_u16le
OSError: [Errno 19] Unsupported operation
@jedgarpark is also seeing a similar with with SSD1306.
FWIW the problem went away for me when I included the I2C address in my code display = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3d)
Strange - I had not to copied the adafruit 74hc595 library, as noted in the guide, to my Pico. Once I copied this to the, the charlcd_i2c_rgb_simpletest ran OK ... for awhile....
The guide is here: https://learn.adafruit.com/i2c-spi-lcd-backpack/python-circuitpython#circuitpython-installation-of-charlcd-library-2977283-9
It is not at all clear to me where the 74hc595 library is accessed, but it seemed to work ... until
I tried removing the 74hc595 library and the code failed as before but when I restored the 74hc595 library, I am no longer able to get it to run
This makes no sense to me. I have no idea why the 74hc595 library is suggested to be installed since it is not used and it I have no idea what copying it over seems to allow the code to run for a few tests.
I repeated the test on a metro esp32s2 without installing the 74hc595 library and it runs normally.
@jerryneedell What hw are you using? the I2C/SPI backpack uses an MCP23008 so I am not sure what combination of things you are using.
@dhalbert I'm using one of these https://www.adafruit.com/product/1109 - i have it connected to 5V GND, SDA,SCL
it uses the MCP230017
@jerryneedell I tried this with the I2C/SPI backpack, which uses an MCP23008. I had to use 3.3v->5v level shifters to get it to work with a Metro M4, and then I moved it to an RPi Pico and it worked fine. I did not try it without the level shifters on the Pico in the interest of not potentially frying the Pico.
If I use the Metro M4 connected straight to the backpack with the 5V pullups, it hangs up. I think it does not like the overvoltage. I have seen this before with the SAMD51
The PiLCDPlate (1109) you are using does not have any builtin pull-up resistors. The RPi's it's meant to work with already have pull-up resistors on their I2C lines. So your troubles may have to do with that. I also chatted with Redat on discord and their I2C LCD backup has 5v pullups.
@dhalbert Thanks, I did add 10K pull-ups -- and I think the signal levels are since it it designed for a Pi. It only takes 5V input. I'm really puzzled by the behavior on the Pico. Also puzzled by the guide reference to the adafruit_74hc595 library ... It does not seem to be used.
The 74hc595 library is used only for SPI. The backpack has an MCP23008 for I2C and a 74HC595 for SPI use. I will clarify the Guide.
Were your pullups to 3.3V or to 5V?
3.3v -- and I just got it to work by removing the pull-ups and adding another I2C breakout to the setup to let it provide the pull-ups. Checking my wiring, but it seems to be happy now...
Should I close this? It is not clear to me what was wrong before, but I don't think this is a CP issue.
Yes, let's. Redat is getting some level shifters and will try with those. Their LCD is arrangement is different.
As reported by a Discord User, accessing a Character LCD fails on a Raspberry Pi Pico
The same example runs normally on a metro-esp32s2
For this example I used SCL on GP1 SDA on GP0
it fails at the line
Note - the original issue was for a non-rgb test and it uses the mcp23008 and failed on a read attempt https://discord.com/channels/327254708534116352/537365702651150357/8062596030453514
code run