Syllabus
Embedded
Controller Lab
B.E.,
VI Semester, Electronics & Communication Engineering/
Telecommunication
Engineering
[As
per Choice Based Credit System (CBCS) scheme]
Subject Code 15ECL67 IA
Marks 20
Number
of Lecture Hours/Week 01Hr Tutorial
(Instructions)+ 02 Hours Laboratory = 03
Exam Marks 80 Exam
Hours 03
CREDITS – 02
Laboratory Experiments
PART-A:
Conduct
the following Study experiments to learn ALP using ARM Cortex M3 Registers
using an Evaluation board and the required software tool.
1.
ALP to multiply two 16 bit binary numbers.
2.
ALP to find the sum of first 10 integer numbers.
PART-B:
Conduct
the following experiments on an ARM CORTEX M3 evaluation board using evaluation
version of Embedded 'C' & Keil Uvision-4 tool/compiler.
1.
Display “Hello World” message using Internal UART.
2.
Interface and Control a DC Motor.
3.
Interface a Stepper motor and rotate it in clockwise and anti-clockwise direction.
4.
Determine Digital output for a given Analog input using Internal ADC of ARM controller.
5.
Interface a DAC and generate Triangular and Square waveforms.
6.
Interface a 4x4 keyboard and display the key code on an LCD.
7.
Using the Internal PWM module of ARM controller generate PWM and vary its duty
cycle.
8.
Demonstrate the use of an external interrupt to toggle an LED On/Off.
9.
Display the Hex digits 0 to F on a 7-segment LED interface, with an appropriate
delay in between.
10.
Interface a simple Switch and display its status through Relay, Buzzer and LED.
11.
Measure Ambient temperature using a sensor and SPI ADC IC.
Conduction
of Practical Examination:
1.
PART-B experiments using Embedded-C are only to be considered for the practical
examination. PART-A ALP programs are for study purpose and can be considered for
Internal Marks evaluation.
2.
Strictly follow the instructions as printed on the cover page of answer script
for breakup of marks.
3.
Change of experiment is allowed only once and 15% of Marks allotted to the procedure
part to be made zero.
Course outcomes:
CO1. Understand the instruction set of 32 bit
microcontroller ARM Cortex M3,
and the software tool required for
programming in Assembly and C
language.
CO2. Develop assembly language programs using ARM Cortex M3
for different
applications.
CO3. Interface external devices and I/O with ARM Cortex M3.
CO4. Develop C language programs and library functions for
embedded system applications.
------------------------------------------------------------------------------------------------------------------------------
Block Diagram of LPC1768FBD10:
LPC1768 is ARM Cortex M3 based micro controller with
512KB flash memory and 64KB SRAM In-System Programming (ISP) and In-
Application Programming (IAP) capabilities.
Single 3.3 V power supply (2.4 V to 3.6 V).
70 General Purpose I/O (GPIO) pins with configurable pull-up/down resistors,
open drain mode, and repeater mode.
12-bit Analog-to-Digital Converter (ADC) and up to 8 analog channels.
10-bit Digital-to-Analog Converter (DAC) with dedicated conversion timer.
Four general purpose timers/counters, with a total of eight capture inputs and ten
compare outputs.
Four UART's with fractional baud rate generation, internal FIFO, IrDA.
SPI controller with synchronous, serial, full duplex communication.
Three enhanced I2C-bus interfaces
Four reduced power modes: Sleep, Deep-sleep, Power-down, and Deep powerdown.
Real-Time Clock (RTC) with a separate power domain.
Standard JTAG test/debug interface as well as Serial Wire Debug.
Four external interrupt inputs configurable as edge/level sensitive.
SOFTWARE/FIRMWARE:
Keil:
1. Keil uvision4 IDE Installation:
Installation of keiluVision4 as follows.
Go to Software folder in the CD and run mdk474.exe file.
A welcome window will appear. Click next on it.
2. Settings to be done at configuration wizard of system_LPC17xx.c file
Before configuring the clock registers study the block diagram which is described in the Clocking and power control.
There are three clock sources for CPU. Select Oscillator clock out of three. This selection is done by CLKSRCSEL register.
If we disable the PLL0 System clock will be bypassed directly into CPU clock divider register.
Use CCLKCFG register for choosing the division factor of 4 to get 3M Hz out of 12 M Hz Oscillator frequency.
For any other peripherals use the PCLK same as CCLK.
Follow the below mentioned procedure to do these settings.
Open uVisoin4 under file tab open
C: Keil (4)\ARM\startup\NXP\LPC17xx\system_LPC17xx.c
Double click on system_LPC17xx.c file at project window
Select the configuration wizard at the bottom
Expand the icons
Select Clock configuration
Under System controls and Status registers
OSCRANGE: Main Oscillator range select 1MHz to 20MHz
OSCEN: Main oscillator enable √
Under Clock source select register (CLKSRCSEL)
CLKSRC: PLL clock source selection Main oscillator
Disable PLL0 configuration and PLL1 configuration
Under CPU Clock Configuration register(CCLKCFG)
CCLKSEL: Divide value for CPU clock for PLL0 4
Under USB Clock configuration register (USBCLKCFG)
USBSEL: Divide value for USB clock for PLL0 4
Under Peripheral clock selection register 0 (PCLKSEL0) and 1 (PCLKSEL1)
Select Pclk = Cclk for all.
Under Power control for peripherals (PCONP)
Enable the power for required peripherals
If CLKOUT to be studied configure the Clock output configuration register as below
CLKOUTSEL : Main Oscillator
CLKOUTDIV : 1
CLKOUT_EN : √
Call the functions
SystemInit ();
SystemCoreClockUpdate ();
At the beginning of the main function without missing.These functions are defined in system_LPC17xx.c where actual clock and other system control registers configuration takes
place.
3. Flash magic 6.01 installations:
Go to Software folder in the CD and run FlashMagic.exe file.
Click next on Welcome wizard and follow the step onscreen.
------------------------------------------------------------------------------------------------------------------------------
Block Diagram of LPC1768FBD10:
LPC1768 is ARM Cortex M3 based micro controller with
512KB flash memory and 64KB SRAM In-System Programming (ISP) and In-
Application Programming (IAP) capabilities.
Single 3.3 V power supply (2.4 V to 3.6 V).
70 General Purpose I/O (GPIO) pins with configurable pull-up/down resistors,
open drain mode, and repeater mode.
12-bit Analog-to-Digital Converter (ADC) and up to 8 analog channels.
10-bit Digital-to-Analog Converter (DAC) with dedicated conversion timer.
Four general purpose timers/counters, with a total of eight capture inputs and ten
compare outputs.
Four UART's with fractional baud rate generation, internal FIFO, IrDA.
SPI controller with synchronous, serial, full duplex communication.
Three enhanced I2C-bus interfaces
Four reduced power modes: Sleep, Deep-sleep, Power-down, and Deep powerdown.
Real-Time Clock (RTC) with a separate power domain.
Standard JTAG test/debug interface as well as Serial Wire Debug.
Four external interrupt inputs configurable as edge/level sensitive.
SOFTWARE/FIRMWARE:
Keil:
1. Keil uvision4 IDE Installation:
Installation of keiluVision4 as follows.
Go to Software folder in the CD and run mdk474.exe file.
A welcome window will appear. Click next on it.
2. Settings to be done at configuration wizard of system_LPC17xx.c file
Before configuring the clock registers study the block diagram which is described in the Clocking and power control.
There are three clock sources for CPU. Select Oscillator clock out of three. This selection is done by CLKSRCSEL register.
If we disable the PLL0 System clock will be bypassed directly into CPU clock divider register.
Use CCLKCFG register for choosing the division factor of 4 to get 3M Hz out of 12 M Hz Oscillator frequency.
For any other peripherals use the PCLK same as CCLK.
Follow the below mentioned procedure to do these settings.
Open uVisoin4 under file tab open
C: Keil (4)\ARM\startup\NXP\LPC17xx\system_LPC17xx.c
Double click on system_LPC17xx.c file at project window
Select the configuration wizard at the bottom
Expand the icons
Select Clock configuration
Under System controls and Status registers
OSCRANGE: Main Oscillator range select 1MHz to 20MHz
OSCEN: Main oscillator enable √
Under Clock source select register (CLKSRCSEL)
CLKSRC: PLL clock source selection Main oscillator
Disable PLL0 configuration and PLL1 configuration
Under CPU Clock Configuration register(CCLKCFG)
CCLKSEL: Divide value for CPU clock for PLL0 4
Under USB Clock configuration register (USBCLKCFG)
USBSEL: Divide value for USB clock for PLL0 4
Under Peripheral clock selection register 0 (PCLKSEL0) and 1 (PCLKSEL1)
Select Pclk = Cclk for all.
Under Power control for peripherals (PCONP)
Enable the power for required peripherals
If CLKOUT to be studied configure the Clock output configuration register as below
CLKOUTSEL : Main Oscillator
CLKOUTDIV : 1
CLKOUT_EN : √
Call the functions
SystemInit ();
SystemCoreClockUpdate ();
At the beginning of the main function without missing.These functions are defined in system_LPC17xx.c where actual clock and other system control registers configuration takes
place.
3. Flash magic 6.01 installations:
Go to Software folder in the CD and run FlashMagic.exe file.
Click next on Welcome wizard and follow the step onscreen.
Comments
Post a Comment