MPLABX IDE: PIC18 Project Setup Guide
MPLABX IDE: PIC18 Project Setup Guide
Adjusting an MPLABX IDE project for a bootloader program in C involves several steps: Start by configuring the project's linker settings. Right-click on the project's name in the Projects window and select 'Properties'. Under 'XC8 Linker', go to 'Option Categories' and choose 'Additional Options', then set the 'Code Offset' to 800. This adjustment ensures the correct memory allocation to accommodate the bootloader .
When developing a C program using the bootloader in MPLABX IDE for PIC18F4550, an additional step is required: adjust the linker settings to support the bootloader. Right-click on the project name from the Projects window and select properties. Under the XC8 linker, go to 'Option Categories' and select 'Additional Options'. Enter a Code Offset of 800 to ensure correct memory allocation for the bootloader .
To ensure correct output during program execution in MPLABX IDE, handle peripheral device selections by choosing appropriate peripheral switches like SW21, SW22, and SW23. These switches allow you to select specific peripherals necessary for interfacing and ensuring the accurate execution of programs involving peripheral devices .
To program the Hex file onto the PIC18F microcontroller using PICLoader, connect the USB cable to the board and launch PICLoader.exe. Go to 'Programs' → 'Settings', select the USB to serial COM port, and click OK. Enter 'Break/Reset Mode' by navigating to 'Programs' → 'Break/Reset Mode' or pressing F3, then press the reset switch on the Micro-PIC18F board. Enter 'Bootloader Mode' by going to 'Programs' → 'Bootloader Mode' or pressing F4. Open the Hex file by navigating to 'File' → 'Open', browsing to the project folder under 'dist' → 'default' → 'production', and selecting the file. Go to 'Programs' → 'Write Device' or press F6 to write the file. Upon successful writing, 'Write Complete' is displayed. Finally, press reset on the board to run the program .
To open an existing project in MPLABX IDE, navigate to the File Tab and select 'Open Project'. Then, browse to the location of the project and select the projectname.X file, which is the project file, and click 'Open Project' .
When checking the output of programs in the MPLABX IDE environment, it is essential to make the appropriate selection of peripheral switches. This involves utilizing switches SW21, SW22, and SW23 to ensure that the correct peripheral devices are active for the specific program execution being tested .
To find the COM Port Number assigned to a USB Serial Port on a Windows system, right-click on 'My Computer' and select 'Manage'. In the Computer Management window, navigate to 'Device Manager', then 'Ports (COM and LPT)', and there you will find the USB Serial Port number assigned by the system .
In MPLABX IDE, to create a new source or header file, go to the Project location in the Project window and click the + sign to expand the project space. Right-click on the 'Source Files' folder to create a new C source file, or right-click on the 'Header Files' to create a new C header file. Choose 'New' → 'C Source File' or 'C Header File', respectively .
To compile and clean build a project in MPLABX IDE, navigate to the project window, right-click on the project folder, and choose either 'Build' or 'Clean and Build'. This process compiles the project and removes previous build artifacts to ensure that no obsolete binaries are used during the build .
To create a new standalone project in MPLABX IDE for a PIC18F4550 using the XC8 compiler, start by creating a folder on your PC drive with an appropriate name. Launch the MPLABX IDE, click on the File Tab and select New Project. Choose 'Microchip Embedded → Standalone Project' and click Next. Under 'Select Device', choose 'Family → Advanced 8 Bit MCU (PIC18)' and device 'PIC18F4550', then click Next. For 'Select Tool', choose 'Simulator' and click Next. Under 'Select Compiler', choose 'XC8' and click Next. Follow with 'Select Project Name and Folder', provide a project name, and choose the project location using the Browse button. Ensure 'Set as main project' is unchecked and click Finish. For bootloader adjustment needed only for C programs, right-click on the project name in the Projects window and go to properties. Select XC8 linker, choose 'Additional Options' in Option Categories, and set Code Offset to 800.