Title: Overview of Lab' 1
1Over-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.
session so that you can demonstrate your
preparedness for Lab. 0 Dont be late
2Print out the Lab. 1 web-pages for use as
reference during the lab. period and during the
lab quiz Access to the web is not available.
- There will be a short 15-minute in-class quiz at
the start of the lab. period dont be late - Quiz will be based on knowledge demonstrated
during assignments 1 and 2 - You may make use of YOUR printed notes and YOUR
data books. Access to the web will not be
available
3Lab. 1
- We want to build a audio controller
- Audio in captured using audio A/D (CODEC)
- Audio out generated using audio D/A (CODEC)
- Manipulate the sound quality
- Push buttons to control audio controller
operations - LED lights to display operation results and sound
volume level (dancing lights)
4Lab. 1 Demonstration stream
- Your group must come into the laboratory class
prepared to be able to demonstrate all of the
following by the end of class period - You will make use of some of the code developed
during the assignments (Note assignments may be
due AFTER the laboratory) - Capture the audio signal and replay the signal
- Manipulate the audio signal
- Initialize the LED display interface (so that it
works) - Write a value to the LED display
- Read, and use, a value stored in the LED display
- Initialize the push-button controller interface
- Read, and use, a value provided by the
push-button controller. - Demonstrate tests to show that these operations
work as required - Understand, but not implement, how these
operations can be used to provide the
functionality of an audio controller.
5Main Code pseudo code
- main( )
- Launch the Analog Devices audio echo program
a background interrupt-driven task that is given
to you you will modify this code - InitializeLEDInterfaceASM( )
- InitializePFInterfaceASM( ) // Push-button
controller - Wait for button1 to be pressed and released
(ReadButtonASM() ), then play the sound at
half-volume. - Wait for button2 to be pressed and released, play
the sound at normal volume - Each time button3 is pressed and released,
transfer a known value from an array to the LED
display (WriteLEDASM( ) ) and check that the
expected value is displayed (ReadLEDASM( ) ) - Wait for button4 to be pressed and released, quit
the program (turn off the sound and stop the
processor) -
6Lab. 1 Application stream
- Everything that the demonstration stream
completes - In addition do it for real in real time
- Adjust the volume control dynamically
- On command -- make your favourite artist sound
weird - Generate the extremely fascinating (but
completely useless) dancing lights which change
with the audio stream volume level - Have the opportunity to spend even more hours
going for bonus marks to the laboratories where
the volume control is done using a light sensor
or
7Task 1 Demonstration / Application
streamsDownload audio-talk-through program
- If you have not already done so, download and
expand ENCM415Directory2006.zip file (used in
assignment 1) so that you have the correct
directory. structure and test driven development
environment needed for Laboratory 1. - Download and expand the files in
06CPP_Talkthrough.zip into your Lab1 directory. - Add the CPP_Talkthrough project in your Lab. 1
directory to the VisualDSP environment --
compile and link. - Download the executable (.dxe) file onto the
BF533 processor. - Hook up your CD or IPOD output to the CJ2 stereo
input. - Hook up your ear-phones to the CJ3 stereo output.
- Run the CPP_Talkthrough.dxe executable and check
that the talk through program is working.
8Task 2 -- Convert ProcessDataCPP( ) to
ProcessDataASM ( ) Both streams
- In talkthrough.h. add a prototype for your
assembly code function Process_DataASM - In ISR.cpp change to // call function that
contains user codeif 0 Process_DataCPP()
// Use the C versionelse
Process_DataASM() // C assembly code routines
especially developed for Lab. 1endif - Right-click on ProcessDataCPP.cpp entry. Use
"FILE OPTIONS to exclude linking - Use PROJECT clean project
- Add your ProcessDataASM.asm file to the project,
recompile and link. Check that your code works - More details on the Lab. 1 web pages
9Task 3 Initialize the Programmable flag
interface 16 I/O lines on the Blackfin
- Warning could burn out the Blackfin processor
if done incorrectly - You need to set (store a known value to) a number
of Blackfin internal registers - Most important ones
- FIO_DIR Data DIRection 0 for input
- FIO_INEN INterface ENable
- FIO_FLAG_D Programmable FLAG Data register
10Why do you need to know how to do read (load)
and write (store) on internal registers?
- Flag Direction register (FIO_DIR)
- Used to determine if the PF bit is to be used for
input or output -- WARNING SMOKE POSSIBLE
ISSUE - Need to set pins PF11 to PF8 for input, leave all
other pins unchanged
11Registers used to control PF pins
- Flag Input Enable Register
- Only activate the pins you want to use (saves
power in telecommunications situation) - Need to activate pins PF11 to PF8 for input,
leave all other pins unchanged
12Registers used to control PF pins
- Flag Data register (FIO_FLAG_D)
- Used to read the PF bits (1 or 0)
- Need to read pins PF11 to PF8, ignore all other
pins values
13Task 3 Setting up the programmable flag
interface
- Follow the instructions carefully
- FIO_DIR direction register write 0s to all
bits - FIO_INEN input enable register write 1s to
bits 8, 9, 10, 11 - Other registers set to 0
- There is a test program that will enable you to
check your code provide a screen dump of test
result.
14Task 4 Read the switches on the front pannel
- Final laboratory requirements
- SW1 connected to PF8 -- Mute button (This task)
- SW2 connected to PF9 -- Gargle button (Task 5)
- SW3 connected to PF10 -- Volume up (Task 7)
- SW4 connected to PF11 -- Volume down (Task 7)
- Build Initialize_ProgrammableFlagsASM ( )
- MUST HAVE 50 pin cable connected between logic
board and Blackfin - Logic board power supply must be turned on
15int ReadProgrammableFlags( )
16Other tasks depend on the stream
- Demo-stream
- WAIT for button1 to be pressed and released
(ReadButtonASM() ), then play the sound at
half-volume. - Wait for button2 to be pressed and released, play
the sound at normal volume - Application-stream
- WHILE button 1 is pressed add a mute operation
- WHILE button 2 is pressed add a gargle
operation - IF both pressed then mute operation
- After release of buttons (either order) normal
operation
17Gargling operation application stream
- Need to add a simple counter that increments by 1
every 1/44000 s (each time that an audio sample
is obtained) - Use the counter to turn the sound off and on
every ½ s - Gargling sound is produced.
- You need to have a signed demo sheet from a 2nd
or 4th year student. Bonus if the student is not
from department
18LED interface and Dancing Lights
- LED interface setup code provided
- Demo stream
- Transfer values from a known array to the LED
- Application stream
- Writing in C code (interfaced to your
assembly code) display the amplitude (absolute
value) of the sound will need to store 32
values in an array and generate (running) average
19Tests
- There will be software tests (E-TDD) to allow you
to demonstrate that your code works correctly - Note there are test codes available to test out
your equipment - This code can be used to test the switches and
the LED interface on your board. SwitchToLED.dxe - This is the final version of my code for Lab. 1.
DrSmithLab1Final.dxe