adafruit / adafruit/Adafruit_CircuitPython_HT16K33

super slow update on raspberry pi pico W

Open
#115 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
49
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Hello

I've observed very slow display update for 14-segement backpack (https://www.adafruit.com/product/1910) controlled by raspberry pi pico W (using latest circuit python uf2)

According to the test code provided below update of all 4 characters takes about 13-14 ms and scales more or less linearly with each new character added ( the single call of `display.set_digit_raw` takes about 3-4 ms ) which makes integrating this display pretty hopeless for any code that needs to update something else quickly as the code is blocking, especially if someone want's to chain a few of those...

```python
import board
import busio
from adafruit_ht16k33 import segments
import supervisor

i2c = busio.I2C(board.GP21, board.GP20)
display = segments.Seg14x4(i2c)

start_msecs = supervisor.ticks_ms()
display.print("ABCD")
stop_msecs = supervisor.ticks_ms()

print("elapsed time = ", stop_msecs - start_msecs)
```

Wondering what might be the reason for such slow I2C implementation - is it pico W related or circuit python in general ?
I have tested the displays with regular Arduino UNO and your library (https://github.com/adafruit/Adafruit_LED_Backpack) and the equivalent update (4 characters via `writeDigitRaw()`) takes only 1 ms, or 1850 micro seconds, if simple `micros()` before-after measurement can be trusted.

Any insights and ideas how to overcome this are much appreciated !

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the issue's timing example on the Raspberry Pi Pico W and inspect the `busio.I2C`, `segments.Seg14x4`, `display.print`, and `set_digit_raw` path. Compare the measured update time with the Arduino result, then document or address the identified bottleneck with a reproducible timing result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, raspberry-pi
Domain
embedded-iot, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.