Setting up Visual DSP 3 0 environment Lab
Setting up Visual. DSP++ 3. 0 environment Lab. 1 M. Smith, Electrical and Computer Engineering, University of Calgary, Canada smithmr @ ucalgary. ca
ENCM 515 Lab. 1 -- Visual. DSP basics z Select partners -- 2 people per station and select station in ICT 320 with Summit / Mountain ICE capability. y Stations throughout the Department support the 20 floating licenses for Visual. DSP++3. 0 and the ADSP-21061 simulator z Build a Visual DSP project – Looking at developing a simple IIR (Infinite duration Impulse Response filter) z Test out Visual. DSP software simulation environment z Set up and test out Visual. DSP hardware environment y Develop simple IIR filter y Test in stand-alone situation y Test with Lab. 0 y Test running LOCAL_AUDIOSOURCE program – will need ear-phones for testing 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 2
Checking that the software exists z Use lab. 0 program to test your station z Remember to HOLD-DOWN control-key while activating Visual. DSP++ to ensure that you can have a choice of session z. Make sure that you exit from Visual. DSP++ before hooking up the ICE probe to the boards. z. Also connect the probe to the boards, then power up the boards, then activate Visual. DSP++ to avoid probe damage 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 3
Configuring ICE hardware --1 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! z Make sure that you have exited from Visual DSP and powered down the boards before connecting the ICE probes to the boards z Use a Proper wrist grounding strap to avoid electrostatic discharge. z Power down the EZ-LITE board and remove the two jumpers from the EZ-ICE socket. Place the jumpers into the electrostatic bag. z Identify the ICE cable coming from the Lab. Station PC. These cables are connected to special hardware on the ICT 320 stations (Summit ICE). 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 4
Configuring ICE hardware -- 2 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z Identify the ICE cable coming from the Lab. Station PC. Connect the ICE Probe (from the lab. kit) to the ICE cable. y If you are having to force the probe onto the connector then you are connecting it the wrong way. y Connect the ICE probe to the EZ-ICE JTAG socket on the board (Collection of about 14 pins in 2 rows near the processor chip) y There is a right and wrong way. The correct way will have the probe cable coming in from the top of the board and NOT over the top of the SHARC processor chip. The missing pin on the EZ-ICE header corresponds to the blocked pin on the probe connector. z Check that the board “input jumpers” (JP-8, JP-9) are set to “LINE” and NOT to MIC to avoid destroying the mic amplifiers z Power up the board. DON’T power Visual. DSP up yet. 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 5
Configuring ICE hardware -- 3 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z Add your “stereo” head phones to Output Jack (J 22 - jack nearest corner) -- you should hear the dreaded “Peter Gunn” z Select and run Programs | Visual. DSP | JTAG ICE Configurator from the Windows START MENU 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 6
Configuring ICE hardware -- 4 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z In the configuration window y Select Summit ICE (ICT 320), Select Copy y Change Type to EZ-ICE -- followed by OK. z You now have configured the system to accept the in-circuit emulator as one sessionfor use during debugging code. You should not have to do this configuration again if YOU come back to the same laboratory station. z Use ICE Test Utility program to test out connections. 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 7
Checking that the Hardware talks to Visual. DSP++ z Use lab. 0 program to test your station z Remember to HOLD-DOWN control-key while activating Visual. DSP++ to ensure that you can have a choice of session. You now want – Summit ICE session z. Make sure that you exit from Visual. DSP++ before disconnect the ICE probe to the boards. z. Also exit from Visual. DSP, power down the board and then disconnect the probe. 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 8
Test -- hard ware z Reactivate Visual. DSP – Hold down control key z From new session list select y DSP 0 (ADSP-21061) Ez-kit ADSP-21061 ADSP-21 xxxx Summit ICE z Click OK on File could not be found window if it appears. y Download lab 0. prj file y Activate the. tcl file z We now need to display the input and output files associated with this executable y Activate the 2 plot windows y Activate the Run and Pause (0 x 7 F) option z Run the program -- should go a lot faster (if you are not still run the simulator by mistake (MFE -- my favourite error)). 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 9
To Power down ICE hardware -- 5 TAKE CARE -- THESE ARE VERY EXPENSIVE PROBES -- I want to use them for a number of years! Please use proper grounding strap. z. Make sure that “run light” on the probe is off y. This means exit “debugging environment” program y. If you have crashed the system, you may have to reactivate the debugging program and then exit again before the light goes off. z. Power down the 21061 board and then disconnect -- the probe is “very expensive” to replace. 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 10
Main Subroutine void main(void){ int polar = BIPOLAR; // Build the left and right channels Build. Signal. Channel( left_channel, LEFTCHANNELPERIOD, polar ); Build. Signalchannel( right_channel, RIGHTCHANNELPERIOD, polar ); // Pass the left and right channel through the low and high pass filter Low. Pass. Filter( left_channel, MAXCHANNELLENGTH, low_pass_output ); High. Pass. Filter( right_channel, MAXCHANNELLENGTH, high_pass_output ); // Set the printing flag Print. Activation( NONWRITE ); // Print if printing is activated if( Check. Print. Activation() ) { puts( "The program runs successfully. " ); fflush( stdout ); } } 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 11
Audio Channel Construction void Build. Signalchannel( int *channel_in, const int channel. Period, const int polar ) { int point = 0, signal. Value = 0, half. Channel. Period = 0, point. Count = 0; half. Channel. Period = channel. Period / 2; // divided the value channel. Period by half point. Count = 1; // store a periodic square wave signal into the array for( point = 0; point < MAXCHANNELLENGTH; point++ ) { if( point. Count > half. Channel. Period ) { if( signal. Value == ZERO ) if( polar == BIPOLAR ) signal. Value = -CHANNELPEAK; else signal. Value = ZERO; } else signal. Value = CHANNELPEAK; } point. Count = 1; } // save the filtered value *channel_in = signal. Value; // increment pointer and counter channel_in++; point. Count++; ENCM 515 -- Setting up Visual. DSP++3. 0 Environment } 3/3/2021 12 Copyright M. Smith -- smithmr@ucalgary, ca
(Poor) Low Pass IIR filter #define FILTERCOEFF 0. 1 #define ONEMINUSFILTERCOEFF 0. 9 void Low. Pass. Filter( int *channel_in, const int channel_in_length, int *channel_out ){ static float old. Value float new. Value int point for( point < channel_in_length ) { new. Value = ( float ) channel_in(point); channel_out(point) = ( integer ) old. Value; old. Value = ONEMINUSFILTERCOEFF * old. Value + FILTERCOEFF * new. Value; ENCM 515 -- Setting up Visual. DSP++3. 0 Environment } 3/3/2021 Copyright M. Smith -- smithmr@ucalgary, ca 13
High pass filter z. Try the effect of z. High pass signal = signal – low pass (signal) 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 14
Simple assembly code link demo z. The laboratory involves a simple example of linking to an assembly code routine y. Basically, check an input parameter and then do something based on that decision y. Examine the code put out by the “C” compiler to get an idea of the required format 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 15
If you move fast enough z. Cut and paste the IIR filter from Lab. 1 into the process sound. c file z. Change the INPUT sound options to SQUARE_WAVE and SIMPLE_IIR filter and check that the code from Lab. 0 works 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 16
For the really keen and “gifted” z Gifted – means lucky enough not to make too many mistakes z Audio-test y Copy your Lab. 0 project file as “lab 0. online. prj” y Unlink to the offline library and relink to the “online” library. y Set the compile options to “-D LOCAL_AUDIOTEST” y Use ear phones and run the program y Pressing switch on the board will cut out the processing so you can hear the unprocessed sound y The low-pass filter will make the sound like that from a 1910 phonograph – which were unable to record the high-frequency sounds on the wax cylinders y See ECE-ADI-Project web-pages – Lab. 2 for more details 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 17
ENCM 515 Lab. 1 -- Visual. DSP basics z Select partners -- 2 people per station and select station in ICT 320 with Summit / Mountain ICE capability. y Stations throughout the Department support the 20 floating licenses for Visual. DSP++3. 0 and the ADSP-21061 simulator z Build a Visual DSP project – Looking at developing a simple IIR (Infinite duration Impulse Response filter) z Test out Visual. DSP software simulation environment z Set up and test out Visual. DSP hardware environment y Develop simple IIR filter y Test in stand-alone situation y Test with Lab. 0 y Test running LOCAL_AUDIOSOURCE program – will need ear-phones 3/3/2021 ENCM 515 -- Setting up Visual. DSP++3. 0 Environment Copyright M. Smith -- smithmr@ucalgary, ca 18
- Slides: 18