LPC_2148_EMBEDDED_SYSTEM

SYLLABUS

MICROCONTROLLER AND EMBEDDED SYSTEMS

Course Code

21CS43

CIE Marks

50

Teaching Hours/Week (L:T:P: S)

3:0:2:0

SEE Marks

50

Total Hours of Pedagogy

40 T + 20 P

Total Marks

100

Credits

04

Exam Hours

03

Course Learning Objectives:

CLO 1: Understand the fundamentals of ARM-based systems, including programming modules with registers and the CPSR.

CLO 2: Use the various instructions to program the ARM controller.

CLO 3: Program various embedded components using the embedded C program.

CLO 4: Identify various components, their purpose, and their application to the embedded system's applicability.

CLO 5: Understand the embedded system's real-time operating system and its application in IoT.

Teaching-Learning Process (General Instructions)

 

These are sample Strategies, which teachers can use to accelerate the attainment of the various course outcomes.

1.        The lecturer method (L) does not mean only the traditional lecture method, but different types of teaching methods may be adopted to develop the outcomes.

2.        Show video/animation films to explain the functioning of various concepts.

3.        Encourage collaborative (group learning) learning in the class.

4.        Ask at least three HOT (Higher order Thinking) questions in the class, which promotes critical thinking.

5.        Adopt Problem Based Learning (PBL), which fosters students’ Analytical skills, develop thinking skills such as the ability to evaluate, generalize, and analyze information rather than simply recall it.

6.        Topics will be introduced in multiple representations.

7.        Show the different ways to solve the same problem and encourage the students to come up with their own creative ways to solve them.

8.        Discuss how every concept can be applied to the real world, and when that's possible, it helps

improve the students' understanding.

Module-1

Microprocessors versus Microcontrollers, ARM Embedded Systems: The RISC design philosophy, The ARM Design Philosophy, Embedded System Hardware, Embedded System Software.

 

ARM Processor Fundamentals: Registers, Current Program Status Register, Pipeline, Exceptions, Interrupts, and the Vector Table, Core Extensions

 

Textbook 1: Chapter 1 - 1.1 to 1.4, Chapter 2 - 2.1 to 2.5

Laboratory Component:

1.     Using Keil software, observe the various registers, dump, CPSR, with a simple ALP programme.

Teaching-Learning Process

1.        Demonstration of registers, memory access, and CPSR in a programme module.

2.        For concepts, numerical, and discussion, use chalk and a

whiteboard, as well as a PowerPoint presentation.

Module-2

Introduction to the ARM Instruction Set: Data Processing Instructions , Branch Instructions, Software Interrupt Instructions, Program Status Register Instructions, Coprocessor Instructions, Loading Constants

C Compilers and Optimization :Basic C Data Types, C Looping Structures, Register Allocation, Function Calls, Pointer Aliasing,

 

Textbook 1: Chapter 3: Sections 3.1 to 3.6 (Excluding 3.5.2), Chapter 5

Laboratory Component:

2.        Write a program to find the sum of the first 10 integer numbers.

3.        Write a program to find the factorial of a number.

4.        Write a program to add an array of 16 bit numbers and store the 32 bit result in internal RAM.

5.        Write a program to find the square of a number (1 to 10) using a look-up table.

6.        Write a program to find the largest or smallest number in an array of 32 numbers.

Teaching-Learning Process

1.        Demonstration of sample code using Keil software.

2.        Laboratory Demonstration

Module-3

C Compilers and Optimization :Structure Arrangement, Bit-fields, Unaligned Data and Endianness, Division, Floating Point, Inline Functions and Inline Assembly, Portability Issues.

 

ARM programming using Assembly language: Writing Assembly code, Profiling and cycle counting, instruction scheduling, Register Allocation, Conditional Execution, Looping Constructs

 

Textbook 1: Chapter-5,6

Laboratory Component:

1.        Write a program to arrange a series of 32 bit numbers in ascending/descending order.

2.        Write a program to count the number of ones and zeros in two consecutive memory locations.

3.        Display “Hello World” message using Internal UART.

