1 / 19

Over-view of Lab. 1

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. session so that you can demonstrate your preparedness for Lab. 0 – Don’t be late.

ruby-tyler
Télécharger la présentation

Over-view of Lab. 1

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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. session so that you can demonstrate your preparedness for Lab. 0 – Don’t be late

  2. Print 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 – don’t 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

  3. Lab. 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)

  4. Lab. 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.

  5. Main 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) }

  6. Lab. 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 ………

  7. Task 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.

  8. Task 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 code#if 0      Process_DataCPP();  // Use the C++ version#else     Process_DataASM(); // C assembly code routines especially developed for Lab. 1#endif • 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

  9. Task 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 FLAGData register

  10. Why 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

  11. Registers 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

  12. Registers 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

  13. Task 3 – Setting up the programmable flag interface • Follow the instructions carefully • FIO_DIR – direction register – write 0’s to all bits • FIO_INEN – input enable register – write 1’s 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.

  14. Task 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

  15. int ReadProgrammableFlags( )

  16. Other 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

  17. Gargling 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

  18. LED 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

  19. Tests • 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

More Related