0% found this document useful (0 votes)
195 views19 pages

ARM Based Microcontrollers

This document discusses ARM Cortex-M3 microcontrollers and provides details about the ARM Cortex-M3 architecture. It describes the Harvard architecture, 3-stage pipelining, 32-bit registers, load-store model, exceptions, and operating modes of the Cortex-M3. It also discusses programming ARM Cortex-M3 microcontrollers using the LPC1769 and provides examples of configuring GPIO pins using registers like FIOxDIR, FIOxPIN, FIOxSET, and FIOxCLR.

Uploaded by

Navin Khatri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
195 views19 pages

ARM Based Microcontrollers

This document discusses ARM Cortex-M3 microcontrollers and provides details about the ARM Cortex-M3 architecture. It describes the Harvard architecture, 3-stage pipelining, 32-bit registers, load-store model, exceptions, and operating modes of the Cortex-M3. It also discusses programming ARM Cortex-M3 microcontrollers using the LPC1769 and provides examples of configuring GPIO pins using registers like FIOxDIR, FIOxPIN, FIOxSET, and FIOxCLR.

Uploaded by

Navin Khatri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

ARM BASED

MICROCONTROLLERS
Review-2

PRESENTED BY :-
Navin Khatri(17BEE054)
Sandeep Nandaniya(17BEE053)
GUIDED BY :-
Prof. Dhara M. Mehta
Review-1 Recap...
• What are Microcontrollers?
• What is ARM?
• ARM Family Tree
• CORTEX -M: CORE+ Peripherals
• ARM Microcontroller Manufacturers
• LPC1769 32-bit Cortex-M3 Microcontroller
• Harvard Architecture vs Von Neumann Architecture
Why to choose ARM CORTEX-M3?

Main Focus
ARM Core Architecture

● Harvard architecture (separate command and data bus)


● 3 stage Pipelining (Fetch-Decode-Execute)
● 32-bit register
● 32-bit data bus
● 32-bit address bus (4 GB address space)
● 32-bit memory transfer
● RISC Instruction Set
● 32-bit and 16-bit Instruction sets
Cortex-M3 Block Diagram
ARM Cortex-M3 Pipelining
Cortex-M3 Operating Modes
Exceptions
• Internal – Memory Protection Fault
• External – Bus error
• Synchronous – SVC instruction
• Asynchronous – Timer Interrupt
32-bit Registors
• RISC processors are heavily based on Registers. Where the CISC
processors works most of the time on memory.
• CISC processor,
• For example, in 8086 having 4 usable 16-bit Registers.
• RISC processor,
• For example, in ARM v7 there are 37 number of 32-bit Registers.
• From which 16 are available at a time.
Load-Store Model
• Performing any operation on the registers instead of memory

• 3 stages

• Stage-1 : Load the data to registers from memory.


• Stage-2 : Perform calculation on registers.
• Stage-3 : Store the output data to the memory.
LPC1769 Features
• ARM cortex-M3 processor, running at frequency of 120 MHz.
• A Memory Protection Unit supporting 8 regions is included.
• Built in Nested Vectored Interrupt Controller(NVIC).
• Enhanced flash memory accelerator enables high speed 120 MHz
operation with zero wait states.
• Multiple peripheral like : 4 UARTs, 2 CAN channels, 2 SSP Controllers,
SPI interface, 3 I2C-bus interfaces, 2-input plus 2- output I2S-bus
interface, 8 channel 12-bit ADC, 10-bit DAC, 6 output PWM, 4 Timers.
• It is also having GPIO pins.
Programming in Real world
• Prerequirement:
• LPC1769 microcontroller
• USB LPC2xxx and P89xxx Programmer ========>
• Installed Keil μvision5 IDE
• Installed Flash Magic used for programming

• Data structures that we have used here are defined in LPC17xx.h and
LPC17xx_1.h header file. These header files are based on CMSIS(Cortex
Microcontroller System Interface Standard) developed by ARM.
Programming in LPC1769
• GPIO(General Purpose Input Output)

