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

SSD1306 for CH32V003j4m6 error ! #146

Open
mindonne opened this issue Sep 12, 2024 · 5 comments
Open

SSD1306 for CH32V003j4m6 error ! #146

mindonne opened this issue Sep 12, 2024 · 5 comments

Comments

@mindonne
Copy link

I use library library Adafruit SSD1306 version 2.5.10 for CH32V003j4m6 , when compiling : " fatal error: util/delay.h: no such file or directory #include <util/delay.h> "

@maxint-rd
Copy link
Contributor

Seems like you found that the Adafruit SSD1306 library is not supporting the CH32 core (yet).
In the code you can see this:

#if !defined(__ARM_ARCH) && !defined(ENERGIA) && !defined(ESP8266) && !defined(ESP32) && !defined(__arc__)
#include <util/delay.h>
#endif

The file util/delay.h is something specific for the Atmel Arduino core. It provides functions for milli- and microsecond delay. As you can see the Adafruit code doesn't include that file when compiling for various other cores.

You may get further in compiling this by adding !defined(CH32V00x) or !defined(ARDUINO_ARCH_CH32) into that #if, but you will likely find other issues. I have not yet tried to compile that Adafruit library myself but expect that more modifications are needed.

What is your project about? Are you just experimenting?
In a CH32 project for a particular LCD display, I also wanted to ùse Adafruit GFX. The limited flash space of the CH32V003 required me to make a stripped version of the Adafruit GFX library. Maybe sometime in the future I may find time to attempt to make a CH32 compatible version of Adafruit SSD1306, like I did with Adafruit_SleepyDog, but currently I have other priorities.

BTW: Recently the @hathach added support for Adafruit qtpy ch32v203 board. In this post @ladyada commented that currently no support for other libraries is planned, but that PR's for CH32 support are welcome to be submitted.

@mindonne
Copy link
Author

I just experimenting but library ssd1306 does not support for CH32v003j4m6 :(((

@blopa1961
Copy link

Use the SSD1306ASCII library by Bill Greiman; it works with the CH32V003.

@mindonne
Copy link
Author

Sử dụng thư viện SSD1306ASCII của Bill Greiman; nó hoạt động với CH32V003.

so good, but .... have to take up more memory :(

@maxint-rd
Copy link
Contributor

so good, but .... have to take up more memory :(
I found the CH32X033 to be a nice alternative for projects that don't just fit in the V003. Although it has some issues, the 64k makes things easier to fit. The TSSOP20 pinout is largely compatible, so I use it as a drop-in replacement during development and debugging, (prior to trying to squeeze code size down to fit in the 16k of the V003).

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

3 participants