0% found this document useful (0 votes)
69 views3 pages

MPLABX IDE: PIC18 Project Setup Guide

Uploaded by

anismulla9740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views3 pages

MPLABX IDE: PIC18 Project Setup Guide

Uploaded by

anismulla9740
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MPLABX IDE for program development.

Step 1: Creating a New Project.


• Create a folder on the PC drive and give it appropriate name.
• Now click on the MPLABX IDE icon and start the IDE.
• Go to the File Tab.
• Click on New Project.

Step1: Choose Project:


• Select : Microchip Embedded à Standalone Project. Click Next.

Step2: Select Device:


• Select: Family àAdvanced 8 Bit MCU (PIC18).
• Select: Device: PIC18F4550. Click Next.

Step3: Select Tool: Simulator. Click Next.


Step4: Select Compiler àXC8. Click Next
• Note: if you are developing a program using assembly language then select the
compiler as àmpasm(v5.68)

Step5: Select Project Name and Folder.


• Give Project Name.
• Select project Location (the project folder we created) using Browse Button.
• Uncheck Set as main project option.
• Click Finish.

Step6: Adjustment for Bootloader.(only for C programs)


• From the Projects window Right click on the projectnameand Go to properties.
• Select XC8 linker.
• In Option Categoriesàselect Additional Options.
• In Code Offset: write 800.

Step 2: Opening an existing project.


• Go to the File Tab.
• Select Open Project.
• Browse to the location and select the projectname.X file (project file). Click on Open
Project .

Step 3: Creating a new Source file and Header File.


• Go to the Project location in the Project window.
• Click the + sign to open the project space.
• Right Click on the Source Files folder (for a C file) and Header files (for a .h file).
• New à C Source file / or C Header File.

Step 4: Compiling Project.


• Step1: Go to project window.
Right Click on the project folder and select Build or Clean and Build.

Step 5: Finding the COM Port Number.


• Right click on My Computer à Manage.
• The Computer Management window will open.

• Click on Device Manager à Ports (COM and LPT)


• Check for the USB Serial Port number assigned by the system.

Step 6: Programming the Hex File USING PICLoader.


• Connect the USB Cable to the Board.
• Step 1: Double Click the [Link].

• Step2: Go to Programs à Settings.

• Select the USB to serial com port. Click OK.

• Step3: Go to Programs à Break/Reset Mode or Press F3.


• Step4: Press the Reset Switch on the Micro-PIC18F Board.

• Step5: Go to Programs àBootloader Mode or Press F4.

• Step6 : Select Hex file :


File àOpen àBrowse to location.

Project folder àdist àdefault->production.

• Step7: Go to Programs àWrite Device or Press F6

After successful writing it will display Write Complete at the bottom.

• Step8: Press Reset on the board to Run the program.

Peripheral Device Selection Matrix.


While using the peripherals for checking the output of the program please make the
appropriate selection of peripheral switches SW21, SW22 and SW23.

Common questions

Powered by AI

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.

You might also like