Replies: 1 comment
-
I think such situation appear quite often. I personally keep u8g2 running in "foreground" but do the time critical tasks in interrupt service procedures. Those ISRs can be executed in parallel. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have a question on the best way to achieve something using u8g2. I am new to embedded programming so apologies in advance if my questions do not make sense.
I am using a Teensy 4.1 with a Pimoroni 128x128 OLED over i2c. Making them work together was gratifyingly simple with this library, so many thanks 😄
Taking some timings with
micros()
and logging withSerial.print
I'm seeing thatu8g2.sendBuffer()
is taking around 80ms. So I can achieve around 12 frames per second, which is fine for my application.However I have other tasks I want my MCU to be doing, with precise timing. I had assumed (without giving it much thought) that one point of hardware i2c was that it could be busy transmitting data while your application code is doing other things.
Is this possible with
u8g2
? I.e. makingu8g2.sendBuffer()
not block, but instead have some interrupt when it's done.I think the answer is no, because it's not supported by the Arduino
Wire
library.If I do want to have that, I can still use
u8g2
for for OLED setup, and for all the features of rendering fonts/graphics to the frame buffer, but I'll need to find (or write) another function for transferring the frame buffer to the SH1107, using DMA on the MCU that's on the Teensy 4.1?Before I go off down a rabbit hole, I just want to check that I've understood the situation correctly?
Many thanks, Liam
Beta Was this translation helpful? Give feedback.
All reactions