Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment.

Slides:



Advertisements
Similar presentations
Code Composer Department of Electrical and Computer Engineering
Advertisements

UEE072HM Linking HLL and ALP An example on ARM. Embedded and Real-Time Systems We will mainly look at embedded systems –Systems which have the computer.
Computer Architecture CSCE 350
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 3 – New instruction recap Tutorial.
Assignment Overview Thermal oscillator One of the ENCM415 Laboratory 2 items Oscillator out GND +5V.
Boot Issues Processor comparison TigerSHARC multi-processor system Blackfin single-core.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
6/2/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
Building a simple loop using Blackfin assembly code M. Smith, Electrical and Computer Engineering, University of Calgary, Canada.
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.
Review of Blackfin Syntax Moves and Adds 1) What we already know and have to remember to apply 2) What we need to learn.
Software and Hardware Circular Buffer Operations First presented in ENCM There are 3 earlier lectures that are useful for midterm review. M. R.
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
TigerSHARC Laboratory Setting up the HPP-ICE environment ICT 318 / 320 Running versions of the Audio-talk-through program.
ADSP-BF533 EZ-Kit Lite (Summit ICE Connection) Installation in ICT320.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
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.
Understanding the Blackfin ADSP-BF5XX Assembly Code Format
Microprocessor or Microcontroller Not just a case of “you say tomarto and I say tomayto” M. Smith, ECE University of Calgary, Canada.
Getting the O in I/O to work on a typical microcontroller Ideas of how to send output signals to the radio controlled car. The theory behind the LED controller.
Laboratory 1 – ENCM415 Familiarization with the Analog Devices’ VisualDSP++ Integrated Development Environment.
Blackfin BF533 EZ-KIT Control The O in I/O Activating a FLASH memory “output line” Part 2.
Getting the O in I/O to work on a typical microcontroller Activating a FLASH memory “output line” Part 1 Main part of Laboratory 1 Also needed for “voice.
Blackfin BF533 EZ-KIT Control The O in I/O
Programming & Development of Mobile & Embedded Systems Lin Zhong ELEC424, Fall 2010.
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.
Input Laboratory: GPIO Pin control needed to have the Blackfin accept your commands Re-uses information from ENEL353 and ENCM369 courses and text books.
Blackfin Array Handling Part 2 Moving an array between locations int * MoveASM( int foo[ ], int fee[ ], int N);
Averaging Filter Comparing performance of C++ and ‘our’ ASM Example of program development on SHARC using C++ and assembly Planned for Tuesday 7 rd October.
TigerSHARC Laboratory Setting up the HPP-ICE environment ICT 318 / 320 Running versions of the Audio-talk-through program.
A Play Core Timer Interrupts Acted by the Human Microcontroller Ensemble from ENCM511.
Generating “Rectify( )” Test driven development approach to TigerSHARC assembly code production Assembly code examples Part 1 of 3.
N from what language did C++ originate? n what’s input, output device? n what’s main memory, memory location, memory address? n what’s a program, data?
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
Lab. 1 – Required Tasks. For more details – see the Lab. 1 web-site.
Over-view of Lab. 1 See the Lab. 1 web-site and the lecture notes for more details.
12/14/2015 Concept of Test Driven Development applied to Embedded Systems M. Smith University of Calgary, Canada 1 Automated Testing Environment Concepts.
ECE 3551 MICROCOMPUTER SYSTEMS 1 Introduction to Visual DSP++
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
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.
Lab. 1 – GPIO Pin control Using information ENEL353 and ENCM369 text books combined with Blackfin DATA manual.
Over-view of Lab. 1 See the Lab. 1 web-site and latter lecture notes for more details.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
Generating a software loop with memory accesses TigerSHARC assembly syntax.
Programming and Debugging with the Dragon and JTAG
Computer Terms Review from what language did C++ originate?
Computer Organization & Assembly Language Chapter 3
Generating “Rectify( )”
A Play Core Timer Interrupts
Automated Testing Environment
Generating a software loop with memory accesses
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
TigerSHARC processor and evaluation board
VisualDSP++ and Test Driven Development What happened last lecture?
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
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.
Getting serious about “going fast” on the TigerSHARC
Concept of TDD Test Driven Development
Explaining issues with DCremoval( )
Lab. 1 – GPIO Pin control Using information ENEL353 and ENCM369 text books combined with Blackfin DATA manual.
Input Laboratory: GPIO Pin control needed to have the Blackfin accept your commands Re-uses information from ENEL353 and ENCM369 courses and text books.
Handling Arrays Completion of ideas needed for a general and complete program Final concepts needed for Final.
Developing a bicycle speed-o-meter
Blackfin BF533 EZ-KIT Control The O in I/O
Building a simple loop using Blackfin assembly code
Computer Terms Review from what language did C++ originate?
Working with the Compute Block
Presentation transcript:

