Now, I would like to program it using C++ and PlatformIO. It is sold as “Arduino compatible” (in other shop) but so far I was only able to find some really old information about older version of the chip that allegedly supports only some strange version of C that needs it’s own compiler called SDCC. However, I managed to create a project in PlatformIO using these settings:
'CC' is not recognized as an internal or external command,
operable program or batch file.
The sketch I’m trying to compile looks like this:
#include <reg51.h> // old header from SDCC
#include "STC89xx.h" // Official header from STC-ISP for STC89xx
void main()
{
}
The header files don’t even exist. I have installed the required Intel MCS-51 (8051) platform though.
So my questions are: Is there a way to make it work? Is it really Arduino-compatible? Can I use C++ instead of C? How do I make it work? Am I missing something about the project settings? Thank you very much for any helpful advice.
Thank you for such quick response! My problem was, I named the file main.cpp. Renaming it to main.c worked. I then downloaded the header file from the github and it compiled!
Is it possible to use C++ and Arduino with this board? I tried these settings
SDCC is the Small Devices C Compiler. It cannot handle C++. Therefore another compiler must be found thaht can compile C++ for the Intel MCS51 / Intel 8051 target platform. After some quick google searches I didn’t come up with anything…
An Arduino Core for this microcontroller platform (STC89 or general MCS51) must be provided. Again a quick google search has turned up nothing.
Memory requirements. You’d have to do some extremely clever programming to fit the Arduino APIs in such a tiny amount of flash and RAM. External libraries are used to a minimum of like 2KB RAM when coming from an Arduino Uno, but 0.5KB RAM are… restricting. If a display library attempts to allocate a framebuffer for the display, it’s already over.
Either this is false advertising (they e.g. meant “arduino-style form factor” or “thing that looks like an Arduino”) or my above two points are fundamentally wrong. Do you have any link to that claim, or even better, compiler and Arduino core links?
The “128xRGBx128 1.44” display" might be something like https://www.waveshare.com/1.44inch-lcd-hat.htm with a ST7735S over SPI. Since the microcontroller doesn’t even SPI you’d have to bit-bang it – or use the UART peripheral in some 8-bit shift register mode.
The Arduino part was an advertising trick… It says:
51 MCU Minimum System Board STC12C5A60S2 STC89C52 Learning Development Board MCU UART with 2 Serial Port Geekcreit for Arduino - products that work with official Arduino boards
I haven’t even received the right display. The one they sent me has same size but the pins are different so I’ve decided to use it with a different board. I was just curious how to make this one work. I should be able to start with what you told me.
Again, thanks a lot for your explanation. I will check out the links too.