You are on page 1of 9

Tra i ni n g Assi gn men ts

Program Code

FRDKL46_MCP

Version

0.4

Effective date

15 Sep 2014

Hanoi, 09/2014

Training Assignments

<CFE >

Issue/Revision: x/y

RECORD OF CHANGES
*A - Added M - Modified D - Deleted
Date

Changes

A*
M, D

Contents

Version

06 Sep 14

All

All

0.1

07 Sep 14

Lecture 01 -> 06

Add assignment for lecture 01


-> 06 from ToanLN

0.2

14 Sep 14

Update Lecture 07,08,09

Modify the assignment


requirements

0.3

18 Sep 14

Update assignment for


lecture 08

79e-BM/NS/HDCV/FSOFT v1/0

Remove assignment #2 due to


0.4
KL46 doesnt support UART HW
Flow

Internal use

2/9

Training Assignments

<CFE >

Issue/Revision: x/y

Contents
Lecture 01 Embedded System Getting Started...................................................................4
Assignment 1: Install Keil & Create simple project..............................................................4
Lecture 02 Embedded Software Development....................................................................4
Assignment 1: N/A..............................................................................................................4
Lecture 03 Getting Started with KL46 freedom board..........................................................4
Assignment 1: Write an example to blink two LEDs with different frequency.......................4
Assignment 2: Write an example to control LEDs by buttons..............................................4
Lecture 04 ARM Cortex-M Architecture Overview................................................................4
Assignment 1: Blink LEDs with given frequency..................................................................4
Lecture 05 ARM Cortex M Exception & Interrupt.................................................................5
Assignment 1: Blink LEDs with dynamic change frequency................................................5
Lecture 06 Peripherals Multipurpose Clock Generator........................................................5
Assignment 1: Write an example to put KL46 to FEI mode from FBE.................................5
Assignment 2: Write an example to put KL46 from FEI mode to PEE.................................5
Lecture 07 - Peripherals PIT Timer.........................................................................................6
Assignment 1: Write an application to trigger the PIT Timer interrupt for every 5.12ms and
30ms................................................................................................................................... 6
Assignment 2: Write an application to trigger the PIT Timer interrupt for every 10min with
chainning both channel 0 & 1..............................................................................................6
Lecture 08 UART.................................................................................................................. 6
Assignment 1: Write a program sends a Hello world! to PC through UART......................6
Assignment 2: Write a program sends a Hello world! to PC through UART with hardware
flow control......................................................................................................................... 6
Lecture 09 RTOS.................................................................................................................7
Assignment 1: Researching the pros/cons on most popular RTOS in the market (VxWorks,
ThreadX, FreeRTOS, Freescale MQX, uTron)....................................................................7
Lecture 10 Introduce to Freescale MQX RTOS...................................................................7
Assignment 1: Task switch..................................................................................................7
Assignment 2: Task create..................................................................................................7
Lecture 11 Freescale MQX Timer........................................................................................7
Assignment 1: Write an application by using an MQX timer to implement a counter, display
a counter value on LCD......................................................................................................7
Lecture 12 Freescale MQX RTOS Task Synchronization....................................................8
Assignment 1: Semaphore..................................................................................................8

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

3/9

Training Assignments

<CFE >

Issue/Revision: x/y

Assignment 2: Massage queue...........................................................................................8


Final Assignment Bug Killer Game......................................................................................8
Assignment 1: Bug Killer Game..........................................................................................8

Lecture 01 Embedded System Getting Started.


Assignment 1: Install Keil & Create simple project.
Description
-

Install Keil IDE & related software for working with FRDKL46 board.
Create a simple project, load & debug on FRDKL46.

Estimated time: 2 hours

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

4/9

Training Assignments

<CFE >

Issue/Revision: x/y

Lecture 02 Embedded Software Development.


Assignment 1: N/A.

Lecture 03 Getting Started with KL46 freedom board


Assignment 1: Write an example to blink two LEDs with different frequency.
Description
Create a Keil project for FRD KL46Z256 board
Implement the code to blink two LEDs with different frequency.
Estimated time: 2 hours

Assignment 2: Write an example to control LEDs by buttons.


Description
Create a Keil project for FRD KL46Z256 board
Implement the code to control LEDs by buttons. Press button to turn on LED; Release button
to turn off LED.
Estimated time: 1 hours

Lecture 04 ARM Cortex-M Architecture Overview.


Assignment 1: Blink LEDs with given frequency.
Description
1. Create a Keil project for FRD KL46Z256 board
2. Using SysTick to implement the code to blink two LEDs as the following: RED LED blinks at
1Hz; Green LED blink at 2 Hz.
Estimated time: 3 hours

Lecture 05 ARM Cortex M Exception & Interrupt.


Assignment 1: Blink LEDs with dynamic change frequency.
Description
1. Create a Keil project for FRD KL46Z256 board
2. Using SysTick to implement the code to blink two LEDs as the following: RED LED blinks at
1Hz; Green LED blink at 1 Hz.
3. Press button 1 to increase Green LED frequency twice; and Press button 2 to decrease
Green LED frequency twice.
4. configured in SysTick & GPIO modules are interrupt mode.
Estimated time: 3 hours

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

