1 The LPC1768 Architecture (with focus on Cortex-M3)

Slides:



Advertisements
Similar presentations
Chung-Ta King National Tsing Hua University
Advertisements

8051 Core Specification.
I/O Unit.
Microcontroller – PIC – 4 PIC types PIC architecture
Introduction of Holtek HT-46 series MCU
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
16.317: Microprocessor System Design I Instructor: Dr. Michael Geiger Spring 2012 Lecture 29: Microcontroller intro.
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
3-1 System peripherals & Bus Structure Memory map of the LPC2300 device is one contiguous 32-bit address range. However, the device itself is made up of.
Lecture 23: LM3S9B96 Microcontroller - Interrupts.
System Clocks.
CORTEX-M0 Structure Discussion 2 – Core Peripherals
LPC2148 Programming Using BLUEBOARD
The 8253 Programmable Interval Timer
3-1 Digital I/O A group of I/O pins is called a PORT  A port is where data enters/leaves the system. Digital I/O pins are usually grouped into 8,16 or.
1 ARM University Program Copyright © ARM Ltd 2013 General Purpose I/O.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lecture 2 Silicon Labs C8051F020 System Overview.
1 LHO 13 The 8051CF020 and the University Daughter Card.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
WISP.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the Direct Memory.
INTRODUCTION TO PIC MICROCONTROLLER. Overview and Features The term PIC stands for Peripheral Interface Controller. Microchip Technology, USA. Basically.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
The Cortex-M3 Embedded Systems: LM3S9B96 Microcontroller – Interrupts Refer to Chapter 4 in the reference book “Stellaris® LM3S9B96 Microcontroller - DATA.
Components of a typical full-featured microcontroller.
Chapter 3. Advanced Hardware Fundamentals The various parts you will commonly find in an embedded-system circuit 발표일시 : 발표자 : 채화영.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
INSTITUTE: INSTITUTE:PARUL INSTITUTE OF TECHNOLOGY BRANCH : BRANCH :B.E. E.C.5 TH SEM. SUBJECT:MICROCONTROLLER & INTERFACING TOPIC:AVR INTTRUPT TOPIC:AVR.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
HOME SECURITY USING WIRELESS SENSOR NETWORK UNDER THE ESTEEMED GUIDANCE OF: P.RAMESH D.SIVOM( ) KANMANI RAVI( ) B.SAI RAJSEKHAR( )
Interrupt 마이크로 프로세서 (Micro Processor) 2015년 2학기 충북대학교 전자공학과 박 찬식
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
The 8085 Microprocessor Architecture
Microcontrollers & GPIO
68HC11 Interrupts & Resets.
Timer and Interrupts.
Refer to Chapter 5 in the reference book
Microprocessor Systems Design I
UNIT – Microcontroller.
Anton Burtsev February, 2017
Refer to Chapter 10 in the reference book
ARM Cortex-M3 RTLAB 박 유 진.
Microprocessor Systems Design I
The 8085 Microprocessor Architecture
Refer to Chapter 3 in the reference book
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
Interrupt and Exception Programming
Interrupt and Exception Programming
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Subject Name: Microcontroller Subject Code: 10ES42
How to use peripherals on MCB1700
Introduction to Microprocessors and Microcontrollers
8254 Timer and Counter (8254 IC).
Interrupt and Exception Programming
Introducing the PIC Mid-Range Family and the 16F84A
8259 Programmable Interrupt Controller
COMPUTER PERIPHERALS AND INTERFACES
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
The 8085 Microprocessor Architecture
8051 Micro Controller.
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
EECE.3170 Microprocessor Systems Design I
Wireless Embedded Systems
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

1 The LPC1768 Architecture (with focus on Cortex-M3)

2 LPC 1768  LPC 1768 is an ARM Cortex-M3 based microcontroller for embedded applications by NXP company  3-stage pipeline, Harvard architecture  Up to 100 Mhz Clock, 12Mhz crystal frequency  On-chip memory: 512KB flash and 64KB RAM  USB  2 CAN interface  2 serial port  Resources from Keil.com

3 LPC 1768 Memory Map (4 GB)

4 Today Agenda LPC1768 Overview GPIO (user manual: chapter 9) System Tick Timer (user manual: chapter 23)

5 LPC 1768 GPIO (ch9)  On Reset, the pin connect block configures all peripheral pins to be general purpose I/O input pins.  The GPIO pins are controlled by five registers, as shown:  FIOxDIRy Fast GPIO Port Direction control register 0: Controlled pin is input; 1: Controlled pin is output  FIOxMASKy Fast Mask register for port. 0: Controlled pion is not masked; 1: controlled pin is masked  FIOxPINy Fast Port pin value register using FIOMASK Provides the value of port pins.  FIOxSET Fast Port Output Set register using FIOMASK 0: Controlled pin output is unchanged; 1: Controlled pin output is ‘1’  FIOxCLR Fast Port Output Clear Register 0: Controlled pin output is unchanged; 1: Controlled pin output is ‘0’

