Page 2
Select Mode, Total Endurance, TSHARC, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies.
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the document. ® For the most up-to-date information on development tools, see the MPLAB IDE online help. Select the Help menu, and then Topics to open a list of available online help files.
Page 6
MPLAB Starter Kit for PIC18F User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Represents Examples Arial font: ® Italic characters Referenced books MPLAB IDE User’s Guide Emphasized text ...is the only compiler...
Page 7
Preface RECOMMENDED READING This user’s guide describes how to use the MPLAB Starter Kit for PIC18F. Other useful documents are listed below. The following Microchip documents are available and recommended as supplemental reference resources. Readme Files For the latest information on using other tools, read the tool-specific Readme files in the Readmes subdirectory of the MPLAB IDE installation directory.
Page 8
These include MPLAB ICD 2 and PICkit™ 2. ® • MPLAB IDE – The latest information on Microchip MPLAB IDE, the Windows Integrated Development Environment for development systems tools. This list is focused on the MPLAB IDE, MPLAB IDE Project Manager, MPLAB IDE Editor and MPLAB SIM Simulator, as well as general editing and debugging features.
INITIAL BOARD SETUP With its pre-installed demo application, the MPLAB Starter Kit for PIC18F is designed to be used straight out of the box. Except for a single connection to a computer, no additional hardware or configuration is necessary.
Page 12
Before connecting the starter kit to any computer for the first time, it is important to install the accompanying software on the MPLAB Starter Kit for PIC18F CD first. This ensures that both the MPLAB development environment and C compiler, as well as the relevant tutorial and help files for the starter kit, are ready to use when the board is connected.
Chapter 2. The Demonstration Application This chapter describes the precompiled demonstration applications that are provided with the MPLAB Starter Kit for PIC18F, and how various features highlight the device’s processing power and hardware functionality. These include: • Bootloader from the MicroSD Memory Card •...
Page 14
MPLAB Starter Kit for PIC18F User’s Guide When the MicroSD bootloader starts, it initializes the capacitive touch routines and the OLED display. It then monitors for a MicroSD memory card insertion. When an insert event is detected by the bootloader, the MDD file system is initialized and the file structure is displayed on the OLED.
® When using the MPLAB C18 C compiler to develop PIC18F firmware for an application, the linker file must be changed to protect the program memory used by the bootloader and the interrupt handler must be updated with the new vectors.
MPLAB Starter Kit for PIC18F User’s Guide USB HID JOYSTICK DEMO This demo uses the starter kit as a USB joystick. To test the joystick feature, open the Game Controller applet in the Control Panel. In the following dialog, select “Joystick Demo” under “Installed Game Controllers”, then click Properties.
MPLAB Starter Kit for PIC18F User’s Guide Note: The demo PC application is intended to be run under Windows and was ® ® written in Microsoft Visual C++ . If the executable fails to launch correctly, verify that the .NET Framework Version 2.0 (or later) redistributable pack- age has been installed.
This greatly assists you in debugging your firmware and hardware together. Special starter kit software interacts with the MPLAB IDE application to run, stop and single step through programs. Breakpoints can be set and the processor can be reset.
MPLAB Starter Kit for PIC18F User’s Guide SETTING UP AN EXAMPLE APPLICATION FOR DEBUG Once the starter kit software is installed, the on-board debugger must be connected to any available USB port on the PC or powered hub, then to the starter kit at the mini-B receptacle, J2, on the debugger/programmer side of the board (Figure 3-1).
Page 21
Developing an Application The MPLAB IDE software that is installed on your PC by the starter kit CD-ROM auto- matically opens an example application that you may use to examine debug features of the starter kit. To prepare the application for debug: 1.
For the example code given, everything works fine. However, when you are developing code, it will likely not work the first time and need to be debugged. MPLAB IDE provides an editor and several debug features, such as breakpoints and Watch windows, to aid in application code debugging.
Page 23
• Double-click on a file in the Project window to open an existing code file. See an example Project window in Figure 3-4. FIGURE 3-4: EXAMPLE PROJECT For more information on using the editor to create and edit code, see MPLAB IDE Editor Help. 3.3.2 Using Breakpoints and Mouseovers To set a breakpoint in code, use one of the following methods: •...
It also uses program memory and file register loca- tions in the target device during debugging. These locations are not available for use by user code. In the MPLAB IDE; registers marked with an “R” in the register displays represent reserved registers.
1. Unplug the USB cable from the starter kit. 2. Plug the USB cable back into the starter kit. MPLAB IDE should automatically reconnect to the starter kit. If this does not work, do the following: 1. Check the USB connection between the PC and starter kit at both ends.
MPLAB STARTER KIT FOR PIC18F USER’S GUIDE Chapter 4. Hardware This chapter provides a functional overview of the MPLAB Starter Kit for PIC18F, and identifies the major hardware components. Topics covered include: • Application Functional Overview • Programmer/Debugger Functional Overview •...
MPLAB Starter Kit for PIC18F User’s Guide The microcontroller uses one of its A/D Converter channels to sample and convert the potentiometer’s value to a digital value. Four additional A/D channels are used to monitor the directional touch pads of S1. The values from these channels are analyzed with the CTMU to determine when a touch-and-release event occurs on any of the pads.
Appendix B. USB Current Draw Requirements This chapter describes the key USB specification current limits and provides a func- tional overview of the soft start circuitry used by the MPLAB Starter Kit for PIC18F to meet them. The appendix includes the following sections: •...
MPLAB Starter Kit for PIC18F User’s Guide PIC18F SOFT START CIRCUITRY One strategy to meet the key USB current specifications is to include a software controllable soft start mechanism. The starter kit implements the simple soft start circuit shown in Figure B-1.
Page 40
MPLAB Starter Kit for PIC18F User’s Guide B.3.2 AppPowerReady() The AppPowerReady() function returns a BOOL data type that will return TRUE if the soft start is complete or FALSE if it is not. This function should be called periodically during the soft start to insure that the soft start continues ramping properly.
Need help?
Do you have a question about the MPLAB and is the answer not in the manual?
Questions and answers