You are on page 1of 11

Student Workbook EE-07310: Microprocessor based Embedded Systems

LABORATORY SESSION # 3
3 Configuration of STM32F100xx GPIOs as an Output

3.1 EQUIPMENT & MATERIAL REQUIRED

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

3.2 PRE-LAB PREPARATIONS

___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__

3.3 PROCEDURE

___________________________________________________________________
__
___________________________________________________________________
__

20
Student Workbook EE-07310: Microprocessor based Embedded Systems

_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
___________________________________________________________________ __

_____________________________________________________________________
_____________________________________________________________________
___________________________________________________________________

__

___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__

___________________________________________________________________
__

___________________________________________________________________
__
___________________________________________________________________

21
Student Workbook EE-07310: Microprocessor based Embedded Systems

__
___________________________________________________________________
__
___________________________________________________________________
__

___________________________________________________________________
__
___________________________________________________________________
__

Figure 3.2: Debug session environment

22
Student Workbook EE-07310: Microprocessor based Embedded Systems

A B

Figure 3.3: (a) Peripherals selection and (b) Port C peripheral window
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__

_____________________________________________________________________
_____________________________________________________________________
___________________________________________________________________
__
_____________________________________________________________________
_____________________________________________________________________

_____________________________________________________________________
___________________________________________________________________
__
___________________________________________________________________
__

3.4 OBSERVATION & RESULTS

23
Student Workbook EE-07310: Microprocessor based Embedded Systems

Figure 3.7 : Oscilloscope waveform of PC8

___________________________________________________________________
__
___________________________________________________________________
__
3.5 LEARNING OUTCOMES

What do you learn from this lab?

___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__

25
Student Workbook EE-07310: Microprocessor based Embedded Systems

3.6 EXERCISE QUESTIONS

- Investigate the outcome of program if the data type of variable ‘i’ in for loop
is changed from ‘int’ to ‘char’.
_________________________________________________________________
__ __
___________________________________________________________________
__
___________________________________________________________________
__
___________________________________________________________________
__

- Masking is used in the code. Compare the simple assignment of values to the
register with the masking approach.

___________________________________________________________________
__
___________________________________________________________________
__
_____________________________________________________________________
_____________________________________________________________________

_____________________________________________________________________
___________________________________________________________________
__
___________________________________________________________________
__

- How can you enable and disable the clock for GPIOA, GPIOB and GPIOC
simultaneously?

___________________________________________________________________
__
___________________________________________________________________
__

___________________________________________________________________
__

26
Student Workbook EE-07310: Microprocessor based Embedded Systems

___________________________________________________________________
__
___________________________________________________________________
__

- What is the purpose of ‘#define’ directives at the start of the file?

___________________________________________________________________
__
___________________________________________________________________
__

___________________________________________________________________
__

- Re-write the program to blink both on-board LEDs, PC8 and PC9 .
Give related code section only, where the modification is done.

27
Student Workbook EE-07310: Microprocessor based Embedded Systems

Figure 3.8: Code from Keil µVision for blinking PC8 and PC9 simultaneously

Figure 3.9:Hardware picture for blinking of PC8 and PC9 simultaneously

28
Student Workbook EE-07310: Microprocessor based Embedded Systems

- Re-write the program in order to blink PC8 and PC9 LEDs alternatively.

Figure 3.10: Code from Keil µVision for blinking PC8 and PC9 alternatively

Give related code section only, where the modification is done.

Figure 3.9: Hardware picture for blinking of PC8 and PC9 alternatively

29
Student Workbook EE-07310: Microprocessor based Embedded Systems

GENERALIZED LAB RUBRICS


Component Above Meeting Approaching Below Used Weight Score
with Taxonomy Expectation (4) Expectation (3) Expectation (2) Expectation (1) / 100
(1–4)
Building Is able to build a Is able to assemble a Is only able to Is not able to 30
(Hardware) – P4 given setup neatly given setup using copy a given assemble a

and timely using correct hardware setup using given setup
correct hardware components after correct hardware using correct
components and / minor revisions components hardware
or can reorganize / components
adapt to new /
special
requirements

Recording Is able to record Is able to record Is only able to Is unable to 20


Measurements accurate accurate record accurate record accurate
(Hardware / measurements most measurements on measurements 
measurements all
Software) – C3 of the time
the time some occasions

Investigation Is able to Is able to Is not able to Is unable to ☐


(Hardware / formulate/develop evaluate/conclude evaluate/conclude comprehend
Software) – C5 theories in correctly about correctly about investigation
addition to investigation investigation parameters
evaluating/conclu parameters by parameters by
ding correctly assessing data
assessing data
about
investigation
parameters by
assessing data

Design / Is able to design / Is able to design / Is able to partially Is unable to ☐


Development of develop the develop the solution design / develop partially
Solution solution of a of a given problem the solution of a design /
(Hardware / given problem given problem develop the
Software) – C6 and add solution of a
features to it given problem
Software Usage Is adept in the use Is able to use the Is able to use the Is unable to use  10
(Software) – C3 of software tool software tool software tool but the software tool
and can access effectively by cannot access all
advanced features accessing all the the required
required features features

30
Student Workbook EE-07310: Microprocessor based Embedded Systems

Programming Is able Is able to complete a Is able to Is unable to 40


Language to given task using partially partially
(Software) – C3– efficiently required 
complete a given complete a
C6 programming
complete a given language constructs task given task
task using / methods /
advanced commands
programming
language
constructs /
methods /
commands and/or
add features to the
original task

31

You might also like