It is true that beginners should start off with 8051 or AVR to get a clear understanding of how microcontrollers work. The documentation of these devices is very readable and simple to understand. But if you have worked with these architectures for some time, you have probably felt your creativity being throttled by the resource constraints that these devices impose on you. 512 bytes of RAM?! What can you possibly do with 512 bytes?
Some people might argue that you can do a lot, and that is correct. But with the rapid growth and innovation in the electronics industry, there are some popular applications that just cannot do with that amount of memory (or a sluggish 16 MHz clock speed!). Think about a simple audio recorder. To record audio, you need to read 16 bits from an ADC at least 8000 times a second. And you have to write all this into an external memory chip (because you have 512 bytes RAM!). Even if you are able to do this, there is no way you can transfer this recorded data out to a computer. If you have been thinking about using the UART (serial port), think again. No laptops have an external serial port anymore.
So what is the solution? Switch to an ARM SoC (system-on-chip).
At about twice the cost of popular AVR microcontrollers, you have over 10 channels of ADC that can read at over 4 million samples a second, you can have FAT32 formatted memory card for recording so that you can transfer your files directly to the computer. You have hardware support for USB 2.0 and you can even hook up an LCD – all with free open-source software running on a single chip!
This detailed block diagram can help you form an idea of what ARM microcontrollers integrate. If the block diagram is not clear to you, don’t worry, this series of article will guide you through each and every block in detail and with the easiest language possible.
So how do you know it is time to switch to ARM MCUs? When is an ARM better than AVR/PIC/805x?
- Processing power: Not specifically talking about clock speed here. What makes a greater difference is the 32-bit core which can multiply two 10-digit numbers in just one clock cycle. At the same clock speed, the 32-bit architecture can be over 8 times faster than common 8-bit architectures. And you got it right, that also means better power efficiency (power consumption increases linearly with clock speed).
A chip powered by an ARM core can do some serious number-crunching and can run algorithms to make your applications smarter, better and faster.
- Response speed: Here is where the high speed cores and peripherals come in. With maximum clock speeds of over 50MHz, ranging all the way up to hundreds of MHz, the core and peripherals are extremely quick to respond. For real time applications such as web server/client implementations and Internet of Things applications, this makes all the difference.
Also, the interrupt handling mechanism is much better in ARM as compared to 8-bit architectures. This will be revisited in a future article on the ARM VIC (vectored interrupt controller).
Low power consumption combined with high speed and fast response make ARM the best choice for low power, high capability devices.
- Peripherals: While ARM chipsets will seem expensive at first glance, they are engineered for low cost designs. The chips usually contain almost everything that common applications need, such as timers, ADCs and DACs. Interfaces such as UART, I2C, SPI, SDIO, JTAG, USB, CAN, I2S, etc. are all in-built as peripherals. It is usual to have over 6-8 different interfaces on one ARM chipset. You will never have to think about “bit-banging” your external chips/hardware again.Such high integration also means smaller PCBs and simpler design – which can save you a lot of money as a hobbyist or if you choose to develop your own products.
- Increased memory: Don’t expect to see 16MB of flash! More memory usually means about 512kB or 1MB of on-chip flash. But again, the hybrid instruction set makes for very high code density. You can code a full-featured MP3 player in just 400kB of flash. Also, the cache and pipeline mechanisms help speed up flash access so that one instruction is executed for each clock cycle. There are almost no wait states in ARM processors if you do your programming properly.Also, RAM is directly connected to internal system bus (usually called the AHB) and is extremely high speed. You usually get over 16-23kB of RAM on a typical ARM7 chip.When you switch to ARM devices with external flash/RAM, you can go as high as 64 or 128MB for RAM and flash memory options.
- Fully configurable: This is one of the most compelling features you will find on ARM chipsets. Every single peripheral is fully configurable – down to every minute detail. For example, on the serial interface hardware you can even decide the high-time and low-time for the clock signal. For the UART, you can have zero-error baud rates and hardware support for parity checking, and many more such features that realize your application beautifully and professionally.
For the more advanced users, the clock control features can mean complete control over digital switching noise and power dissipation. Don’t you like it when your idling laptop slows its processor down to conserve power? All ARM chips are capable of clock scaling. You can even scale down clock for certain peripherals to reduce power consumption.
Now that you have an idea of what ARM can do for turning your concepts and ideas into a functioning prototype, you can opt for the best tool at hand for your next embedded project.
The tutorial series will be centred on developing applications for the NXP LPC214x series of ARM7 microcontrollers (powered by ARM7TDMI-S core). To set up the development environment for getting started with programming the LPC214x, please refer to the next article, “Development Environment for programming the ARM7”.
This is great for people like me. I am very comfortable with 8051 series & ATMega series, but was “scared” to go on a new learning curve at 60 years. I would appreciate if you can have a printable version of this series which can be downloaded, printed and read at leisure or on the worktable.
I use Atmel Studio for AVR’s
Thanks and hoping you have many examples in this series.