Just enough information to program a Blackfin Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller2 / 27  This will help to get ahead on the assignments

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller3 / 27 Tackled today Recipe for Just in time knowledge  Need a dollop of “C++” code  A smizzen of knowledge to build the simplest possible Blackfin assembly language for-loop { } and while { }  A pinch of Window’s Experience  And a bowl to put the ingredients in (a computer account with password) and somebody else to do all the clean-up (a partner) and a desk in Labs ICT318 and 320.

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller4 / 27 VisualDSP++ IDE Analog Devices’ integrated development environment (IDE) has been used in the following courses  Blackfin – ADSP-BF533 ENCM415 – Assembly language and interfacing (2004) ENSF413 – Switching to Blackfin for 2008 ENCM491 – Real Time Systems (2003) ENCM511 – New project oriented microcontroller course (2008) ENEL High speed embedded system architectures (2004) ENEL583/589 – Many 4 th year team projects (2004)  TigerSHARC – ADSP-TS201 ENCM515 – Comparative Processor Architectures for DSP (Since 1999) ENEL High speed embedded system architectures (2004)

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller5 / 27 Just enough to know  If time today will do a demo.  Build a directory :/ENCM415/Assignment  Remember to insert the BF533 board power plug (check that lights on board flash)  Activate VisualDSP -- Log into a station and use Analog devices CONFIGURATOR to set up a “BF533 session” to connect to the hardware  Use VisualDSP++ and activate a Blackfin BF533 session – lights should pause  Build a Blackfin Project, add to your directory  Add your C++ files to the project  Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc  Add your assembly ASM files to the Blackfin project  Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc  Don’t forget to add some tests so that you know the code is working

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller6 / 27 Analog Devices CONFIGURATOR

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller7 / 27 Run VisualDSP – Add New Project

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller8 / 27 WRITE main.cpp, ADD to Project

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller9 / 27 Then BUILD (which causes a LOAD) Build and load

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller10 / 27 Then Debug | Run the code

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller11 / 27 Prepare for Assignment – C++ result

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller12 / 27 C++ Version of an assignment

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller13 / 27 “auto-increment” of a pointer. Here is how to “try” to get compiler to do it

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller14 / 27 Prepare main( ) to call assembly code and CHECK the results

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller15 / 27 We thought we needed to build the function Assignment1_ASMversion( ) However the linker is worried about not finding _Assignment1_ASMversion__Fv Build WITHOUT ADDING assembly code file Error message is VERY SPECIAL

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller16 / 27 Standard Format “Assembly code” stub assignment1ASM.asm Header info Prologue Code to return value Epilogue A “stub” provides “just enough code” not to crash the development system. It acts as a “test” for the correct call from “main()”

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller17 / 27 Result using “Assembly code” stub Exactly the result we expected

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller18 / 27 Keyword – R0 – 32-bit Data Register R0 = 7; // This returns value 7 … Assembly code comment End of line marker 32 bit data register -- R0, R1, R2, R3, R4, R5, R6, R7

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller19 / 27 Keyword – P0 – 32-bit pointer Register 32 bit pointer register -- P0, P1, P2, P3, P4 Careful – when not in the assembler, the linker may give errors which mention p0 which stands for processor 0. The blackfin hardware can come in multi-core version (p0 and p1 for BF561) or multi-processor version.

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller20 / 27 Keyword 32-bit Frame pointer 32 bit Frame pointer -- FP As on many processors LINK and UNLINK instructions involve hidden operations on FP and SP (stack pointer) More on that in a later class

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller21 / 27 Keyword – Memory operations 32 bit memory read [ ] – long-word access R0 = [FP + 4]; If FP contains the value 0x then fetch the 32-bit value starting at memory location 0x and place in data register R0

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller22 / 27 Keyword – Memory operations 16 bit memory read W[ ] –word access R1.H = W[FP + 28]; If FP contains the value 0x then fetch the 16-bit value starting at memory location 0x and place in data register R1.H which is the UPPER part of the register R1 (R1.H and R1.L)

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller23 / 27 Keyword – Memory operations 8 bit memory reads are also possible B[FP + 4];

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller24 / 27  Perhaps time for a working example

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller25 / 27 Programmer’s model  32 bit data register R0, R1, R2, R3, R4, R5, R6, R7  16 bit data register R0.H, R1.H, R2.H, R3.H ……. R7.H R0.L, R1.L, R2.L, R3.L ………. R7.L  32 bit Pointer register (“address”) P0, P1, P2, P3, P4  NO 16 bit Pointer (“address”) registers You need to have 32 pointers to access 16-bit values stored ANYWHERE in the memory  32 bit Frame Pointer -- FP  32 bit Stack Pointer -- SP

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller26 / 27 Memory access MUST be done via a Pointer register 32-bit Memory access Place value 0x2000 into register P1 THEN R0 = [P1] accesses (reads) the 32-bit value at 0x2000 and leaves P1 unchanged (P1 still equals 0x2000) R0 = [P1 + 4] accesses (reads) the 32-bit value at 0x2004 and leaves P1 unchanged (P1 still equals 0x2000) R0 = [P1++] accesses (reads) the 32-bit value at 0x2000 and autoincrements P1 by the size of a long word (4 bytes) (P1 NOW equals 0x2004)

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller27 / 27 Memory access MUST be done via a Pointer register 16-bit Memory access Place value 0x4000 into register P2 THEN R0 = W[P2] accesses (reads) the 16-bit value at 0x4000 and leaves P2 unchanged (P2 still equals 0x4000) R0 = W[P2 + 4] accesses (reads) the 16-bit value at 0x4004 and leaves P2 unchanged (P2 still equals 0x4000) R0 = W[P2++] accesses (reads) the 16-bit value at 0x4000 and autoincrements P2 by the size of a word (2 bytes) (P2 NOW equals 0x2002)

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller28 / 27 Just enough to know  If time today will do a demo.  Build a directory U:/ENCM415/Assignment  Remember to insert the BF533 board power plug (check that lights on board flash)  Activate VisualDSP Log into a station and use Analog devices CONFIGURATOR to set up a “BF533 session” to connect to the hardware  Use VisualDSP++ and activate a Blackfin BF533 session – lights should pause  Build a Blackfin Project, add to your directory  Add your C++ files to the project  Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc  Add your ASM files to the project  Compile, Link and Run using the equivalent commands as with Microsoft Visual Basic, Visual Studio etc  Don’t forget to add some tests so that you know the code is working