Chapt 6
Chapt 6
E MBEDDED C
S YLLABUS
CPSR
Exception Handling
Memory Management
ARM Family
CISC &RISC
CPSR
E XCEPTIONS
To return from exception handler the CPSR is restored from SPSR and PC from
R14
No extension
Memory with no protection provides very little
flexibility
It is used for small and simple embedded system that
requires no protection
MPU
Memory protection unit is used in simple systems that
use limited memory regions
Special Processor registeres are used to control these
memory regions
MPU is used in system where memory protection is
required but don’t have a complex memory mapping
M EMORY M ANAGEMENT
MMU(FULL PROTECTION)
It uses a set of translation table to provide extensive
control over memory
The translation table are stored in main memory and
they provide virtual physical address translation as
well as access permissions
It gives most compresnhensive memeory
management hardware and platform for multitasking
ARM7 FAMILY
ARM7TDMI,ARM7TDMI-S(implementing the
ARMv5TE instruction set) , ARM7J-S
ARM FAMILY
T HE ARM7 FAMILY
Fast time-to-market
Timer Mode
Port 1
IOPIN: It is a GPIO Port Pin Value register and can be used to read or write values directly
to the pin. The status of the Pins that are configured as GPIO can always be read from this
register irrespective of the direction set on the pin (Input or Output).The syntax for this
register is IOxPIN, where ‘x’ is the port number i.e. IO0PIN for PORT0 and IO1PIN for
PORT1.
IODIR: It is a GPIO Port Direction Control register and is used to set the direction i.e.
either input or output of individual pins. When a bit in this register is set to ‘0’, the
corresponding pin in the microcontroller is configured as Input. Similarly, when a bit is set
as ‘1’, the corresponding pin is configured as Output.The syntax for this register is IOxDIR,
where ‘x’ is the port number i.e. IO0DIR for PORT0 and IO1DIR for PORT1.
IOSET: It is a GPIO Port Output Set Register and can be used to set the value of a GPIO pin
that is configured as output to High (Logic 1). When a bit in the IOSET register is set to ‘1’,
the corresponding pin is set to Logic 1. Setting a bit ‘0’ in this register has no effect on the
pin.
The syntax for this register is IOxSET, where ‘x’ is the port number i.e. IO0SET for PORT0
and IO1SET for PORT1.
IOCLR: It is a GPIO Port Output Clear Register and can be used to set the value of a GPIO
pin that is configured as output to Low (Logic 0). When a bit in the IOCLR register is set to
‘1’, the corresponding pin in the respective Port is set to Logic 0 and at the same time
clears the corresponding bit in the IOSET register. Setting ‘0’ in the IOCLR has no effect on
the pin.
TO GENERATE SQUARE WAVE
while(1)
{
IOCLR = 0x00000700;
delay(); //delay
IOSET = 0x00000700;
delay(); //delay
}
}
LPC2148 T IME R & C OUNTER
Match register(MR0-MR3)