6 LPC 1768 GPIO  GPIO Interrupt register map  IntEnR GPIO Interrupt Enable for Rising Edge  IntEnF GPIO interrupt enable for falling edge  IntStatR GPIO interrupt status for rising edge  IntStatF GPIO interrupt status for falling edge  IntClr GPIO Interrupt Clear  IntStatus GPIO overall Interrupt status

7 LPC 1768 System Tick Timer (ch23)  The System Tick timer is an integral part of the Cortex-M3. the System tick timer is intended to generate a fixed 10 ms (it can be configured) interrupt for use by an RTOS.  The system tick timer is a 24-bit timer that counts down to zero and generates an interrupt.  The system tick timer may be clocked either from the CPU clock CCLK or from the external pin STCLK.

8 LPC 1768 System Tick Timer

9 System Tick Timer Registers

10 Control and Status Registers

11 System Timer Reload Registers

12 ARM CMSIS  CMSIS is a vendor-independent hardware abstraction layer for the Cortex-M processor series. The CMSIS enables consistent and simple software interfaces to the processor and the peripherals, simplifying software re-use, reducing the learning curve for new microcontroller developers and reducing the time to market for new devices.Cortex-M processor  ARM CMSIS Source and download ARM CMSIS Source and download  MDK ARM Primer, MDK ARM Primer,

13 LPC 1768 System Tick Timer (ch23)  In MDK5.10 which supports CMSIS 3.0, simply call the function SysTick_Config(SystemCoreClock/100);  However, in ECE 362 Lab, you are NOT allowed to use CMSIS library.  The period of system tick interrupt time is 1000/100 = 10 ms. typedef struct { __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ } SysTick_Type; #define SysTick_BASE (0xE000E000UL+ 0x0010UL) /*!< SysTick Base Address */ #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */

14 LPC 1768 System Tick Timer (ch23)  typedef struct { __IO uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ __IO uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ __IO uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ __I uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ } SysTick_Type; #define SysTick_BASE (0xE000E000UL+ 0x0010UL) /*!< SysTick Base Address */ #define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ SysTick_Init(uint32_t ticks) { SysTick->LOAD = ticks & 0xFFFFFF - 1; /* set reload register */ NVIC_SetPriority (SysTick_IRQn, 1); /* set Priority for Systick Interrupt */ SysTick->VAL = 0; /* Load the SysTick Counter Value */ SysTick->CTRL = 0x /* Enable SysTick IRQ and SysTick Timer */ return (0); /* Function successful */ }

15 LPC 1768 NVIC (6)  LPC 1768: Nested Vectored Interrupt Controller  NVIC supports 35 vectored interrupts.  32 programmable interrupt priority levels, (0 highest)  Relocateable vector table  Non-Maskable Interrupt (NMI)  Exceptions and hardware interrupts  Interrupts: enable/disable/ active/pending,

16 LPC 1768 NVIC Interests:

17 LPC 1768 PCONP (page 62 chapter 4)  The PCONP register allows turning off selected peripheral functions for the purpose of saving power. This is accomplished by gating off the clock source to the specified peripheral blocks. A few peripheral functions cannot be turned off (i.e. the Watchdog timer, the Pin Connect block, and the System Control block).  Some peripherals, particularly those that include analog functions, may consume power that is not clock dependent. These peripherals may contain a separate disable control that turns off additional circuitry to reduce power. Information on peripheral specific power saving features may be found in the chapter describing that peripheral.  If a peripheral control bit is 1, that peripheral is enabled. If a peripheral control bit is 0, that peripheral’s clock is disabled (gated off) to conserve power. For example if bit 19 is 1, the I2C1 interface is enabled. If bit 19 is 0, the I2C1 interface is disabled.  For example, configure PCONP to use ADC LPC_SC->PCONP |= 1<<12;

18 LPC 1768 pin configuration (ch 7 &8)  I/O pins on the LPC17xx are 5V tolerant and have input hysteresis unless indicated in the table below. Crystal pins, power pins, and reference voltage pins are not 5V tolerant. In addition, when pins are selected to be A to D converter inputs, they are no longer 5V tolerant and must be limited to the voltage at the ADC positive reference pin (VREFP).  One pin may be shared with multiple functions, for example, P0.25 – GPIO (I/O), AD0 (channel 0 input), I2SRX_SDA (I2S I/O), TXD3 (O)  Can be configured using registers PINSELn  Each pin can be configured as pull-down, pull-down, repeater mode, neither pull-down/pull-down, etc. using registers PINMODELn  ARMwizard: a free app to setup ARM registers from mbed for-lpc2xxx-17xx-13xx-1/