5/9

Training Assignments

<CFE >

Issue/Revision: x/y

Lecture 06 Peripherals Multipurpose Clock Generator


Assignment 1: Write an example to put KL46 to FEI mode from FBE.
Description
Create a Keil project for FRD KL46Z256 board
Implement the code to transit the KL46 from FEI mode to FBE.

Configure MCUOUTCLK = Bus Clock = 8MHz

Configure FLL Output = 40MHz

Configure CLKOUT=PTC3=Bus Clock = 8MHz

Estimated time: 2 hours

Assignment 2: Write an example to put KL46 from FEI mode to PEE.


Description
Create a Keil project for FRD KL46Z256 board
Implement the code to transit the KL46 from FEI mode to PEE.

Configure MCGOUTCLK = PLL Output = 96 MHz

Configure Core Clock = 48MHz

Configure Bus Clock = 24MHz

Configure CLKOUT=PTC3=Bus Clock = 24MHz

Estimated time: 2 hours

Lecture 07 - Peripherals PIT Timer


Assignment 1: Write an application to trigger the PIT Timer interrupt for every
5.12ms and 30ms.
Description
Create a Keil project for FRD KL46Z256 board
Implement the code to trigger the PIT timer interrupt on:

After 2s

After 4s

Estimated time: 2 hours

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

6/9

Training Assignments

<CFE >

Issue/Revision: x/y

Assignment 2: Write an application to trigger the PIT Timer interrupt for every
10min with chainning both channel 0 & 1.
Description
Create a Keil project for FRD KL46Z256 board
Implement the code to trigger the PIT timer interrupt on 10 seconds with chaining both channel 0 & 1
Estimated time: 2 hours

Lecture 08 UART
Assignment 1: Write a program sends a Hello world! to PC through UART.
Description
-

Create a Keil project for the FRD KL46Z256 which uses printf() function to send a Hello
world to PC using UART module of the FRD KL46Z256.

Baud rate: 115200, Data bit: 8; Parity: None; Stop bits: 1; Flow Control: None.

Estimated time: 2 hours

Lecture 09 RTOS
Assignment 1: Researching the pros/cons on most popular RTOS in the market
(VxWorks, ThreadX, FreeRTOS, Freescale MQX, uTron).
Description
-

Separated class to different team, each team will be responsible for a given RTOS. Team
must research and present with class about following item:

Architecture of the RTOS

What is the pros/cons of this RTOS

Real application in the market

Synchronization in this RTOS

Estimated time: 2 hours

Lecture 10 Introduce to Freescale MQX RTOS


Assignment 1: Task switch
Description
-

Write a program using RTOS to blink 2 LEDs, one at 1Hz, the other one at 1.5Hz frequency

Estimated time: 1.5 hours

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

7/9

Training Assignments

<CFE >

Issue/Revision: x/y

Assignment 2: Task create


Description
-

Write a program using RTOS to blink 2 LEDs, all at 1Hz frequency. After the led 1 blink 10
times, the led 2 will blink.

Estimated time: 1.5 hours

Lecture 11 Freescale MQX Timer


Assignment 1: Write an application by using an MQX timer to implement a
counter, display a counter value on LCD
Description
-

Implement a counter increasing on every 1 second, display this counter value on Segment
LCD.

Estimated time: 04 hours

Lecture 12 Freescale MQX RTOS Task Synchronization


Assignment 1: Semaphore
Description
-

Write a program uses two tasks. All the task need to access the UART port. Task 1 need to
access the UART port to read it and echo the user input. Task 2 need to access the UART
port to write to it (example the hello word). Task 1 will control the UART port first and only
when the user press the a key; the task 1 release the semaphore then task 2 can access the
UART port, the task 2 print for 10 times and give the access to task 1.

Estimated time: 1.5 hours

Assignment 2: Massage queue


Description
-

Write a program using Massage queue. The user will types some messages to the UART
terminal, when the user type send and then press enter, the content of the messages is
displayed on the screen of PC.

Estimated time: 3 hours

Final Assignment Bug Killer Game.


Assignment 1: Bug Killer Game.
Description
-

The bugs are the LEDs on the touch buttons. When the bug appears (led turn on),
you must touch the corresponding touch button to kill the bug (the bug killed causes
the led turns off), the bugs will appear for a specified time before the bug escape (the
led turn off).
The bugs are randomized displayed on the LED, some time there are more than one
bugs display on the LED.

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

8/9

Training Assignments

<CFE >

Issue/Revision: x/y

- There are 100 bugs on a game round, the bugs was killed after the game round
finish is the score.
The high score is stored in a variable
The UART port is used to print when a bugs is killed (example the sound Oh), after
a game round finishes, the score will be printed and the high score is printed too.
The time interval between the bugs and the time the bug appear depends on the
programmer.
Button1: Kill bug 1

Estimated time: 3 hours

79e-BM/NS/HDCV/FSOFT v1/0

Internal use

9/9

You might also like