• 70 pins of GPIO

• PORT0 (0 - 30) excluding 12, 13, 14


• PORT1 (0 - 31) excluding 2, 3, 5, 6, 7, 11, 12, 13
• PORT2 (0 - 13)
• PORT3 (25 - 26)
• PORT4 (28 - 29)
• Here PORT0 can also be written as P0, similarly P1, P2, P3, P4 are written
instead of PORT1, PORT2, PORT3, PORT4.
Fast GPIO(FIO)
• FIODIR: Configures the pin as Input or Output.

• FIOPIN: Used to Store the State of Perticular Pin.

• FIOSET: Set the pin as Logic level 1 (High).

• FIOCLR: Reset the pin as Logic Level 0 (Low).


FIOxDIR
• Fast GPIO Direction PORTx control bits. Bit 0 in FIOxDIR controls pin
Px.0, bit 31 in FIOxDIR controls pin Px.31.
• FIO0DIR, FIO1DIR, FIO2DIR, FIO3DIR, FIO4DIR.
• Controlled pin is at Input has value 0.
• Controlled pin is at Output has value 1.
• for example, If we want to configure P0.15 as output, then we have to
write as written below
FIO0DIR = 0b00000000000000000100000000000000 ; //IN Binary
// or
FIO0DIR = 0x00000080 ; //IN Hexadecimal
FIOxPIN
• This Register will give the Logic Level value of that perticular pin
regardless of whether the pin is configured for input or output.
• Here, The data type Word is devided into 4 bytes.
• for PORT0: FIO0PIN0, FIO0PIN1, FIO0PIN2, FIO0PIN3
• for PORT1: FIO1PIN0, FIO1PIN1, FIO1PIN2, FIO1PIN3
• for PORT2: FIO2PIN0, FIO2PIN1, FIO2PIN2, FIO2PIN3
• for PORT3: FIO3PIN0, FIO3PIN1, FIO3PIN2, FIO3PIN3
• for PORT4: FIO4PIN0, FIO4PIN1, FIO4PIN2, FIO4PIN3
• for example, If we want to read the P0.3, then we have to write as
written below
int Pin0_3;
Pin0_3 = ((FIO0PIN0>>3)&0x01);
FIOxSET
• Fast GPIO output value Set bits. Bit 0 in FIOxSET controls pin Px.0, bit 31 in
FIOxSET controls pin Px.31.
• FIO0SET, FIO1SET, FIO2SET, FIO3SET, FIO4SET
• for example, If we want to Set the P1.23 then we can write as below:
FIO1SET |= (1<<(23)) ; //or
FIO1SET |= 1<<(0b00000000100000000000000000000000) ; //or
FIO1SET |= 1<<(0x00800000) ;

• Here, It is neccesary to declare the pin as output before execution of above


statements in program
FIOxCLR
• Fast GPIO output value Clear bits. Bit 0 in FIOxCLR controls pin Px.0, bit 31 in
FIOxCLR controls pin Px.31.
• FIO0CLR, FIO1CLR, FIO2CLR, FIO3CLR, FIO4CLR
• for example, If we want to clear the P1.23 then we can write as below:
FIO1CLR |= (1<<(23)) ; // Decimal
//or
FIO1SET |= 1<<(0b00000000100000000000000000000000) ; //Binary
//or
FIO1SET |= 1<<(0x00800000) ; //Hexadecimal

• Here, It is neccesary to declare the pin as output before execution of above


statements in program
Blinking LED program
#include<LPC17xx.h>
#include"LPC17xx_1.h"
void delay(void);
int main(void)
{ FIO0DIR = 0x00800000 ; // Configure the pin on Port 0 as Output
while(1)
{ FIO1SET |= (1<<(23)) // Turn on LEDs
delay();
FIO1CLR |= (1<<(23)) // Turn them off
delay(); }
}

• Assume that LED is connected between P1.23 and ground

You might also like