Hi All
First post. I couldn't find answers over the past few weeks, please let me pick your brains.
I accumulated a pile of microcontroller boards, this summer I would like to make them dance. These include:
Arduino Uno r3 (generic)
CH552t
MSP430-2553
ESP8266 (NodeMCU)
STM32-L476 (nucleo)
I was able to get the ArduinoIDE to recognize these and run the blinky program for each. So far so good.
I often do bit-banging using FORTH, so I tried loading the example libraries for "nanoForth" and "eForth1" as an arbitrary "next" experiment for the set of boards. I was able to get both forths to function on the Arduino Uno. However, I cannot get either to compile for the remaining boards. The first compiler errors include: EEPROM.h, eeprom.udpate, PROGMEM, pgmspace.h, time.h, cast u8 to u16, and DDRD not declared. This makes me think there might be outdated hardware abstraction for these old boards, or maybe missing libraries.
I am I on the right track? Can anyone offer insights to a way forware for any of these?
The MCUs on the boards you have listed have different architectures and not all of them support the features available on AVR MCUs. For example, DDRD is a register on the ATMega328P, but this register is not present on an ARM chip or the ESP8266. Those MCUs have a different internal architecture and different registers. Likewise, although the 328P supports EEPROM and PROGMEM, they do not exist on other architectures, although in some cases they may be emulated or have calls mapped to other functions. But on others they will simply not exist.
It should be possible to run a lot of common code but when it comes to specific hardware features of a particular MCU, you may need to understand how these work and then deal with such variances. Datasheets are your friend when it comes to understanding the features of each MCU. Conditional compiler statements identifying the architecture can be used to include or exclude alternate platform dependent versions of functions or sections of code.
So to summarize, its not that the abstractions are missing. Its more the case that the MCU architecture does not support them and an alternative approach will be needed when programming those chips.
Having said that, there are probably plenty of uses that you can out your various boards to!
You need to find the 'boards' url for the CH552t and MSP430-2553,
the STM32 boards entry has an error, a shout out to SEEED should resolve that. I assume you have the 8266
Forth implementations tend to be very CPU-specific.
I know there are Forths for all the CPUs you have (AVR, MSP430, 8051, ESP8266, and STM32), but I don't think that there is a single Forth implementation that will compile for all of them.
(even if you did find one, it would need chip-specific code to do the sort of bit-banging that you want to do.)
Just out of curiosity, is this the boards platform you used to add support to Arduino IDE for the MSP430?:
Unlike the other microcontrollers you are using (or at least their product families), I don't see many people talk about using the MSP430 with the Arduino framework. It would be interesting to know which Arduino boards platform is a good choice for those who wish to use this chip.