just enough information to program a blackfin n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Just enough information to program a Blackfin PowerPoint Presentation
Download Presentation
Just enough information to program a Blackfin

Loading in 2 Seconds...

play fullscreen
1 / 28

Just enough information to program a Blackfin - PowerPoint PPT Presentation


  • 159 Views
  • Uploaded on

Just enough information to program a Blackfin. 90% of this course can be done knowing less than 10% of the Blackfin Instructions Familiarization assignment for the Analog Devices’ VisualDSP++ Integrated Development Environment. Reminder – Tutorial tomorrow -- Thursday

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Just enough information to program a Blackfin' - evanthe


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
just enough information to program a blackfin

Just enough information to program a Blackfin

90% of this course can be done knowing less than 10% of the Blackfin Instructions

Familiarization assignment for the Analog Devices’ VisualDSP++Integrated Development Environment

slide2
Reminder – Tutorial tomorrow -- Thursday
  • This will help to get ahead on the assignments

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

tackled today
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 microcontroller

visualdsp ide
VisualDSP++ IDE

Analog Devices’ integrated development environment (IDE) has been used in the following courses

  • Blackfin – ADSP-BF533
    • ENCM415 – Assembly language and interfacing (2004)
    • ENCM417 – Switching to Blackfin for 2007
    • ENCM491 – Real Time Systems (2003)
    • ENEL619.23 -- High speed embedded system architectures (2004)
    • ENEL583/589 – Many 4th year team projects (2004)
  • TigerSHARC – ADSP-TS201
    • ENCM515 – Comparative Processor Architectures for DSP (Since 1999)
    • ENEL619.23 -- High speed embedded system architectures (2004)

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

just enough to know
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 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 microcontroller

analog devices configurator
Analog Devices CONFIGURATOR

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

run visualdsp add new project
Run VisualDSP – Add New Project

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

write main cpp add to project
WRITE main.cpp, ADD to Project

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

then build which causes a load
Then BUILD (which causes a LOAD)

Build and load

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

then debug run the code
Then Debug | Run the code

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

prepare for assignment c result
Prepare for Assignment – C++ result

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

c version of assignment
C++ Version of assignment

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

assignment talks about auto increment here is how to try to get compiler to do it
Assignment talks about “auto-increment”. Here is how to “try” to get compiler to do it

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

prepare main to call assembly code and check the results
Prepare main( ) to call assembly codeand CHECK the results

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

build without adding assembly code file error message is very special
Build WITHOUT ADDING assembly code fileError message is VERY SPECIAL

We thought we needed the function

Assignment1_ASMversion( )

However the linker is worried about not finding

_Assignment1_ASMversion__Fv

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

standard format assembly code stub
Standard Format“Assembly code” stub

Header info

Prologue

Code toreturn value

Epilogue

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

result using assembly code stub
Result using “Assembly code” stub

Exactly the result we expected

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

keyword r0 32 bit data register
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 microcontroller

keyword p0 32 bit pointer register
Keyword – P0 – 32-bit pointer Register

32 bit pointer register -- P0, P1, P2, P3, P4

Final exam question from last year

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 microcontroller

keyword 32 bit frame pointer
Keyword 32-bit Frame pointer

As on many processors LINK and UNLINK instructions involve hidden operations on FP and SP (stack pointer)

More on that in a later class

32 bit Frame pointer -- FP

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

keyword memory operations
Keyword – Memory operations

32 bit memory read [ ] – long-word access R0 = [FP + 4];

If FP contains the value 0x20000000 then fetch the 32-bit value starting at memory location 0x20000004 and place in data register R0

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

keyword memory operations1
Keyword – Memory operations

16 bit memory read W[ ] –word access R1.H = W[FP + 28];

If FP contains the value 0x20000000 then fetch the 16-bit value starting at memory location 0x20000028 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 microcontroller

keyword memory operations2
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 microcontroller

slide24
Perhaps time for a working example

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

programmer s model
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
    • P0, P1, P2, P3, P4
  • NO 16 bit Pointer registers
  • 32 bit Frame Pointer -- FP
  • 32 bit Stack Pointer -- SP

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller

memory access must be done via a pointer register
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 microcontroller

memory access must be done via a pointer register1
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 microcontroller

just enough to know1
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

M. Smith -- ENCM415 Assembly Language and Interfacing on the Blackfin ADSP-BF533 microcontroller