Tag archives for XC8
Ethernet is the leading wired standard for networking as it enables to connect a very large number of computers, microcontrollers and other computer-based equipment to one another. With just a network switch, many different devices can easily communicate with one another with Ethernet, allowing different devices and equipment to be accessed remotely and this also provides a cost-effective and reliable means of remote control and monitoring. For microcontrollers which don't have an integrated Ethernet peripheral, Microchip offers a serial Ethernet chip that can easily be used by any microcontroller with an SPI interface to provide Ethernet capability to the application. The ENC28J60 is a popular 28-pin serial Ethernet chip, 10BASE-T stand alone Ethernet Controller with SPI interface, on board MAC & PHY, 8 Kbytes of Buffer RAM and an SPI serial interface. In this article we will learn how to use the ENC28J60 Ethernet controller with Microchip TCP/IP Lite Stack and MPLAB Code Configurator.
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 Interrupt registers and with MPLAB Code Configurator.
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.