Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Archives for MPLAB XC8 - Page 2

Multiplexing of 7-Segment Displays with PIC Microcontroller – XC8

image-269
The 7-segment display is the earliest type of an electronic display that uses 7 LEDs bars arranged in a way that can be used show the numbers 0 - 9. (actually 8 segments if you count the decimal point, but the generic name adopted is 7-segment display.) These devices are commonly used in digital clocks, electronic meters, counters, signalling, and other equipment for displaying numeric only data. It is not different from an LED in terms of interfacing, by turning the appropriate segments ON and OFF we can display easily the numbers 0 to 9 and optionally the decimal point (DP). The segments of the displays are normally referred to by letters ‘a’ to ‘g’. In this article we are going to learn how to multiplex two or more 7-Segment displays to be able to display numbers higher than 9. MPLAB XC8 compiler is used in this tutorial.
');

Pulse Width Modulation (PWM) with PIC Microcontroller – XC8

image-1592
Pulse width modulation (PWM) is a technique of controlling the amount of power delivered to an electronic load by switching ON and OFF a digital signal. This is the simplest technique that can be used to produce analog voltages from a digital one. The fraction of the period for which the signal is ON to the total period is known as the duty cycle. The average DC value of the signal can be varied by varying the duty cycle. The duty cycle can be anywhere between 0 (signal is always off) to 1 (signal is constantly on). Suppose, if the signal has +5 V while it is ON and 0 V during OFF condition, then by changing the duty cycle of the signal, the amount of energy transferred to device can be varied. This method is commonly used for controlling speeds of DC motors, brightness of lamps, Sine wave inverters, Digital to Analog Converter (DAC) etc.
');

USB Communication with PIC Microcontroller

image-266
Many computers especially portable ones do not have a serial port (COM Port) anymore. When a connection to a Personal Computer (PC) is required, a USB is the choice. The Universal Serial Bus (USB) is the widely used interface in electronic consumer products today. Most of electronic devices have at least one USB port on them, this include PCs, cameras, GPS devices, printers and so on. Some PIC18 microcontrollers support USB interface directly. 16bits (PIC24) and 32-bits (PIC32) pic microcontrollers have also an embedded USB interface. In this article we will learn how a communication between a host PC and a microcontroller can be achieved with a USB bus.

Interfacing The DS1307 Real Time Clock With PIC Microcontroller – XC8

image-280
The DS1307 is a low power serial real time clock/calender with full binary coded decimal (BCD) clock/calendar plus 56 bytes of Non Volatile Static RAM. The RTC provides year, month, date, hour, minute and second information. The end date of months is automatically adjusted for months fewer than 31 days including leap year compensation up to year 2100. It can operate either in 24-hour format or 12-hour format with AM/PM indicator. Data and Address are transferred serially through a bidirectional I2C bus. DS1307 comes with built-in power sensing circuit which senses power failures and automatically switches to back up supply. Timekeeping operation continues while the part operates from the backup supply. The DS1307 RTC uses an external 32.768kHz Crystal Oscillator and it does not requires any external resistors or capacitors to operate.

Microcontroller Interfacing – Basics

image-262
Microcontrollers have become very useful in embedded design as they can easily communicate with other devices, such as sensors, switches, LCD displays, keypads, motors and even other microcontrollers. A microcontroller is basically used as the brain or intelligent processing unit to control other devices connected (interfaced) to it in embedded systems just like a PLC in industrial automation. To interface a device to a microcontroller simply means to Connect a device to a microcontroller. This article will make it easier to anybody with very limited experience in electronics to learn how to interface commonly used devices like an LED, a switch, a transistor, a relay, a display, a keypad, a buzzer and so on to a PIC microcontroller.

Microcontroller Interfacing – Advanced

image-257
Microcontrollers have become very useful in embedded design as they can easily communicate with other devices, such as sensors, switches, LCD displays, keypads, motors and even other microcontrollers. A microcontroller is basically used as the brain or intelligent processing unit to control other devices connected (interfaced) to it in embedded systems just like a PLC in industrial automation. To interface a device to a microcontroller simply means to Connect a device to a microcontroller. This article will make it easier to anybody with very limited experience in electronics to learn how to interface to a PIC Microcontroller some advanced components Graphical LCD, Quad 7-Segment Display, SD Card, DC Motor, GSM modem, GPS module, Real Time Clock and so on.

Microcontroller Interfacing – Sensors

image-2292
Microcontrollers have become very useful in embedded design as they can easily communicate with other devices, such as sensors, switches, displays, keypads, motors and even other microcontrollers. A microcontroller is basically used as the brain or intelligent processing unit to control other devices connected (interfaced) to it in embedded systems just like a PLC is in industrial automation. Interfacing a device with a microcontroller in simplest terms simply means to connect a device to a microcontroller. This article will make it easier to anybody with very limited experience in electronics to learn how to interface different sensors widely with a PIC Microcontroller.

Interfacing a Relay with PIC Microcontroller – XC8

image-254
A relay is an electromagnetic switch which is used to switch High Voltage/Current using Low power circuits. Relays isolate as well low power circuits from high power circuits, this is a good feature especially for safety reasons a section of the circuit with high dangerous voltage/current could be isolated from the user. When a low voltage is applied to the relay (coil wounded on a soft iron core), this coil becomes a magnet which in turns energizes the soft iron core which closes or open the high voltage/current contacts of the relay. A relay can be used to switch higher power devices such as motors, light bulbs solenoids etc. In this article we are going to learn how to interface a relay to a PIC Microcontroller, we will learn as well how to control devices connected to the relay using MPLAB XC8 compiler.

Interfacing Matrix Keypad with PIC Microcontroller – XC8

image-249
Keypads are small keyboards that are used to enter numeric, alphanumeric or select configuration data to microcontroller systems. Keypads are available in a variety of sizes. The common sizes are 3x3, 4x3 and 4x4 keypads. A matrix keypad is basically a combination of push-buttons in a way to form rows and columns. In this way the number of input/output pins necessary for their connection to a microcontroller is reduced. A 4x3 keypad requires 7 input/output pins instead of 12 and a 4x4 will require 8 input/output pins instead of 16 pins. Keypad is a widely used input device with lots of application in our everyday life: Telephone, ATM, electronic lock, Calculator, Industrial process, Timers etc. In this article, we are going to learn how to interface a matrix keypad with an LCD display using Microchip XC8 compiler.