Tuesday, December 10, 2013

WEEK 12

Title : Microcontroller PIC coding lerning

Introduction

Microcontroller PIC is the main controller of egg incubator project. Microcontroller is a subject that has been learned during the last semester. This week, I am more focused study on the basis of microcontroller coding. It's refreshing to learning more about the basics of coding.


Objective 
  1. To understanding and learn about the microcontroller basic coding.
  2. To refreshing previous study about microcontroller basic coding.
Problem Encountered

To learn microcontroller, we must have software MPLAB and Proteus. This is because the MPLAB software is used to write the coding and Proteus is to draw a circuit / hardware on a project with the intended to understand the functionality of the project when encoding implemented. The problem is my MPLAB software have corrupted because I lost the library file for MPLAB software.So I am do not able to
creating library file,defining library file,inclusion of library file into program and adding Functions to the Library.That is important in creating a coding when it compile the code.The problem is considered completed, when I reinstall the MPLAB sofware.


Project Description

Process of learning this week focused on how to program push button, LCD and interrupt learning using MPLAB software. This is because it is will be used in incubator projects that will be developed later.The first step I need to know how the connection. To be connected to the PIC Microcontroller, I can choose to make 'active high' or 'low active'. The sequel is as below.



Figure 1: Push Button connection circuit 



For active low, in normal conditions PIC port is high. When the switch is press, the ports of the PIC will be low.While the active high, in normal circumstances PIC port is low. When the switch is press, the PIC port will be high.

Second,LCD (Liquid Crystal Display) is a device to display various character. Among these having dot matrix LCD controller is HD44780. HD44780 can be operated in 5x8 or 5X10 dot matrix. LCD's have some size by the number of characters. Among them are 16X2 or 20x4 character. 16X2 character LCD means it has 16 characters in line with 2 lines. LCD has 16 pins.


                                                        Figure 2 : LCD display  HD44780

Thirdly, interrupt is one of the special functions in PIC. Interrupt is used to place a significant program on reason for the occurrence a particular source. PIC16 has 15 interrupt sources. Selection interrupt address is determined by the number of INTCON, PIE1 and PIE2.


                                                    Figure 3 : Address and register for interrupt.

Project Outcome

The result that have already learning from this task is such as that shown below:-


  1. Push Button



                                    Figure 3 : The result from Proteus software using Push Button


                                               Figure 4 : MPLAB software coding code.

      2. LCD display



  Figure 5 : The result from Proteus software 


                                  Figure 6 : MPLAB software coding code to display name and id

      3. Interrupt


Figure 7 : Showed on the Proteus ISIS program.



Figure 8 : The program coding for interrupt function



As a conclusion,refreshing study is important to ensure the project do not have a problem, when it's time for me to complete the project incubator.This is because to program the project  that proper functioning is the part of most complicated to implement.

1 comment: