Running the App I/O Code
To run the App I/O examples from Using App I/O with 8- and 16-Bit MCUs or Using App I/O with 32-Bit MCUs:
- Create a project using the Project wizard:
- Select a supported device.
- Select REAL ICE™ or ICD 3 as the hardware tool.
- Use an MPLAB® XC C Compiler as the language toolsuite.
- Select File > New File to create and name a new C Source File. In the Editor window that opens, add the previous code and save.
- Right-click on the project name in the Projects window and select Properties. In the Project Properties window, click on “xcnn-gcc” under Categories, where nn is either 16 or 32. Under “Option Categories”, select “General” and check the “Enable App IO” checkbox.
- Some examples may require a heap. In the Project Properties window, click on “xcnn-ld” under Categories, where nn is either 16 or 32. Under “Option Categories”, select “General” and enter a heap size (e.g., 512) in the text box "Heap size (bytes)".
- Build the project (Right-click on the project name and select “Build”).
- Select Window > Debugging > PIC App IO to open the Application In/Out window.
- Click on the Properties button (on the left of the window in Figure 1) to launch the Set App IO Properties dialog. Under Capture click On.
- Debug Run or Run the project.
- Enter a text value in the Input text box. Hit <Enter>.
- View the output in the Output text box (Figure 2).
Figure 1: Set App I/O Properties
Figure 2: App In/Out Window
Change Input and Output Formats by opening the Set App IO Properties dialog and running the program again to see what outputs result for different inputs.