You are on page 1of 9

Student Workbook EE-07310: Microprocessor based Embedded Systems

LABORATORY SESSION # 6
6 LED Train using Software Delay [Open Ended Lab]

6.1 EQUIPMENT & MATERIAL REQUIRED

- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________
- __________________________________

6.2 PRE-LAB PREPARATIONS

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

6.3 PROCEDURE

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

1
Student Workbook EE-07310: Microprocessor based Embedded Systems

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

6.4 OBSERVATION & RESULTS

- Complete ‘main.c’ code


#define RCC_APB2ENR ( * ((volatile unsigned long*) 0x40021018))
#define GPIOC_CRL ( * ((volatile unsigned long*) 0x40011000))
#define GPIOA_CRL ( * ((volatile unsigned long*) 0x40010800))
#define GPIOC_BSRR ( * ((volatile unsigned long*) 0x40011010))
#define GPIOC_ODR ( * ((volatile unsigned long*) 0x4001100C))
void Delay (void)
{
volatile unsigned int i;
for (i=0;i<80000;i++){}
}
void SystemInit(void)
{}
int main(void)
{
RCC_APB2ENR |= 0x00000010; //enable clock to GPIO port C
GPIOC_CRL &= 0x00000000; //clear previous config for port C pin 8
GPIOC_CRL |= 0x11111111;
//general purpose output.
while(1)
{
GPIOC_ODR = 0x00000001; //PC0 set high
Delay ();
GPIOC_ODR = 0x00000002; //PC1 set low
Delay ();
GPIOC_ODR = 0x00000004; //PC2 set high
Delay ();
GPIOC_ODR = 0x00000008; //PC3 set high
Delay ();
GPIOC_ODR = 0x00000010; //PC4 set high
Delay ();
GPIOC_ODR = 0x00000020; //PC5 set high
Delay ();
GPIOC_ODR = 0x00000040; //PC6 set high
Delay ();
GPIOC_ODR = 0x00000080; //PC7 set high
Delay ();
}
return(1);
}

Figure 6.1:Complete code from Keil µVision

2
Student Workbook EE-07310: Microprocessor based Embedded Systems

- Picture of hardware without connecting with the discovery board

Figure 6.2:Hardware setup without connecting the discovering board

- Hardware pictures after connecting with STM32 discovery board

Figure 6.3:Hardware setup after connecting the discovering board

3
Student Workbook EE-07310: Microprocessor based Embedded Systems

- Successful creation of HEX file

Figure 6.4:0 Errors, 0 Warnings

- Screenshots of debugging session

Figure 6.5:Debugging session

4
Student Workbook EE-07310: Microprocessor based Embedded Systems

- Hardware pictures with final results

Figure 6.6:Complete hardware setup in working mode

6.5 LEARNING OUTCOMES

What do you learn from this lab?

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

6.6 EXERCISE QUESTIONS

- Modify the program to generate different delays (100ms, 500ms, 1s) among
the toggling of LEDs
Calculations for value of variable ‘i’ for
i. 100ms
ii. 500ms

5
Student Workbook EE-07310: Microprocessor based Embedded Systems

iii. 1s

i. ii. iii.

iv. Figure 6.7: Modified code block for i. 100ms, ii. 500ms, and iii. 1s

i. ii. iii.

v. Figure 6.8: Oscilloscope screenshots for i. 100ms, ii. 500ms, and iii. 1s

6
Student Workbook EE-07310: Microprocessor based Embedded Systems

This open–ended lab also qualifies as a Complex Engineering Problem as it meets the
criterion 1 and criterion 3.

S# Attribute Complex Problems = 1 &(2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)

Engineering problems which cannot be resolved


1 Preamble without in-depth engineering knowledge, and have ☒
some or all of the characteristics listed below:

Range of conflicting Involve wide-ranging or conflicting technical,


2 ☐
requirements engineering and other issues.

Have no obvious solution and require abstract


3 Depth of analysis required thinking, originality in analysis to formulate suitable ☒
models.

Requires research-based knowledge much of which is


Depth of knowledge at, or informed by, the forefront of the professional
4 ☐
required discipline and which allows a fundamentals-based,
first principles analytical approach.

5 Familiarity of issues Involve infrequently encountered issues ☐

Are outside problems encompassed by standards and


6 Extent of applicable codes ☐
codes of practice for professional engineering.

Extent of stakeholder
Involve diverse groups of stakeholders with widely
7 involvement and level of ☐
varying needs.
conflicting requirements

