[sdiy] Microchip.. for futur projects, choice to do.. PICs or Arduino

Gordonjcp gordonjcp at gjcp.net
Thu Feb 25 11:03:19 CET 2021


On Wed, Feb 24, 2021 at 04:10:46PM -0500, Jean-Pierre Desrochers wrote:
> 
> And... I remembered seeing many posts and videos about how easy
> it is to use Arduino as a 'bridge' to get a small project done.
> Free user interface/programming environment available.
> Final projects on Atmel micros ??

There's really two sides to it.  There's Arduino the software platform and Arduino the boards.

The boards are a cheap and easy way to get an atmega328 (or similar) pre-flashed with a perfectly acceptable bootloader, usually some sort of USB interface (often implemented in a different Atmel 8-bitter), and enough support hardware that if you plug it into a USB port it'll fire up and blink its LED.  Simple go/no-go indication.

The software environment involves a not-brilliant-but-usable "IDE" written in Java (iirc) and a huge array of libraries and examples for just about anything you could want to hook to a microcontroller.

The thing is, you don't have to use that.

Every AVR development system is basically just avr-gcc and avrdude under the bonnet, and there's nothing stopping you programming your Arduino board by writing "bare metal" code in Vim^W the editor of your choice, compiling with a Makefile, and then uploading with avrdude (often from your Makefile).  You can get various other build scripts that'll pull in Arduino libraries, too.

With the standard Arduino environment a lot of the boilerplate code is taken care of for you, and often in a fairly platform-agnostic way.  So you the user are presented with a page where you can write code for a setup() function to be run on reset, and a loop() function to perform the main loop of your target app.  You can add code for interrupt service routines if you want, although you can't override some of the "built in" stuff like the Timer 1 interrupt.  You can even program them in assembler, by simply dropping a .s file into the same directory as your .ino sketch and the Arduino build scripts will Do What You Mean.

If you need a bit more oomph and can cope with 3.3V the STM32 "bluepill" boards have a 32-bit ARM running at 72MHz with 64kB of flash and 20kB of RAM and cost about the same as a coffee.  For about twice the price the newer "blackpill" boards have an STM32F411 which has hardware floating point, way more RAM, way more flash, more IO options and a faster clock (120MHz?  Something like that).

You're certainly not stuck to using the Arduino libraries and IDE if you don't want to, but the boards are a great way to get a ready-to-use and CE-marked dev board that you can stuff into things.

-- 
Gordonjcp




More information about the Synth-diy mailing list