Lab. 2 Overview – Earlier Tasks Prelaboratory T1, T3, T4 and T5

Slides:



Advertisements
Similar presentations
Lab. 2 Overview. Lab. 2 and Assignment 3 Many Lab. 2 and Assignment 3 tasks involve “downloading” provided code, compiling and linking into a project.
Advertisements

Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
6/2/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
Review of Blackfin Syntax Moves and Adds 1) What we already know and have to remember to apply 2) What we need to learn.
Lab. 2 – More details – Tasks 4 to 6 1. What concepts are you expected to understand after the Lab. 2 is finished? 2. How do you demonstrate that you have.
Over-view of Lab. 1 For more details – see the Lab. 1 web-site There will be a 20 min prelab quiz (based on Assignment 1 and 2) at the start of the lab.
Lab. 2 Overview 1. What concepts are you expected to understand after the Lab. 2 is finished? 2. How do you demonstrate that you have that knowledge?
Timers and Timing Signals Tutorial. 6/18/2015 Timer Control Copyright M. Smith, ECE, University of Calgary, Canada 2 / 31 Temperature Sensor -- Lab 3.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Tutorial Essentially all the Blackfin instruction you need for all of ENCM511. The instructions are easy. Its knowing when to use them that is the difficult.
1 Programming James King 12 August Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple.
Assembly Language Review Being able to repeat on the Blackfin the things we were able to do on the MIPS 9/19/2015 Review of 50% OF ENCM369 in 50 minutes1.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM511.
Lab. 2 Overview Move the tasks you developed in Lab. 1 into the more controllable TTCOS operating system Manual control of RC car.
Lab. 2 Overview. Echo Switches to LED Lab1 Task 7 12/4/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada 2 / 28.
Multi-threaded projects Services and Drivers Alternate ways of doing Labs 1, 2, 3 and 4.
12/14/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
Developing Tasks to use with a co-operative scheduler Ideas for Assignment 2 Lab. 2, 3 and 4 Review for Midterm on Lab. 2 Ideas of defects, errors and.
Section 8.1 Section 8.2 Create a custom theme Design a color scheme
Introduction to the FPGA and Labs
FOP: Multi-Screen Apps
Making videos accessible – Mandatory guidelines
MASS Java Documentation, Verification, and Testing
Getting Started with ATMEL Studio 6
Introduction CSE 1310 – Introduction to Computers and Programming
Developing a multi-thread Simulation of GPS system You’ll only need to add the threads – all functions (except correlation( )) provided M. Smith Electrical.
Software and Hardware Circular Buffer Operations
Lab. 2 Overview.
A Play Core Timer Interrupts
Tool for Creating Rich Media
Introduction to Test Driven Development
Design and Programming
Automated Testing Environment
Thermal arm-wrestling
Trying to avoid pipeline delays
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
SAMPLE PRESENTATION Company Name presents PowerPoint Basics
TigerSHARC processor and evaluation board
Lab. 2 – More details – Later tasks
VisualDSP++ and Test Driven Development What happened last lecture?
Assembly Language Review
Moving Arrays -- 2 Completion of ideas needed for a general and complete program Final concepts needed for Final DMA.
Thermal arm-wrestling
Using Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Lab. 4 – Part 1 Demonstrating and understanding multi-processor boot
A Play Lab. 2 Task 8 Core Timer Interrupts
Single Value Processing Multi-Threaded Process
See the Lab. 1 web-site and later lecture notes for more details
General purpose timers
Moving Arrays -- 2 Completion of ideas needed for a general and complete program Final concepts needed for Final DMA.
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
* M. R. Smith 07/16/96 This presentation will probably involve audience discussion, which will create action items. Use PowerPoint.
General purpose timers
Getting serious about “going fast” on the TigerSHARC
Thermal arm-wrestling
Concept of TDD Test Driven Development
Explaining issues with DCremoval( )
Lab. 4 – Part 2 Demonstrating and understanding multi-processor boot
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Independent timers build into the processor
Lab. 2 Overview Move the tasks you developed in Lab. 1 into the more controllable TTCOS operating system.
Thermal arm-wrestling
Mistakes, Errors and Defects
Running a Java Program using Blue Jay.
Working with the Compute Block
Display Interrupt Service Routine for cargo monitoring system
Blackfin Syntax Moves and Adds
ECE 3567 Microcontrollers Lab
Presentation transcript:

Lab. 2 Overview – Earlier Tasks Prelaboratory T1, T3, T4 and T5 What concepts are you expected to understand after the Lab. 2 is finished? How do you demonstrate that you have that knowledge?

Show understanding of what concepts? How to write up a “valid” (working) “C++” interrupt service routine for the timers on a microcontroller. How to set up a timer to be able to cause an interrupt. How to set-up the “C++” code to handle a new interrupt without crashing Demonstrate “multi-tasking” – a main program and a background “interrupt” routine Use a test driven development approach to demonstrate validation of the other concepts 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

To be tackled today Lab. 2 – Concepts to be understood and demonstrated (Prelab) – Watch dog timer demo (Task 1) with C++ code rewritten in assembly code (Task 2 – prepare for Midterm)) (Prelab) – Write C++ code for interval timer (Task 3) and use with SMALLEST MOVIE SCREEN IN THE WORLD (Task 4) (Application stream only) – Flip a single code switch and display the movie on the LARGE MOVIE screen (Task 6). Uses a function library that you will develop yourselves in Lab. 4 (Application stream only) – Use the world war 1 technique employed by Snoopy to shoot down the Red Baron to improve the LARGE and SMALL movie screens (TASK 11) Setting up the test driven development environment for Lab. 2 which will be used for later tasks. (Task 5) 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Lab. 2 Tasks 1 and 2 -- Play Video Game against the Watchdog Timer See last Monday’s notes TASK 1 PURPOSE: Demonstrate the code necessary to initialize and then use of the "watch-dog" interrupt to regain control of an embedded system made uncontrollable by the need to wait for an external signal that can never arrive. TASK 1 PURPOSE: Demonstrate the building and use of a function library. TASK 2 PURPOSE: Demonstrate the replacement of a number of C++ functions to initialize and use an external peripheral by their equivalent assembly language functions. Practice for the midterm 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Turning provided code into a “function library” Make Lab2 project to build the standard executable – add provided code Make WatchDog Library project to build a library – add provided code Link the library into the Lab 2 project to be able to run Task 1 Modify the library to add your assembly code versions of the WatchDog Timer functions for Task 2 (Midterm practice) 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Making a library project 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Adding a “library dependency” Automatic update of 2 projects 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Making a library project and an executable project “inter-dependent” 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Lab. 2 Tasks 3 and 4 – Smallest MOVIE shown using C++ interval timer TASK 3 PURPOSE: Develop and test a C++ interval timer to control the operation of the "main task" within an embedded system. (Last Monday’s lecture) TASK 4 PURPOSE: Develop and test a "main task" that uses an interval timer to control external activities. This "main task" must continue "unaffected" by an interrupt driven task introduced later in the laboratory. APPLICATION STREAM ONLY TASK 6 and 11 -- PURPOSE: Extend the ideas from Task 4 "for a little bit of fun". This "main task" makes use of a background interrupt driven task (Lab. 4) to control the display of an external device. 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Small MOVIE in the world – white picture This slide is brought to you by the letter “M” Pixels become activated as the electron gun “paints” the various pixels on the screen Repainted every 1/30 s Persistence of vision makes the letter appear “there all the time” 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Small MOVIE in the world This slide is brought to you by the letter “M” 7 rows of pixels Pixels become activated as the electron gun “paints” the various pixels on the screen Repainted every 1/30 s Persistence of vision makes it appear “there all the time” 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Small MOVIE in the world This slide is brought to you by the letter “M” 7 rows of pixels PRESS SW1 to clear screen and start the movie 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Small MOVIE in the world -- speed controlled by C++ interval timer This slide is brought to you by the letter “M” 7 rows of pixels MOVIE PROJECTOR Each time the “interval timer” rings (completes) display the next line 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

SMALLEST MOVIE IN THE WORLD – This slide is brought to you by the letter “M” 1 row of pixels PRESS SW1 TO START 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

SMALLEST MOVIE IN THE WORLD – INTERVAL TIMER This slide is brought to you by the letter “M” 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

ENOUGH PRESSES ALREADY Tasks 5, 7 and onwards involve adding a background task (core timer interrupt) to make the smallest VCR in the world. Of course – no body knows how to program the VCR; so, to be realistic, you will just see is the “blinking light” (LED 6) indicating that the VCR is improperly programmed. In principle – you could make a “real VCR” by writing a function to store key presses and later play those stored key presses back (not particularly difficult but recommended only for application stream people with time on their hands) 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

L2 T4 – Code for the “MOVIE frame” Displayed using WriteLEDASM( ) This slide is brought to you by the letter “A” 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

L2 T4 – Activate Movie Press SW1 to clear the screen 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Movie Code 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

L2 Displaying the movie 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

ERRORS AND DEFECTS Review (Post-lab1 and midterm) TLD - Test last development Need a systematic way to ensure that those functions work now “Regression Testing” and a systematic way to ensure that they work in the future after modification “Defect free” development environment By discovering all the mistakes (called ERRORS) before developing any further code based on these functions we can ensure that no hidden mistakes (CALLED DEFECTS) are present Errors are easier, and less costly, to fix as you are in that part of the code where they have been introduced – you know where to look 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

L2 T5 – Setting up test environment Pre laboratory – before the lab. This test environment is automated Makes it easy for you to run the tests often Many provided testing files that you can just download Only work if you have called the functions you develop exactly what is specified in the web pages Imagine that this is in industry, and you are working with a colleague (“me”) as part of the team. This is meant to be a supportive relationship. Expect an occasional typo in the test or test documentation. These occur when I make some minor changes to the pages during the laboratory development. Get a model in your head of what is “supposed to happen next”. That model will often get you past an apparent road block in the web pages 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

L2 T5 – Setting up test environment I will be providing you with project files to download (.prj) to download and automatically link to your code and tests Works best if you have called the files you develop exactly the names that are specified in the web pages. There are simple “work arounds” supplied by the VisualDSP tool functionality to overcome the problem where you have not called the files by the same names (or placed in the right directory) Simple errors like this would be fairly common in industry when working with a team. Learn to use this useful VDSP feature. 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Required LAB Directory Environment 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Required Files for “regression testing” of From Lab. 1 functions 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Required Files – Lab2 and Lab2Tests -- Init_CoreTimer06ASM tests 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

First test – can we link to the test 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Write a test to check stub works Init_CoreTimer06ASM( ) 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Recap of what has been discussed Prelaboratory T1, T3, T4 and T5 Download the "Watchdog Timer" Video Game T1 - Video Game Do not do Task 2 as part of Lab. 2 pre-laboratory exercises Generate and use your ASM functions to control WatchDog interrupts T2 - My WatchDog Control Functions Task 2 is meant as a practice exercise for the Midterm Exam Build a simple timer T3 --Non interrupt driven timer Watch a movie T4 - on a small movie screen Setting up E-TDD environment (Assignment 1 and 2) T5 - Automated tests for Lab. 2 Application stream only tasks (not prelab) Watch a sailing movie  T6 - using a LARGE movie screen Watch a sailing movie with the help of the T11 -- Snoopy and Red Baron 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada

Show understanding of the following concepts during Lab. 2? How to write up a “valid” (working) “C++” interrupt service routine for the timers on a microcontroller. How to set up a timer to be able to cause an interrupt. How to set-up the “C++” code to handle a new interrupt without crashing Demonstrate “multi-tasking” – a main program and a background “interrupt” routine Use a test driven development approach to demonstrate validation of the other concepts 11/10/2018 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada