Choosing a processor and Framework (Language)
The first step a new design is choosing what processor and framework to use. It sounds simple but when you look at the hundreds of choices what should be a simple task can become overwhelming. The first step should be to come up with the main features you want. Mine are:
- Small board outline. I prefer Adafruit Feather or Arduino nano outline. They are small in size and have a reasonable number of IO pins. They also have screw terminal adaptors for them
- Wifi. I want to be able to monitor a puzzle with MQTT messages or at least a web-based connection for debug.
- Reasonable number of IO pins.
- Arduino framework. This is the framework used on the processor, not the IDE. Arduino has setup (run once) and loop (run in a loop) routines in the framework.
- Screw terminal adaptor available. This allows you to use screw terminals to connect wires to it. They are available for the adafruit feather and arduino nano pinouts.
These requirements lead me to the SparkFun ESP32 Thing Plus (WRL-15663). Your requirements may be different. I'll go through a few of other options as well some of the other boards I have used next.
To start, you will want to decide is what framework and language you want to use. Here are some of the choices.
- Full Linux OS. The various Raspberry Pi (RPI) incarnations will give you this option. This gives you the biggest range of programming languages. You may be able to use node-red to do a graphical development. C/C++, Python, and NodeJS are some of the language options. A screw terminal breakout is available. I personally have 2 concerns with this platform. The first is the Linux OS can be corrupted by powering it off without a proper shutdown. There are ways around this. The second issue is unhandled exceptions. If an unhandled exception happens in a library you are using, your program could stop running. This will require a reboot of the RPI to recover from this. You may be able to incorporate a watchdog timer to prevent this.
- MicroPython or CircuitPython. CircuitPython is primarily used by Adafruit. They have a lot of tutorials and libraries that support the kinds of sensors you may need. One board that may be of interest to you is the PropMaker. It has a lot of interfaces that you may be interested in. Both of these flavors of python exit to a command prompt if there is an unhandled exception but there is a watchdog timer that can bypass this problem.
- Arduino framework. This is a framework that provides some wrappers around various hardware aspects of the processor. You write your code in C/C++. The key part of this is a setup function that is called once when the program starts and a loop function that is called repeatedly. There are a lot of tutorials online that can help you get started with this framework. One thing to note, I am referring to the framework that becomes part of your code, not the IDE. When it comes to the IDE, I much prefer platformIO. It is an add on to VSCode (a free IDE). I will cover platformIO in a later post.
- PLC ladder diagrams. If you are used to programming Programable Logic Controllers (PLC) you may want to look at openPLC. It is an open source package that allows you to program certain Arduinos using standard ladder diagrams as well as other PLC formats. I have not used it, but it looks interesting.
- Seeed Studio XIAO SAMD21. This Seeed Studio XIAO SAMD21 is a very small board with only a few IO pins. I will use this one for designs that are very small or sometimes for a add on second processor in a platform. In some designs it makes sense to do some of the work in a second processor. I tend to use the XIAO SAMD21 for these.
- Arduino Nano. compatible. This is the Nano compatible processor that I use. I will use this one for simple designs that I need 5V IO for. Most of the newer processors are 3.3V IO only. Normally this isn't a problem as long as the other boards are the same voltage.
Comments
Post a Comment