Tag archives for XC8
An automatic temperature control system has the ability to monitor and control the temperature of a specified space without human intervention. This project uses a PIC microcontroller to automatically control the temperature of an area. This area could be a small plant, a house or any place or device that require a controlled temperature like an incubator (egg) for example. The desired temperature setting is entered using a keypad. The temperature of the area is measured using an analog temperature sensor. The microcontroller reads the temperature every 10 s and compares it with the desired value. If the desired value is higher than the measured value, then the heater is turned ON, if on the other hand the measured value is higher than the desired value, then the fan is switched ON. An LCD display shows the measured temperature continuously. The project is designed using MPLAB XC8 Compiler
A GSM modem is a wireless modem that works with a GSM wireless network. GSM stands for Global System for Mobile communications, this architecture is used for mobile communication in most of the countries in the world. A wireless modem acts basically like the traditional dial-up modem, the main difference is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. Besides the dial-up connection, GSM modem can also be used for sending and receiving SMS which is also one of the key features of GSM modem. A GSM modem can be used in many applications including: Remote System Monitoring, Remote Controlling System, Prepaid Electricity, Home Alarm System, Home Automation, Data loggers, Vehicle tracking, etc. In this article we are going to learn the basics commands to control a GSM modem with a PIC Microcontroller, including sending and receiving an SMS using MPLAB XC8.
Interrupts are one of the most powerful features of PIC Microcontrollers, interrupts make it possible to create applications that can respond to external stimulus in real time. An interrupt is basically an event that requires the microcontroller to stop normal program execution and then to jump to execute a program code related to the event causing the interrupt. An interrupt requires immediate attention, only once the microcontroller will finish executing the interrupt code, then it can go back to continue with the main program. The interrupt code is called Interrupt Service Routine (ISR) or Interrupt Handler. In this article we're gonna learn how to implement Interrupts using Microchip XC8 compiler.
There are three types of memories in a PIC Microcontroller, The Flash Program Memory, The Data Memory (RAM) and The EEPROM Data Memory. The code that is written by the user to perform a specific task by the microcontroller is stored in the Flash. Flash memory makes it possible to program a microcontroller many times because it is re-writable, this memory can be written into and erased many times. RAM Data Memory is used for storing data temporarily during program execution and it is volatile. The third memory is EEPROM memory which is an abbreviation for Electrically Erasable Programmable Read Only Memory. EEPROM memory can be read and write electrically, can be accessed through program. It is a non volatile memory but has slower response time. EEPROM memory can be used to store data which should not be loss during power loss or CPU reset. such data could be like device parameters or settings which could be entered once and stored in the EEPROM. In this article, we will learn how to read or write data to the microcontroller built-in EEPROM.
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.
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.
Real Time Clock and Calendar functions are very important in many projects especially in data logging devices where a real time stamp is required in each record. This clock uses the DS1307 which 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. This chip 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.
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.
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 interface a single 7-Segment display with PIC Microcontroller using MPLAB XC8 compiler.
The MPX4115A is an atmospheric pressure sensor powered by 5V and delivers and output from ~0.25V to ~4.75V based on the pressure detected at room temperature (25°C). The device provides a linear output based on pressure. It can measure pressures between 15kPa and 115kPa. Note that 1 atmosphere of pressure at sea level is equal to 101,325 Pa or 101 kPa. This sensor is ideal for microcontroller based barometer, altimeter, data logger or weather station applications. In this article, we're gonna create a simple Digital Barometer using MPLAB XC8 compiler.