With the exponentially increasing modernization in Electronics Field, particularly in Embedded systems, it’s now a necessary step for Engineers, students and hobbyists to move along with Industry. There’s a need to grasp skills on recent industrial tools and systems.
ARM Processors are one of such advancements in Embedded stream which serve as major platform for many of the modern systems.
This article covers some basic questions about ARM, viz.,
· What is ARM ?
· Why ARM ?
· How to begin with ARM ?
· First Program (Blinking LEDs).
Before getting familiar with ARMs, one must be thorough about basic concepts of Digital Electronics and Basic Microprocessor/Controllers (such as 8085, 8051).
An Important plus point of this tutorial is that it is based on Proteus Simulation software. So everyone can learn ARM without even purchasing an actual Hardware Board for ARM (that would cost you at least 1000-1500 INR)
Let’s now move on ARM :
What is ARM ?
ARM stands for 32 bit Advanced RISC (Reduced Instruction Set Computer) Machines designed and licensed by British company ARM Holdings. As an IP core business, ARM Holdings itself does not manufacture its own electronic chips, but licenses its designs to other semiconductor manufacturers. ARM-based processors and systems on a chip include the Qualcomm Snapdragon, TI, etc.
Using a RISC based approach to computer design, ARM processors require significantly fewer transistors than processors that would typically be found in a traditional computer. The benefits of this approach are reduced costs, heat and power usage compared to more complex chip designs, traits which are desirable for light, portable, battery-powered devices such as smart phones and tablet computers.
Is ARM a Microprocessor or a Microcontroller ?
Technically, ARM is a microprocessor, or, more specifically, a microprocessor architecture. The thing to understand, though, is that it doesn’t represent a physical microprocessor, but the design that allows to build one.
ARM Holdings is a multinational semiconductor group that doesn’t manufacture any CPU; instead, they design them and then sell the architecture under licensing. The designs are used to build microprocessors as well as microcontrollers, but what ARM provides is just the core.
It’s also wrong to say that it’s a microcontroller, because it’s the manufacturer that takes the ARM core and build all the peripherals around it.
Like ‘LPC2138’ is an ARMv7 based microcontroller by NXP, ‘STM32’ is from ST-microelectronics, etc.
Why ARM ?
So, what make the ARM architecture so special…
The sales pitch goes something like this, “The ARM architecture has the best MIPS (Million Instructions per Second) to Watts ratio as well as best MIPS to $ ratio in the industry; the smallest CPU die size; all the necessary computing capability coupled with low power consumption of which a highly flexible and customizable set of processors are available with options to choose from, all at a low cost.”
The ARM architecture includes the following RISC features:
· Load/store architecture. – a load/store architecture only allows memory to be accessed by load and store operations, and all values for an operation need to be loaded from memory and be present in registers. Following the operation, the result needs to be stored back to memory. For instance, in a load/store approach both operands for an ADD operation must be in registers. This differs from a register memory architecture in which one of the operands for the ADD operation may be in memory, while the other is in a register.
- Uniform 16 × 32-bit register file.
- Fixed instruction width of 32 bits to ease decoding and pipelining, at the cost of decreased code density. Later, the Thumb instruction set increased code density.
- Mostly single clock-cycle execution.
Features of ARM
Let’s now explore the Features of our ARM Microcontroller :
We’ll be using ARM 7 based microcontroller from NXP-Philips i.e. LPC2138
Due to their tiny size and low power consumption, the LPC2138 microcontrollers are ideal for applications where miniaturization is a key requirement, such as access control and point-of-sale.
Its Features are as :
· FLASH (kB) 512
· RAM (kB) 32
· fmax (MHz) 60
· I/Opins 47
· UART 2
· ²C 2
· SPI 1
· SSP 1
· ADC 16
· DAC 1
· Timers 3
· PWM 6
· I/O supply voltage (V) 3.3
· CPU supply voltage (V) 3.3
The LPC2138 microcontrollers are based on a 16/32-bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combine the microcontroller with 512 kB of embedded high-speed flash memory. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at maximum clock rate.
For CPU Architecture, Modes, Registers etc, refer to the Tutorial by EG.
We will start the most commonly used thing of the controller i.e the Input/Output Pins know as GPIO Pins (General Purpose Input Output Pins), on reset Pin Connect Block configures all the peripherals as GPIO pins.
The GPIO pins are controlled by four Registers:-
- IOPIN Register is used to get the status of the pins.
- IODIR Register is used to set the direction of the pins, when set to 1 means output and when 0 means input.
- IOSET Register is used to set the GPIO pins.
Project Source Code
Project Source Code
###
*************Code 0****************
#include <LPC213X.H> // Header file for LPC Devices
int main()
{
unsigned char k;IODIR0 = 0x000000FF; //Port-0.0 to Port-0.7 pins as Output Pin
for(k=0;k<5;k++) //Do Pin Toggling 5-times
{
IOSET0 = 0x000000FF; //P0.0 to P0.7 are high
IOCLR0 = 0x000000FF; //P0.0 to P0.7 are low
}**************Code 1***************
#include <LPC213X.H> // Header file for LPC Devices
int main()
{
unsigned char k;IODIR0 = 0x000000FF; //Port-0.0 to Port-0.7 pins as Output Pin
for(k=0;k<5;k++) //Do Pin Toggling 5-times
{
IOPIN0 = 0x000000FF; //P0.0 to P0.7 are high
IOPIN0 = 0x00000000; //P0.0 to P0.7 are low
}###
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.