Teaching-Learning Process

1.        Demonstration of sample code using Keil software.

2.        Chalk and Board for numerical

Module-4

Embedded System Components: Embedded Vs General computing system, History of embedded systems, Classification of Embedded systems, Major applications areas of embedded systems, purpose of embedded systems.

Core of an Embedded System including all types of processor/controller, Memory, Sensors, Actuators, LED, 7 segment LED display, stepper motor, Keyboard, Push button switch, Communication Interface (onboard and external types), Embedded firmware, Other system components.

 

Textbook 2: Chapter 1 (Sections 1.2 to 1.6), Chapter 2 (Sections 2.1 to 2.6)

Laboratory Component:

1.        Interface and Control a DC Motor.

2.        Interface a Stepper motor and rotate it in clockwise and anti-clockwise direction.

3.        Determine Digital output for a given Analog input using Internal ADC of ARM controller.

4.        Interface a DAC and generate Triangular and Square waveforms.

5.          Interface a 4x4 keyboard and display the key code on an LCD.

6.        Demonstrate the use of an external interrupt to toggle an LED On/Off.

7.        Display the Hex digits 0 to F on a 7-segment LED interface, with an appropriate delay in

between.

Teaching-Learning Process

1.        Demonstration of sample code for various embedded components using keil.

2.        Chalk and Board for numerical and discussion

Module-5

RTOS and IDE for Embedded System Design: Operating System basics, Types of operating systems, Task, process and threads (Only POSIX Threads with an example program), Thread preemption, Multiprocessing and Multitasking, Task Communication (without any program), Task synchronization issues – Racing and Deadlock, Concept of Binary and counting semaphores (Mutex example without any program), How to choose an RTOS, Integration and testing of Embedded hardware and firmware, Embedded system Development Environment – Block diagram (excluding Keil), Disassembler/decompiler, simulator, emulator and debugging techniques, target hardware debugging, boundary scan.

 

Textbook 2: Chapter-10 (Sections 10.1, 10.2, 10.3, 10.4 , 10.7, 10.8.1.1, 10.8.1.2, 10.8.2.2, 10.10

only), Chapter 12, Chapter-13 ( block diagram before 13.1, 13.3, 13.4, 13.5, 13.6 only)

Laboratory Component:

1.     Demonstration of IoT applications by using Arduino and Raspberry Pi

Teaching-Learning Process

1.        Chalk and Board for numerical and discussion

2.        Significance of real time operating system[RTOS] using raspberry pi

Course outcome (Course Skill Set)

At the end of the course, the student will be able to:

CO 1. Explain C-Compilers and optimization

CO 2. Describe the ARM microcontroller's architectural features and program module. CO 3. Apply the knowledge gained from programming on ARM to different applications. CO 4. Program the basic hardware components and their application selection method.

CO 5. Demonstrate the need for a real-time operating system for embedded system applications.

Assessment Details (both CIE and SEE)

The weightage of Continuous Internal Evaluation (CIE) is 50% and for Semester End Exam (SEE) is 50%. The minimum passing mark for the CIE is 40% of the maximum marks (20 marks). A student shall be deemed to have satisfied the academic requirements and earned the credits allotted to each subject/ course if the student secures not less than 35% (18 Marks out of 50) in the semester-end examination (SEE), and a minimum of 40% (40 marks out of 100) in the sum total of the CIE (Continuous Internal Evaluation) and SEE (Semester End Examination) taken together

Continuous Internal Evaluation:

Three Unit Tests each of 20 Marks (duration 01 hour)

1.        First test at the end of 5th week of the semester

2.        Second test at the end of the 10th week of the semester

3.              Third test at the end of the 15th week of the semester Two assignments each of 10 Marks

4.        First assignment at the end of 4th week of the semester

5.        Second assignment at the end of 9th week of the semester

 

Practical Sessions need to be assessed by appropriate rubrics and viva-voce method. This will contribute to 20 marks.

 

·         Rubrics for each Experiment taken average for all Lab components 15 Marks.

·         Viva-Voce– 5 Marks (more emphasized on demonstration topics)

 

