In: Electrical Engineering
1.give some examples about I/O components in an embedded system
2.Describe hardware components for a mini embedded system with OS
3.What are embedded system basic requirements?
4.What is ARM processor architecture?
Embedded system is defined as a way of working, performing or organizing one or many tasks according to a fixed set of rules (or) an arrangement in which all the units assemble and work together according to the program or plan. Examples of embedded systems are a watch and a washing machine.
An embedded system is a system that has software embedded in computer hardware. It makes a system dedicated to a specific part of an application or product of a larger system. Depending on the application, the embedded system may be programmable or non-programmable.
Examples of embedded systems include various products such as washing machines, microwave ovens, cameras, printers and automobiles. They use microprocessors and microcontrollers as well as specially designed processors such as digital signal processors (DSP).
All embedded systems include some form of input and output (I/O) operations
Examples of embedded systems built explicitly to deal with I/O devices: Cell phone, pager, and a handheld MP3 player
I/O operations are interpreted differently depending on the viewpoint taken and place different requirements on the level of understanding of the hardware details
Interfaces between a device and the main processor occur in two ways: port mapped and memory mapped
DMA controllers allows data transfer bypassing the main processor
I/O subsystems must be flexible enough to handle a wide range of I/O devices.
Uniform I/O hides device peculiarities from applications.
The I/O subsystem maintains a driver table that associates uniform I/O calls with driverspecific I/O routines.
The I/O subsystem maintains a device table and forms an association between this table and the driver table
Embedded System Hardware:
As with any electronic system, an embedded system requires a hardware platform on which it performs the operation. Embedded system hardware is built with a microprocessor or microcontroller. The embedded system hardware has elements like input output (I/O) interfaces, user interface, memory and the display. Usually, an embedded system consists of:
How is software embedded into a system?
We need a program written in assembly or in embedded c language. And then we compile it. This compiled code converted into HEX code. This hex code is programmed or burned into the ROM of the system using some programmer.
These are the tools that are generally used in embedded system development
Requirements for Embedded Systems:
Introduction to ARM Microcontroller
The ARM stands for Advanced RISC machine and it is a 32-bit reduced instructions set computer (RISC) microcontroller. It was first introduced by the Acron computers’ organization in 1987. The ARM is a family of the microcontroller developed by the different manufacturers such as ST microelectronics, Motorola and so on. The ARM microcontroller architecture come with a few different versions such as ARMv1, ARMv2 etc and each one has its own advantage and disadvantages.
Implementation of ARM Cortex Microcontroller
The ARM cortex microcontroller is an advanced microcontroller in the ARM family, which is developed by the ARMv7 architecture. The ARM cortex family divided into three sub-families such as;
ARM Coretex-M3 Microcontroller Architecture
The cortex-M3 ARM processor is a high performance 32-bit processor, which offers the significant benefits to the developers. The ARM architecture is a ‘Harward architecture’ which offers separate data and instruction buses for communicating with the ROM and RAM memories. It consist a 3-stage pipeline to fetch, decode and execute the instructions sequentially. The Cortex processor is a cost sensitive device which is used to reduce the processor area and has extensive improving interrupt handling and system debug capabilities.
ARM Coretex-M3 Microcontroller Architecture
The cortex-M3 arm processors are implemented by THUMB instruction set based on THUMB-2 technology, therefore, ensures high code density and reduce the program memory requirement. The cortex-m3 instruction set provides the excellent performance due to modern 32-bit architecture. The ARM processor core-m3 is closely integrated to Nested Vector Interrupt Controller (NVIC) to provide the good interrupt performance.
Additional Features of the Cortex-M3 Processor
It is a RISC Controller
It has THUMB-2 technology
It supports tools and RTOS and It has core Sight debug and trace
Low power Modes
Nested vectored interrupt controller (NVIC)
ARM Microcontroller Register Modes
An ARM micrcontroller is a load store reducing instruction set computer architecture means the core cannot directly operate with the memory. The data operations must be done by the registers and the information is stored in the memory by an address. The ARM cortex-M3 consists of 37 register sets wherein 31 are general purpose registers and 6 are status registers. The ARM uses seven processing modes to run the user task.
ARM Microcontroller Register Modes
USER Mode: The user mode is a normal mode, which has the least number of registers. It doesn’t have SPSR and has limited access to the CPSR.
FIQ and IRQ: The FIQ and IRQ are the two interrupt caused modes of the CPU. The FIQ is processing interrupt and IRQ is standard interrupt. The FIQ mode has additional five banked registers to provide more flexibility and high performance when critical interrupts are handled.
SVC Mode: The Supervisor mode is the software interrupt mode of the processor to start up or reset.
Undefined Mode: The Undefined mode traps when illegal instructions are executed. The ARM core consists of 32-bit data bus and faster data flow.
THUMB Mode: In THUMB mode 32-bit data is divided into 16-bits and increases the processing speed.
THUMB-2 Mode: In THUMB-2 mode the instructions can be either 16-bit or 32-bit and it increases the performance of the ARM cortex –M3 microcontroller. The ARM cortex-m3 microcontroller uses only THUMB-2 instructions.
Some of the registers are reserved in each mode for the specific use of the core. The reserved registers are
The reserved registers are used for specific functions. The SPSR and CPSR contain the status control bits which are used to store the temporary data. The SPSR and CPSR register have some properties that are defined operating modes, Interrupt enable or disable flags and ALU status flag. The ARM core operates in two states 32-bit state or THUMBS state.
ARM-Cortex Microcontroller Programming
In the present days, the microcontroller vendors are offering 32-bit microcontrollers based on ARM cortex-m3 architecture. Many embedded system developers are starting to use these 32-bit microcontrollers for their projects. The ARM microcontrollers supports for both low-level and high level programming languages. Some of the traditional microcontroller architectures are made with many limitations therefore, difficult to use the high level programming language.
ARM-Cortex Microcontroller Programming
For example the memory size is limited and performance might not be sufficient. The ARM microcontrollers runs at 100Mhz frequency and higher performance, therefore it supports the higher level languages. The ARM microcontroller is programmed with different IDES such as keiluvision3, keiluvision4, coocox and so on. A 8-bit microcontroller use 8-bit instructions and the ARM cortex-M uses a 32-instructions.
The ARM Microcontroller Assembly Level Programming:
The ARM cortex microcontroller is a 32-bit microcontroller therefore all instructions are 32-bit long which is executed in a single cycle. It consists of an instruction set to perform the arithmetic, logical and boolean operations. The ARM is a load-store architecture, then instructions are executed conditionally.
Syntax: Load a // a obtained the value from the place called a
//
ADD12 // 12 is added to the load value a //
Store a // final value is stored in the variable a//
The assembly language programming is developed by the mnemonics such as ADD, SUB, MUL so on but for ARM programming, some extra instructions added such as ADCNES and SWINE, etc.
EX: 1. ORG 0000h
MOV r1, #10
MOV r2, #15
ADD r3, r2, r1 // r3=r2+r1 and the final value stored in r3
register//
2.ORG 0000h
MOV r1, #10
MOV r2, #15
SUB r3, r2, r1 // r3=r2-r1 and the final value stored in r3
register//
The ARM Coretex-M3 Microcontroller Embedded C Level Programming:
WAP to toggle the single LED through Embedded C language using ARM cortex microcontroller.
#include “stm32f10x_gpio.h”
#include “stm32f10x_rcc.h”
GPIO_InitTypeDef GPIO_InitStructure;
int i;
#define LED_PORT GPIOB
Void binky();
Void main()
{
Void binky();
}
void binky(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //enable the
PORTB pins//
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //set
the port frequency//
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //set
the PORTB in output//
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All ; //enabled
all PORTB pins//
GPIO_Init(GPIOB, &GPIO_InitStructure); //initialize the PORTB
pins//
while(1){
GPIO_WriteBit(LED_PORT,GPIO_Pin_8,Bit_SET);
for (i=0;i<1000000;i++);
GPIO_WriteBit(LED_PORT,GPIO_Pin_8,Bit_RESET);
for (i=0;i<1000000;i++);
GPIO_WriteBit(LED_PORT,GPIO_Pin_9,Bit_SET);
for (i=0;i<1000000;i++);
GPIO_WriteBit(LED_PORT,GPIO_Pin_9,Bit_RESET);
for (i=0;i<1000000;i++);
GPIO_WriteBit(LED_PORT,GPIO_Pin_10,Bit_SET);
for (i=0;i<1000000;i++);
GPIO_WriteBit(LED_PORT,GPIO_Pin_10,Bit_RESET);
for (i=0;i<1000000;i++);
}
}
This is about the ARM microcontroller architecture with neat sketches and arm programing with example programs.