Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /homepages/45/d549400858/htdocs/nicklebyhousewebsite/templates/sdr_template_nov17/functions.php on line 199
I've used Atmel 8 bit microcontrollers a lot for my model railway products. I always used them soldered to a PCB of my design, and used a third party paid-for C compiler. The whole worked well, but did cost some money to get off the ground.
For my own non commercial use, what should I use? I wasn't going to pay for a compiler again. I have always ben aware of the Arduino family of products, but I'd never used one. So faced with a task that either needed a compiler or a different approach, I decided to give Arduino a try. And I haven't looked back.
The software is free and open source, you download a simple Integrated Design Environment with editor, compiler and downloader to the target system all on one package. It is much more streamlined that I was used to. The only element missing is a simulator - the debug approach is to embed "printf" statements in the code, run it on the target hardware and see them in a terminal window. Software libraries for many purposes are widely available.
The hardware is readily available in the high street in UK. Several boards are available with a microcontroller, USB interface and connectors to I/O pins; then you can get a variety of "shields" that plug onto the top. These can have hardware for specific functions (eg motor control) or can be for prototyping; I've used the latter type.
I'm on about my fourth project now. The new one uses an Arduino "Due" which is a 32 bit processor, has a lot of memory available and runs around 5 times faster. The performance is there for any likely embedded project I will tackle.
The software structure is designed to be easy to learn and use. You put all of your setup code into a single setup function, and the remainder into a single function called "loop". You can of course call other functions from both, to split it up. The "loop" code runs to the end, then goes back to the beginning, forever. That's find for some code but not for real-time applications with several "threads" (as my code often is). But you can get back to what I'm used to by having a timer "tick" interrupt, and only allowing loop() to re-start every tick. That way you know exactly how often the code is executed.