In this application, we are not using the input samples delivered through the argument of the function. Then the process starts over, and the next audio sample is processed. The output of processSample will be delivered to the digital-to-analog converter, which eventually plays the sample on the speaker. Each time the analog-to-digital converter delivers a sample, it will pass on the value of that sample to processSample. The function uint16_t processSample(uint16_t x) sets up a callback function. Then the variable is scaled and send to the output as a floating point number.Īn XLAUDIO function, xlaudio_f32_to_dac14 handles the conversion of floating point to DAC code. The program repeatedly increments a global variable level from 0 to 99 and back. This program generates a sawtooth function on the DAC output. Finally remove the breakpoint and press the continue button.ġ #include "msp.h" 2 #include "xlaudio.h" 3 #include "xlaudio_armdsp.h" 4 5 int level = 0 6 7 uint16_t processSample ( uint16_t x )
#Msp432p401r wire library code#
The source code for this function, which is part of the MSP432 low-level library, is not known to the debugger. Single-step further into GPIO_setAsOutputPin( GPIO_PORT_P1, GPIO_PIN0). Describe the implementation of the xlaudio_errorledoff() function. Single-step through the code (yellow arrow right besides the red stop button). In the debugger, set a a breakpoint at xlaudio_errorledoff(). Thus, the latest application you programmed in the MSP432 MCU is always ready to go. You’ll notice that the program is stored in flash memory, and can survive power cycling. Start CCS again and power up the board again. After you have made modifications to the application, rebuild the application, and run it on the MSP432 MCU.Įxit CCS, power off the board. For example, try to change the duty cycle and period of the blinking behavior. Try to change the behavior of the blinking LED. In this case, the LED continues to blink.īefore moving on, take a moment to make sure that you understand all the steps involved in editing, compiling, and running a program. Once you exit the debugger, the program loaded onto the hardware continues to execute.
To exit the debugger, press the stop button. The LED on the MSP432 board will now blink. You can continue execution by pressing the green play button.
#Msp432p401r wire library download#
As the debugger initializes, it will download the program to the board and halt execution just at the start of the main function. The quickest way to achieve this is to run the debugger, available by clicking the small bug in the top menu of CCS. Once the program successfully compiles, you can download it on the board and run it. On the other hand, point to accidents waiting to happen (such as ‘array access is out of bounds’). That you’ve defined), and those warnings can be ignored under thre right circumstances. Some warning messages point to very minor aspects (such as not using a variable This is especially true for applications running on an embedded platform such as MSP-EXP432P401R. It is easier to catch bugs before they occur.
Keep in mind that a warning message typically will not stop the compiler from producing an executable program. The general rule should be that you should never let a warning go, unless you fully That includes the following projects: lab1_blinking_led, lab1_sawtooth and lab1_voicerecorder.Ĭatching and interpreting warning messages from a compiler is an effective mechanism to pick up clues on potential bugs Select all projects available from the Assignment Repository. Click Browse and find a good destination. The default selection of CCS is R:/git/repositoryname - which is most likely not a drive letter that you have available.
The local destination must be a directory on your local harddrive. Select the master branch, and choose an appropriate local destination for your repository. Select Clone URI.Įnter the Team repository URI, as well as your GitHub credentials, in the next Source Git Repository window. Select Git and Projects from Git.Ī repository selection window opens. from the pulldown menu, followed by Import.Ī source selection window opens. In the project explorer pane, right-click and select Import. Take the following steps to download the repository into CCS. Copy the repository link that was created for your lab to the clipboard and start code composer studio.