The sum of three tests, two assignments, and practical sessions will be out of 100 marks and will be

scaled down to 50 marks

(to have a less stressed CIE, the portion of the syllabus should not be common /repeated for any of the methods of the CIE. Each method of CIE should have a different syllabus portion of the course).

CIE methods /question paper has to be designed to attain the different levels of Bloom’s taxonomy as per the outcome defined for the course.

 

Semester End Examination:

Theory SEE will be conducted by University as per the scheduled timetable, with common question papers for the subject (duration 03 hours)

1.        The question paper will have ten questions. Each question is set for 20 marks. Marks scored shall be proportionally reduced to 50 marks

2.        There will be 2 questions from each module. Each of the two questions under a module (with a maximum of 3 sub-questions), should have a mix of topics under that module.

The students have to answer 5 full questions, selecting one full question from each module

Suggested Learning Resources:

Textbooks

1.        Andrew N Sloss, Dominic Symes and Chris Wright, ARM system developers guide, Elsevier, Morgan Kaufman publishers, 2008.

2.        Shibu K V, “Introduction to Embedded Systems”, Tata McGraw Hill Education, Private Limited, 2nd Edition.

Reference Books

1.        Raghunandan. G.H, Microcontroller (ARM) and Embedded System, Cengage learning Publication,2019

2.        The Insider’s Guide to the ARM7 Based Microcontrollers, Hitex Ltd.,1st edition, 2005.

3.        Steve Furber, ARM System-on-Chip Architecture, Second Edition, Pearson, 2015.

4.        Raj Kamal, Embedded System, Tata McGraw-Hill Publishers, 2nd Edition, 2008.

Weblinks and Video Lectures (e-Resources):

Activity Based Learning (Suggested Activities in Class)/ Practical Based learning




The LPC2148 microcontrollers are based on a 32-bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combine microcontroller with embedded high-speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty. 
Due to their tiny size and low power consumption, LPC2148 are ideal for applications where miniaturization is a key requirement, such as access control and point-of-sale. Serial communications interfaces ranging from a USB 2.0 Full-speed device, multiple UARTs, SPI, SSP to I 2 C-bus and on-chip SRAM of 8 kB up to 40 kB, make these devices very well suited for communication gateways and protocol converters, soft modems, voice recognition and low end imaging, providing both large buffer size and high processing power. Various 32-bit timers, single or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or level sensitive external interrupt
pins make these microcontrollers suitable for industrial control and medical systems.
The meaning of LPC is Low Power Low Cost microcontroller. This is 32 bit microcontroller manufactured by Philips semiconductors (NXP) .
Features of ARM Microcontroller
  •  16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
  •  8 kB to 40 kB of on-chip static RAM and 32 kB to 512 kB of on-chip flash memory; 128-bit wide interface/accelerator enables high-speed 60 MHz operation.
  • In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot loader software, single flash sector or full chip erase in 400 ms and programming of 256 Bytes in 1 ms Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real Monitor software and high-speed tracing of instruction execution.
  • USB 2.0 Full-speed compliant device controller with 2kB of endpoint RAM. In addition, the LPC2148 provides 8 kB of on-chip RAM accessible to USB by DMA.
  • One or two (LPC2141/42 vs, LPC2144/46/48) 10-bit ADCs provide a total of 6/14 analog inputs, with conversion times as low as 2.44 ms per channel.
  •  Single 10-bit DAC provides variable analog output (LPC2148 only)
  •  Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit (six outputs) and watchdog. 
  • Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input. 
  • Multiple serial interfaces including two UARTs , two Fast I2C-bus (400 kbit/s),SPI and SSP with buffering and variable data length capabilities. 
  • Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses. 
  • Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package. 
  • Up to nine edge or level sensitive external interrupt pins available. 
  • 60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100 ms.
  • Power saving modes include Idle and Power-down Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power optimization. 
  • Processor wake-up from Power-down mode via external interrupt or BOD. 
  • Single power supply chip with POR and BOD circuits
 CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O.

BLOCK DIAGRAM
LPC2148 Pin Diagram