8 Consequences Have significant consequences in a range of contexts. ☐

Are high level problems including many component


9 Interdependence ☐
parts or sub-problems.

7
Student Workbook EE-07310: Microprocessor based Embedded Systems

GENERALIZED LAB RUBRICS


Component Above Meeting Approaching Below Weight / Score
Domain with Expectation Expectation Expectation Expectation Used 100
(1–4)
Taxonomy (4) (3) (2) (1) (Optional)

Is able to build a given


setup neatly and timely Is able to assemble Is not able to
Psychomotor

Is only able to copy


Building using correct hardware a given setup using assemble a given
(Hardware) components and / or correct hardware
a given setup using
setup using 
correct hardware
P4 can reorganize / adapt components after correct hardware
components
to new / special minor revisions components
requirements
Recording
Is able to record Is only able to
Measurements Is able to record Is unable to
(Hardware / accurate measurements
accurate record accurate
record accurate ☐
measurements most measurements on
Software) all the time measurements
of the time some occasions
C3
Is able to formulate
Is partially able to
/develop theories in Is able to evaluate
Investigation evaluate /conclude Is unable to
addition to evaluating /conclude correctly
(Hardware /
/concluding correctly about investigation
correctly about comprehend 
Software) investigation investigation
about investigation parameters by
C5 parameters by parameters
parameters by assessing assessing data
assessing data
data
Design /
Is unable to
Development Is able to design / Is able to partially
Is able to design / partially design /
Cognitive

of Solution develop the solution of design / develop the ☐


develop the solution develop the
(Hardware / a given problem and solution of a given
of a given problem solution of a
Software) add features to it problem
given problem
C6
Is able to use the
Software Is adept in the use of Is able to use the
software tool
Usage software tool and can
effectively by
software tool but Is unable to use 
(Software) access advanced cannot access all the the software tool
accessing all the
C3 features required features
required features
Is able to efficiently
Is able to complete
complete a given task
a given task using
Programming using advanced Is unable to
required Is able to partially
Language programming language
programming complete a given
partially 
(Software) constructs / methods / complete a given
language constructs task
C3–C6 commands and/or add task
/ methods /
features to the original
commands
task

8
Student Workbook EE-07310: Microprocessor based Embedded Systems

GENERALIZED LAB RUBRICS

Component Above Approaching Below


Meeting Expectation Use Weight Score
Domain with Expectation Expectation Expectation / 100
(3) d (1–4)
Taxonomy (4) (2) (1) (Optional)

Safety Assesses and Assesses and complies Assesses and complies Assesses and
Instructions complies with all with most EHS with some EHS complies with ☐
(PLO6) EHS instructions instructions while in instructions while in few EHS
A4 while in lab lab lab instructions in lab
Does not exhibit
Exhibits exemplary Makes an effort to professional
Professional Exhibits professional
professional ethics exhibit professional ethics while
Ethics ethics while dealing
while dealing with
with fellow students,
ethics while dealing dealing with ☐
(PLO8) fellow students, lab with fellow students, fellow students,
A3 lab staff and instructor
staff and instructor lab staff and instructor lab staff and
all the time
all the time all the time instructor all the
time
Consistently shows
Shows some
full preparation by
Consistently shows full preparation which is Shows very little
Contribution completing all
preparation by mostly at superficial or no preparation
(PLO9) agreed tasks and
completing all agreed level in completing a in completing a 
A5 provides additional
tasks and work requires task and work requires task and work
resources for the
Affective

little or no revisions much revisions and quality is poor


group and work
editing
quality is excellent
Internalized positive
Attitude Consistent positive Neither helpful nor Discouraging
behavior and
(PLO9) encourages and
behavior most of the damaging and shows behavior towards ☐
A5 time towards other disinterest in the other team
helps other team
team members performance of others members
members
Report on all Report on all relevant Report on all relevant
relevant sections sections related to the sections related to the
Report related to the lab lab tasks is completed lab tasks is completed Report on all
Writing tasks is completed but few deficiencies but many deficiencies relevant sections
accurately, meeting are present in terms of are present in terms of related to the lab ☐
(PLO10)
A2 the requirements, in accuracy / meeting the accuracy / meeting the tasks is not
prescribed time and requirements / requirements / completed
with good language prescribed time / good prescribed time / good
skills language skills language skills
Lab Task Does not manage
Management Manages tasks well
within given
Manages tasks within Manages tasks in an tasks even in ☐
(PLO11) given timeframe extended timeframe extended
A3 timeframe
timeframes

You might also like