The EEPROM (ELECTRICALLY ERASABLE PROGRAMMABLE READ ONLY MEMORY) is a very useful memory which can be used for storing data. The data storing and retrieving from any EEPROM memory is very simple compared to other kind of memories. As the name suggest the memory is electrically programmable and hence the data will be sustained in the memory until it is electrically erased or reprogrammed.There are lots of EEPROM chips available most of them are easy to interface with a microcontroller. It would be even better if the microcontroller itself has a built-in EEPROM. The microcontroller used in this project is PIC18F4550 and it also has an inbuilt EEPROM memory other than the flash memory. The data can be easily stored into or retrieve using simple codes. The PIC18F4550 has 256 bytes of internal EEPROM memory.The internal EEPROM of microcontrollers are very useful to store important data regarding their operation. They are used to store data like previous status, last log in/out time, last data received before shutting down or power failure.
The Global System for Mobile (GSM) communication is the Second Generation of mobile technology. Although the world is moving towards Third and [[wysiwyg_imageupload::]]Fourth generation but GSM has been the most successful and widespread technology in the communication sector. GSM technology paved a new way for mobile communication.This project explains the interfacing of a GSM Module with a PIC microcontroller. It also covers a way to dial a particular GSM mobile number as well as send a message to it using AT Commands with the help of PIC18F4550.As explained earlier (refer GSM interfacing with 8051), a line converter MAX232 is employed to convert the RS232 logic data of GSM Module to TTL logic so that it can be processed by the microcontroller. In this project, instead of RS232 logic data, TTL logic output has been taken and thus PIC18F4550 has been directly connected with GSM Modem without any line converter in between. The following diagram shows the TTL input and output of GSM modem used.
A Stepper Motor is a brushless, synchronous DC motor which divides a full rotation into a number of steps. For detailed information on working, types and stepping modes, refer the article on Stepper Motors. Here the operation of a unipolar Stepper motor with PIC18F4550 microcontroller has been explained.As stated earlier, a Stepper motor rotates step by step. Each stepper motor has a defined step angle which is the minimum degree of rotation in a single step. This step angle depends on the internal construction of the motor. If a stepper motor has a step angle of 1.8°, then it would need 200 steps for a complete circular rotation. For control operation, construction and stepping modes, refer the article on Stepper Motors.The stepper motor consists of a Rotor and four Stators. The stators are rounded with center-taped winding. The center-taped terminals are known Common terminals. Thus a unipolar stepper motor consists of total 6 wire-ends (four wires for coils and two for the common ends).
Global Positioning System is based on satellite navigation technology. A GPS Receiver provides the accurate location of an object in terms of latitude and [[wysiwyg_imageupload::]]longitude. Accurate time calculation with respect to GMT can also be done by using GPS. For more information on different data obtained through GPS, refer GPS Receivers. Here a PIC microcontroller has been interfaced with a GPS module to extract its position information (location). The main objective here is to find the location of the GPS Receiver in terms of latitude and longitude. The GPS module gives output data in RS232 logic level format. To convert the RS232 logic level into TTL, a line converter MAX232 has been connected between GPS module and PIC18F4550. (Also refer PIC USART) The circuit connection of GPS module with microcontroller is shown in the circuit diagram tab. The latitude and longitude data has been displayed on a 16×2 LCD interfaced to PIC.
RFID (Radio Frequency Identification and Detection) is widely used everywhere from highly secured defense laboratories to school attendance system. By [[wysiwyg_imageupload::]]employing RFID, much secured entry systems can be developed without incurring huge costs. These are the reasons of excessive use of RFID technology. In this article, interfacing of an RFID reader module has been explained with PIC18F4550. The USART interrupt, an internal PIC interrupt, has also been explained. (For more details on USART, refer PIC EUSART)As explained earlier (refer RFID interfacing with 8051 & with AVR), an RFID module consists of an RFID Reader, a line converter (usually MAX232) and a COM port. The line converter of this module converts the TTL logic voltage of RFID Reader to RS232 logic. Therefore, to convert the voltage level from such an RFID module, another MAX232 is used to interface it with a microcontroller. One can also use an RFID Reader directly to interface with the controller, thus avoiding the need of voltage level converters. Here both the MAX232s have been eliminated from the circuit and RFID reader is directly connected with the PIC microcontroller.
Analog comparator is an electronic device which compares the two voltage signals and provides TTL logic output to indicate the larger signal. The analog [[wysiwyg_imageupload::]]comparator is used in various applications where two inputs signals need to be compared. IR sensor is a very common example where analog comparator is used.PIC18F4550 has two in-built comparators which can be used in eight different modes. These in-built comparators save the cost and connections for providing an extra IC (like LM324, LM339 etc) in the circuit. This article explains the configuration of the analog comparators of this PIC microcontroller.PIC18F4550 consists of two analog comparators and these comparators can be used in eight different modes. The analog comparators’ I/O pins are multiplexed with PortA pins (RA0 – RA5) pins of the controller. The register CMCON is configured to set the mode of the comparator in a PIC microcontroller. Read more to find how PIC’s analog comparator is used to make this circuit.
Both, Parallel and Serial modes of communication have certain advantages and disadvantages over one another. The serial communication is a preferred option due [[wysiwyg_imageupload::]]to its ability of long distance communication with error detection capability. The microcontrollers consist of an inbuilt hardware unit known as USART (Universal Synchronous Asynchronous Reception and Transmission) to facilitate serial transfer of data. Before starting USART, some general terms related to communication need to be understood. These terms are explained below.Asynchronous Communication: In this type of communication, both Transmitter (Tx) and Receiver (Rx) work on different clocks which means that they are not synchronized. Start and Stop bits are also sent with each Data byte to identify the data. Synchronous Communication: In this type of communication, both Tx and Rx are synchronized with the same clock and no Start or Stop bits are used.Full-duplex Communication: When either of the devices can send and receive data at the same instant, they are said to have full-duplex communication.
Interrupts are special events that require immediate attention. They cause the processor to cease the running task to serve a special task for which the interrupt [[wysiwyg_imageupload::]]event had occurred. After the special task is over, the processor resumes performing the original task.The processor can also serve these events by polling method. But polling is an inefficient technique as compared to interrupts. In the polling method, the processor has to continuously wait for the event signal. Thus it always remains busy using extra resources. To understand the difference between polling and interrupts well, refer introductory paragraphs of 8051 Interrupts.Following is an example to illustrate the interrupts better. Suppose a programmer wants to make a real time watch which shows ambient temperature as well. The programmer has to use two internal peripherals of the controller, namely, a Timer and an ADC channel. Consider this project without using interrupt : the programmer has to take care of both peripherals one by one continuously by polling them. This is not an efficient way of programming.
A microcontroller, a digital device, can read, execute and transmit only digital signals. On the contrary, the outputs of the most of the transducers are analog in [[wysiwyg_imageupload::]]nature. Thus it is hard to interface these transducers directly with controllers. Analog-to-digital convertor (ADC) ICs are one way to make the analog input compatible with the microcontroller.Using an external ADC adds complexity to the circuit. To avoid this complexity, PIC Microcontrollers have in-built ADC module which reduces the cost and connections of the circuit. This article explains the in-built ADC of PIC18F4550 controller.As mentioned in the summary, a PIC microcontroller has inbuilt ADC for A/D conversion. The ADC module of PIC18F4550 controller has following specifications:· 10-bit resolution output which means that an analog input gets converted into a corresponding 10-bit digital output.· 13 channels which means that a total of 13 analog signals can be converted simultaneously into digital.· Vref+ (RA3) and Vref- (RA2) pins for external reference voltage.· 8 selectable clock options.· ADC can be in auto-triggering mode for continuous A/D conversion.
Timers as the name suggests pertain to time-related operations. They are mostly used for exact delay generation. Timers are also used in various other operations [[wysiwyg_imageupload::]]like PWM signal generation, auto-triggering of several other peripherals etc. The working and configuration of PIC18F4550 Timers have been explained in this article.Timers are the most essential peripheral for a microcontroller and every controller provides a provision for using them. Beginners are advised to go through the tutorial on Timers before going any further.For basic Timer operations, refer the Tutorial on Timers. PIC18F4550 is equipped with four Timers namely, Timer0, Timer1, Timer2 and Timer3. Before going for the details of Timer configurations, it is important to learn how time delay is calculated by the timer since exact delay generation is the most common application of Timers. Example: Given that a time delay of 1 sec is to be generated and a 12MHz crystal oscillator is connected with PIC. Please note that this example considers external clock source for the controller, however, PIC18F4550 has provision for both external as well as internal clock source.
The 16×2 character LCD can work in two modes, namely, 8-bit and 4-bit. These modes basically correspond to the number of data pins used in interfacing LCD. 8-[[wysiwyg_imageupload::]]bit mode uses all the data lines and has been explained in LCD interfacing with PIC18F4550. In 4-bit mode, only four data pins of LCD are connected to the controller. This mode, thus, saves four pins of the controller unlike 8-bit mode. The configuration and display method of LCD in 4-bit mode has been explained here. The 8-bit mode of LCD interfacing with PIC has been explained earlier. In the 4-bit mode the (8-bit) data/command is sent in nibble (four bits) format to LCD. The higher nibble is sent first followed by the lower nibble. In 4-bit mode only four data pins (D4-D7) of LCD are connected to the controller. The control pins (RS, RW and EN) are connected the same way as in 8-bit mode.
The 16×2 character LCD can also be used to display custom characters other than numerals, alphabets & special characters. Refer LCD interfacing with PIC. Some [[wysiwyg_imageupload::]]special shapes like hearts, arrows, smileys etc. can easily be displayed on the 5×8 pixel pattern of character LCD. These shapes are first stored at a special location in LCD’s controller and then displayed on the LCD module. This procedure has been explained here by using PIC18F4550. The special characters are generated by bit-mapping of LCD’s 5×8 bit pixel matrix. Refer Creating custom characters on LCD using 8051 for more details on bitmap generation and storing custom values in custom generator (CG) RAM of LCD’s controller. The mikroC IDE provides LCD Custom Character tool to create the bitmap of user defined custom character. Read further to know how are the characters created.
In Several automated and semi-automated devices require a message to be displayed in order to indicate their working status. In continuation to LCD interfacing [[wysiwyg_imageupload::]]with PIC18F4550, this article explains how to display a message or string on a 16×2 character LCD. In the previous article, a single character was displayed on LCD by properly configuring its data and command registers. A string is nothing but a sequential arrangement of several characters that can be displayed on LCD by using the programming steps mentioned here. The circuit connections and user-defined functions are same as earlier. The LCD data pins are connected to PortB of PIC18F4550 while the control pins are connected to first three pins. Read more to find how easily can one interface a display unit with a PIC micro controller.
For basic details and operations of character LCD, refer LCD interfacing with 8051. Here LCD has been interfaced in 8-bit mode* with data pins (D0-D7) connected to PortB of PIC18F4550. The LCD control pins RS, R/W and EN are connected to PortA pins RA0, RA1 and RA2 respectively. *Character LCD can also be interfaced…
As explained earlier, a seven segment interfaced with PIC uses almost an entire port (minimum 7 pins) to display a value. But a real time application, like watch, [[wysiwyg_imageupload::]]calculator etc., usually requires at least 3-4 seven segments. In such a case it is not advisable to use a port of the controller for each seven segment. In these cases, multiplexing technique is used to work with more than one seven segment. Here multiplexing of four seven-segments has been explained withPIC18F4550 to display four-digit count from 0000 to 9999. The multiplexing concept is based on the principle of persistence of human vision. A human eye cannot detect a visual change if the frames change at a rate of 25 (or more) frames per sec. This means that if events occur continuously with a time difference of less than or equal to 0.04 sec (1/25 sec), then we cannot notice the transition between those events.
Any microcontroller based system typically has an input and a corresponding output. Taking simple output with a PIC microcontroller has been explained inLED [[wysiwyg_imageupload::]]blinking with PIC18F4550. This article explains how to provide an input to the controller and get a corresponding output using PIC18F4550. PIC18F4550 has a total of 35 I/O (input-output) pins which are distributed among 5 Ports. Each Port of a PIC microcontroller corresponds to three 8-bit registers (TRIS, PORT & LAT) which should be configured to use the Port for general I/O purpose. For more details, refer LED blinking using PIC.To configure a particular port/pin as input, the corresponding TRIS register/TRIS bit should be set to high (1). For output, the relevant TRIS register/bit should be set to low (0). Read on to know more about PIC micro controller and get a step by step approach to take input with PIC. A must learn for every budding PIC enthusiast.
A typical seven-segment consists of 8 LEDs arranged in a pattern to display values. A seven-segment can be either of the two types, namely, Common Anode (CA) and Common Cathode (CC). For more details, refer Seven segments. A single seven-segment requires a minimum of 7 data pins of controller to display different values. The connections…
It is necessary to understand basic I/O operations of PIC18F4550 before dealing with its complexities. This article presents a way to take simple output from a PIC [[wysiwyg_imageupload::]]microcontroller. This learning would also help in interfacing of external devices with the controller. Here the output from the microcontroller is taken on a set of LEDs which are made to blink in an alternate fashion. PIC18F4550 has a total of 35 I/O (input-output) pins which are distributed among 5 Ports. As opposed to a basic 8051 microcontroller like AT89C51 which has most of the port pins serving single function, the port pins of a PIC microcontroller are multiplexed to serve more than one purpose. The 35 I/O pins of PIC18F4550 are also multiplexed with one or more alternative functions of controller’s various peripherals. Each Port of a PIC microcontroller corresponds to three 8-bit registers which should be configured to use the Port for general I/O purpose.