DATA SHEET FOR LPC 2148 CLICK Here: DATASHEET_LPC2148
USER MANUAL FOR ALS-SDA-ARM7-06



Introduction

General-purpose input/output (GPIO) is a pin on an IC (Integrated Circuit). It can be either input pin or output pin, whose behaviour can be controlled at the run time. A group of these pins is called a port (Example, Port 0 of LPC2148 has 32 pins).
LPC2148 has two 32-bit General Purpose I/O ports.
1.  PORT0
2.  PORT1
PORT0 is a 32-bit port
  • Out of these 32 pins, 28 pins can be configured as either general purpose input or output.
  • 1 of these 32 pins (P0.31) can be configured as general-purpose output only.
  • 3 of these 32 pins (P0.24, P0.26 and P0.27) are reserved. Hence, they are not available for use. Also, these pins are not mentioned in pin diagram.
PORT1 is also a 32-bit port. Only 16 of these 32 pins (P1.16 – P1.31) are available for use as general-purpose input or output.
Almost every pin of these two ports has some alternate function available. For example, P0.0 can be configured as the TXD pin for UART0 or as PWM1 pin as well. The functionality of each pin can be selected using the Pin Function Select Registers.

Note : The Port 0 pins do not have built-in pull-up or pull-down resistors. Hence, while using GPIOs on Port 0, in some cases,  we need to connect pull-up or pull-down resistors externally.

Fast and Slow GPIO Registers

There are 5 Fast (also called Enhanced GPIO Features Registers) GPIO Registers and 4 Slow (also called Legacy GPIO Registers) GPIO Registers available to control PORT0 and PORT1.
The Slow Registers allow backward compatibility with earlier family devices using the existing codes.

Slow GPIO Registers
There are 4 Slow GPIO registers :
1.  IOxPIN (GPIO Port Pin value register): This is a 32-bit wide register. This register is used to read/write the value on Port (PORT0/PORT1). But care should be taken while writing. Masking should be used to ensure write to the desired pin.
                  Examples :
                  a) Writing 1 to P0.4 using IO0PIN
                       IO0PIN = IO0PIN | (1<<4)
                  b) Writing 0 to P0.4 using IO0PIN
                       IO0PIN = IO0PIN & (~(1<<4) )
                  c) Writing F to P0.7-P0.4
                       IO0PIN = IO0PIN | (0x000000F0)

2.  IOxSET (GPIO Port Output Set register) : This is a 32-bit wide register. This register is used to make pins of Port (PORT0/PORT1) HIGH. Writing one to specific bit makes that pin HIGH. Writing zero has no effect.

3.  IOxDIR (GPIO Port Direction control register) : This is a 32-bit wide register. This register individually controls the direction of each port pin. Setting a bit to ‘1’ configures the corresponding pin as an output pin. Setting a bit to ‘0’ configures the corresponding pin as an input pin.

4.  IOxCLR (GPIO Port Output Clear register) : This is a 32-bit wide register. This register is used to make pins of Port LOW. Writing one to specific bit makes that pin LOW. Writing zeroes has no effect.
                  Examples :
                  a)  Configure pin P0.0 to P0.3 as input pins and P0.4 to P0.7 as output pins.
                        IO0DIR = 0x000000F0;
                  b)  Configure pin P0.4 as an output. Then set that pin HIGH.
                        IO0DIR = 0x00000010; OR IO0DIR = (1<<4);
                        IO0SET = (1<<4);
                  c)  Configure pin P0.4 as an output. Then set that pin LOW.
                        IO0DIR = 0x00000010; OR IO0DIR = (1<<4);
                        IO0CLR = (1<<4);


About Keil - CLICK HERE   KEIL_Intro
About Assembly Code Click here- arm assembly
Steps to execute ARM assembly programs Click here-  Video_Steps
Some Programs- Example Programs for Practice

PART A: ASSEMBLY PROGRAMS

PART B: INTERFACING PROGRAMS







NEW FEATURES ADDED TO MY APP DOWNLOAD APP BY CLICKING LINK





No comments:

Post a Comment