This posts describes how to check the state of a single input pin of PIC microcontroller in C as well as assembly language. Note: For this tutorial I am using MPLAB X v5.0 but you can use any version upto v5.35. Version 5.35 is last version that included MPASM i.e. the assembler we require to…
Category: PIC18 C
Bit-wise Manipulation of PIC18 Ports
This posts describes how to do bit-wise manipulation of PIC18 ports without disturbing the rest of the pins. Note: For this tutorial I am using MPLAB X v5.0 but you can use any version upto v5.35. Version 5.35 is last version that included MPASM i.e. the assembler we require to compile the assembly code used…
How to program Input & Output Ports of PIC18 Microcontroller
This post describes how to program PIC18 microcontroller‘s input & output ports in C and assembly language. Note: For this tutorial I am using MPLAB X v5.0 but you can use any version upto v5.35. Version 5.35 is last version that included MPASM i.e. the assembler we require to compile the assembly code used in…
How to create a delay for PIC18 using a for loop in C language
This tutorial demonstrates how to create an accurate time delay for PIC18 microcontroller using a for loop in C language. We will create this delay without using a timer and verify it in MPLAB X simulator. Note: For this tutorial I am using MPLAB X v5.0 and XC8 v2.32. Note: The delay is exact only…
PIC18 Data Types in XC8 and MPASM
This post describes various PIC18 data types used in XC8 and MPASM. We will discuss both PIC18 assembly (MPASM) as well as PIC18 C (XC8) data types with examples. PIC18 Data Types in MPASM (Assembly) PIC18 is an 8-bit microcontroller in which all the internal registers are 8-bit or 1 byte wide. So PIC18 assembly…
How to simulate a PIC18 XC8 C project in Proteus
This tutorial will explain step by step how to create a XC8 C project in MPLAB X for PIC18 micro-controller and simulate it using Proteus. Note: For this tutorial I am using MPLAB X v5.0 and XC8 v2.32. Creating an MPLAB X C Project To simulate a PIC18 XC8 project in Proteus, lets first create…