Freescale
Freescale is a leader in embedded processing solutions for the automotive, consumer, industrial and networking markets.
You are viewing an older revision! See the latest version
FTF2014_workshop
This wiki page is dedicated to FTF 2014 mbed Hands-On Workshop.
Prerequisites¶
1. Registration - Sign up or login to mbed. Use htm file on MSD drive (the drive is named MBED) in your computer once board enumerates. Or visit mbed login link here
2. Add board to your supported platform. FRDM-K64F platform page
3. Get familiar with the online compiler, http://mbed.org/handbook/mbed-Compiler
Lab¶
All Labs completed exercises will be shared upon request or after the class. Import will be carried out in the same window!
Lab 1 - Hello world (20 minutes)
Import programFTF2014_lab1
Lab 1 - Hello world
- Input/Output and Serial
- Challenge 1: Change a text on the console based on the button pressed (SW2 and SW3 buttons).
- Challenge 2: Change the LED color (use 2 separate LED objects - only one will be on at the time) depending on the button pressed.
- Challenge 3: Change baudrate to 115200. Echo 5 characters which are typed on the terminal application as soon as SW3 is pressed.
- Useful links
Link to the completed Lab 1:
Lab 2 - Interrupts and timer (25 minutes)
[Repository '/teams/Freescale/code/FTF2014_lab2/' not found]
- Interrupts and timer
- Challenge 1: Add timer to toogle LED1 every 2 seconds. By pressing SW2 button, invoke a function which changes timers frequency as follows: each button press should lower the frequency by 100ms, starting from 1000ms down to 500ms and wraps again to 1000ms - frequency interval <0.5, 1.0>.
- Challenge 1: Add timer to toogle LED1 every 2 seconds. By pressing SW2 button, invoke a function which changes timers frequency as follows: each button press should lower the frequency by 100ms, starting from 1000ms down to 500ms and wraps again to 1000ms - frequency interval <0.5, 1.0>.
- Useful links
Link to the completed Lab 2:
Lab 3 - USB functionality (35 minutes)
Import programFTF2014_lab3_part1
Lab 3 part 2 - USBMouse
Import programFTF2014_lab3_part2
Lab 3 part 2 - USB Keyboard/Mouse
- USB Keyboard/Mouse
- Challenge 1: Draw a simple house in a paint program using USBMouse. An example is shown below:
- Challenge 2 (optional): Firstly, open two notepads (split screen or just next to each other) on PC. Using USBMouseKeyboard, insert a different text to each notepad window. Every second line should use only capital letters in the notepad on the right side. A hint (to go to the end of file - CTRL+End on windows machines).
- Challenge 1: Draw a simple house in a paint program using USBMouse. An example is shown below:
- Useful links
Link to the completed Lab 3 part 1:
Link to the completed Lab 3 part 2:
Lab 4 - SD card (40 minutes)
SD card with the file system.Import programFTF2014_lab4
- SD card with the file system.
- Challenge 1: Create 2 folders with names test1 and test2. In each folder, create one file (1.txt in test1, 2.txt in test2). List all directories. Then move 2.txt from test2 to test1 folder, remove test2 and list directories on sd card.
- Challenge 1: Create 2 folders with names test1 and test2. In each folder, create one file (1.txt in test1, 2.txt in test2). List all directories. Then move 2.txt from test2 to test1 folder, remove test2 and list directories on sd card.
- Useful links
Link to the completed Lab 4:
Lab 5 - mbed RTOS (30 minutes)
Lab 5 - mbed RTOSImport programFTF2014_lab5
- The introduction to mbed RTOS.
- Challenge 1: Add new thread which will wait for a signal. The signal will be set from the SW2 interrupt (pressed button = fall). In the main thread, print how many times was sw2 pressed in the last 5 seconds.
- Challenge 1: Add new thread which will wait for a signal. The signal will be set from the SW2 interrupt (pressed button = fall). In the main thread, print how many times was sw2 pressed in the last 5 seconds.
- Useful links
Link to the completed Lab 5: