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?

Slides:



Advertisements
Similar presentations
Testing Relational Database
Advertisements

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.
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.
Thermal arm-wrestling Design of a video game using two programmable flags (PF) interrupts Tutorial on handling 2 Hardware interrupts from an external device.
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.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM415.
Core Timer Code Development How you could have done the Take- Home Quiz using a test driven development (TDD) approach.
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.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Timers and Timing Signals Tutorial. 6/18/2015 Timer Control Copyright M. Smith, ECE, University of Calgary, Canada 2 / 31 Temperature Sensor -- Lab 3.
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.
1 Lab Session-I (A and B) CS-120 Fall 2000 Using Windows Using An Editor Using Visual C++ Using Compiler Writing and Running Programs Lab-1 DUE Fri September.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
TigerSHARC processor General Overview. 6/28/2015 TigerSHARC processor, M. Smith, ECE, University of Calgary, Canada 2 Concepts tackled Introduction to.
Laboratory 1 – ENCM415 Familiarization with the Analog Devices’ VisualDSP++ Integrated Development Environment.
HD44780 LCD programming From the Hardware Side
CS413: Java Programming language Applications Applets
Peripherals and their Control An overview of industrially available “peripheral devices” that use “pulse-width modulation” for information passing. Review.
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.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 3 Understanding the memory pipeline issues.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
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.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
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.
Mistakes, Errors and Defects. 12/7/2015Mistakes, Errors, Defects, Copyright M. Smith, ECE, University of Calgary, Canada 2 Basic Concepts  You are building.
12/14/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
The right and wrong ways for constructing tasks for the Labs and Assignment.
Building a simple loop using Blackfin assembly code If you can handle the while-loop correctly in assembly code on any processor, then most of the other.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM415.
Assignment 4 / Lab. 3 Convert C++ ISR to ASM AND GET IT TO WORK Doing Assignment 4 / Lab. 3 the Test Driven Development way.
“Lab. 5” – Updating Lab. 3 to use DMA Test we understand DMA by using some simple memory to memory DMA Make life more interesting, since hardware is involved,
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.
GC101 Introduction to computers and programs
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Lab. 2 Overview – Earlier Tasks Prelaboratory T1, T3, T4 and T5
Lab. 2 Overview.
A Play Core Timer Interrupts
Introduction to Test Driven Development
Automated Testing Environment
Thermal arm-wrestling
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
TigerSHARC processor and evaluation board
Lab. 2 – More details – Later tasks
VisualDSP++ and Test Driven Development What happened last lecture?
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
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.
A Play Lab. 2 Task 8 Core Timer Interrupts
Single Value Processing Multi-Threaded Process
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.
Download and Installation of code::blocks
General purpose timers
Getting serious about “going fast” on the TigerSHARC
Thermal arm-wrestling
Concept of TDD Test Driven Development
Explaining issues with DCremoval( )
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
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
Presentation transcript:

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?

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada2 / 28 To be tackled today Lab. 2 – Concepts to be understood and demonstrated Test driven development approach Design the tests THEN the code Overview of Lab. 2 Details of Lab. 2 Task 1 Setting up the SMALLEST TV IN THE WORLD – MANUALLY OPERATED Details of Lab. 2 Task 2 Setting up the testing environment for Lab. 2 Details of Lab. 2 Task 3 Test Last Approach to check that Task 1 functions really work

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada3 / 28 Show understanding of what concepts? 1. How to write up a “valid” (working) “C++” interrupt service routine for the timers on a microcontroller. 2. How to set up a timer to be able to cause an interrupt. 3. How to set-up the “C++” to handle a new interrupt without crashing 4. Demonstrate “multi-tasking” – a main program and a background “interrupt” routine 5. Using a test driven development approach to demonstrate validation of the other concepts

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada4 / 28 Demonstration of these concepts Set up THE SMALLEST TV IN THE WORLD – manually operated by switches Two new functions (around 6 C++ lines) developed 2. Set up the “Testing environment” for Lab. 2. – basically downloading files 3. Use the “testing environment” (in a “test last approach”) to valid the new functions developed in Task. 1 above Mainly downloading files and modifying cut-and-pasted code (around 20 C++ lines modified) These concepts are done as Assignment 3 where Task 1 must be done in assembly code and tested (Task 3), making good practice for Post Lab. 1 Quiz and cutting down time spent during Lab. 2

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada5 / 28 Demonstration of these concepts Use a test driven development approach to set up core timer to known values withy ability to stop-and-start the core time (C++ and ASM approach). 5. Use a test driven development approach to set up and test core timer interrupts. Demonstrate the SMALLEST VCR IN THE WORLD (C++ and ASM approach). 6. Put everything together so that the SMALLEST VCR (in the world) and the SMALLEST TV (in the world) work together with or without human intervention

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada6 / 28 Small TV 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 it appear “there all the time”

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada7 / 28 Small TV 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”

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada8 / 28 Small TV in the world – SW1 This slide is brought to you by the letter “M” 7 rows of pixels MANUAL TV PRESS SW1 to clear screen

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada9 / 28 Small TV in the world – Press SW2 This slide is brought to you by the letter “M” 7 rows of pixels MANUAL TV PRESS SW2 to display each line

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada10 / 28 SMALLEST TV IN THE WORLD – This slide is brought to you by the letter “M” 1 row of pixels PRESS SW1

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada11 / 28 SMALLEST TV IN THE WORLD – PRESSING SW2 This slide is brought to you by the letter “M” 7 rows of pixels PRESS SW2

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada12 / 28 ENOUGH PRESSES ALREADY

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada13 / 28 Lab. 2 Task 1 – Basic hardware test

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada14 / 28 L2 T1 – Code for the “TV frame buffer” Displayed using WriteLEDASM( ) This slide is brought to you by the letter “A”

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada15 / 28 L2 T1 – Final main( ) Press SW1 to clear the screen APPARENT INFINITE LOOP INFINITE LOOP AVOIDED SINCE VOLATILE VARIABLE start_picture_again IS BEING CHANGED ELSE WHERE

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada16 / 28 L2 T1 – Final main( ) Press SW2 repeatedly to display “picture”

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada17 / 28 Lab. 2 Task 1 – New Code needed void StartPictureCommand(void); changes the volatile variable start_picture_again defined in main.cpp (meaning its external to this file) to 1 when switch 1 is held down and then released. void NextLineCommand(void); changes the volatile variable next_line to 1 when switch 2 is held down and then released.

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada18 / 28 ERRORS AND DEFECTS We have some new functions developed in Task 1 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

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada19 / 28 L2 T2 – Setting up test environment 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

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada20 / 28 L2 T2 – 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 Only works if you have called the files you develop exactly what is specified in the web pages. There are simple “work arounds” supplied by the VisualDSP tool functionality to overcome this problem – which would be fairly common industry. Learn to use this feature.

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada21 / 28 Required LAB Directory Environment

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada22 / 28 Required Files From Lab. 1 and Lab1Tests

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada23 / 28 Required Files – Lab2 and Lab2Tests and GUI set-up

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada24 / 28 Lab. 2 Task 3 Test 1 -- SW1 control Testing StartPictureCommand()

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada25 / 28 Lab. 2 Task 3 Test 2 -- SW1 control Testing StartPictureCommand()

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada26 / 28 Lab. 2 Task 3 Test 3 -- SW1 control REFACTORING StartPictureCommand() Problems like this being found and solved P0.H = hi(_name); P0.L = hi(_name); TEMPORARY DEBUG FIX -- REMOVE WHEN PROBLEM SOLVED

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada27 / 28 Lab. 2 Task 3 Tests for SW2 control NextLineCommand() You are responsible for setting up these test Basically a cut-and-paste job of the tests for SW1 This is where I expect you to be when you come into the Lab. 2 Also see “Assignment 3” which combines “practice for post-lab Quiz 1” and getting ready for Lab. 2 Effectively Assignment is worth around 2% of the course (because of the Lab. 2 component) when handed in as part of Lab. 2. However there are no marks directly associated with Assignment 3.

6/14/2015 TDD-Core Timer Library, Copyright M. Smith, ECE, University of Calgary, Canada28 / 28 Tackled today Lab. 2 – Concepts to be understood and demonstrated Test driven development approach Design the tests THEN the code Overview of Lab. 2 Details of Lab. 2 Task 1 Setting up the SMALLEST TV IN THE WORLD – MANUALLY OPERATED Details of Lab. 2 Task 2 Setting up the testing environment for Lab. 2 Details of Lab. 2 Task 3 Test Last Approach to check that Task 1 functions really work