Tag - Tutorials

Using Push Button Switch – MPLAB XC8

Push Button Switch I hope that you already go through the first tutorial of MPLAB XC8, Getting Started with MPLAB XC8 - LED Blinking. In that tutorial we learn how to use an output pin by driving an LED. In this we will learn how to read an Input pin using a push button switch. We already seen that TRIS register is used to set direction of each IO pin, ie Input or Output and PORT register is used to read...

Getting Started with MPLAB XC8 Compiler – LED Blinking

In this tutorial we will learn How to Blink an LED with PIC Microcontroller using MPAB XC8 Compiler. Recently Microchip released a series of development tools including MPLAB X IDE and MPAB XC Compilers. MPLAB X IDE is a software that runs on a computer intended to develop applications for Microchip's Microcontrollers and Digital Signal Controllers. It can be used with Windows, Mac and Linux Operating Systems. It is called an Integrated Development Environment as it provides comprehensive facilities to...

Getting Started with PIC 18F Microcontroller – MikroC

In this tutorial we will learn how to program PIC 18F Microcontrollers using MikroC Pro compiler. I hope that you already know the basics of PIC Programming using MikroC compiler. If you are a beginner to this field, please read our first tutorial Blinking LED using PIC Microcontroller - MikroC. There are a lot of advantages for PIC 18F microcontrollers compared to 16F. Some of them are given below. PIC 18F is optimized for C while PIC 16F is not. ...

Read Modify Write Problem with Mid-Range PIC Microcontrollers

RMW Problem with PIC 16F Family Microchip's mid-range PIC Microcontrollers use a sequence of operations : Read, Modify and Write to change output state of a pin. In certain circumstances RMW operations might cause unexpected behavior of outputs. You might have already experienced this issue and struggled with it as you can't find exact reason with microcontrollers unexpected behavior. Mid-Range PIC Microcontroller uses two registers, TRIS and PORT to control the direction and status of an IO pin respectively. When you try...

Configuration Bits in Mid-Range PIC Microcontrollers

Device Configuration Bits allows the programmer to adjust certain condition that determines the operation modes of the microcontroller. That is the state of Configuration Bits determines the mode in which device operates when it is powered. These configuration bits are mapped in the program memory location 2007h. This location can't be accessed during normal operation and can be accessed only at the time of programming. Their placement is automatically taken care by the device programmer or ICSP programmer. Hence selection...

Generating PWM with PIC Microcontroller using Hi-Tech C

PWM (Pulse Width Modulation) is a powerful technique used to generate analog voltage using digital signals. It has a wide variety of applications such as controlling average power delivered to a load, generating analog voltage level, sine wave generation and DC Motor speed control. PWM signals are ON-OFF signals (hence the name Pulse) whose ON duration are changed (hence Width Modulation) according to our requirements. The fraction of time period for which the signal is ON to total time period is...

Interfacing LCD with PIC Microcontroller – Hi Tech C

16x2 Character LCD is a very basic LCD module which is commonly used in electronics projects and products. It contains 2 rows that can display 16 characters. Each character is displayed using 5x8 or 5x10 dot matrix. It can be easily interfaced with a microcontroller. In this tutorial we will see how to write data to an LCD with PIC Microcontroller using Hi-Tech C Compiler. Hi-Tech C has no built in LCD libraries so we require the hardware knowledge of...

>