C:/Documents and Settings/Jafar/Desktop/labs_fall2008/labs_fall2008/Lab1/programs/lcd.c File Reference

will be used in all labs This source file will contain the implementation of all required basic LCD functions. More...

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "lcd.h"
#include "util.h"

Functions

void lcdInitialize (void)
 This method will be used to initialize the lcd.
void lcdToggleClear (char chrDelay)
 This method will trigger loading of bits by LCD controller and clears bits after toggle.
void lcdWriteAChar (char chrData)
 This method will be used to print a single character to the lcd.
void lcdCommand (char chrData)
 This method will be used to submit a command to the LCD controller.
void lcdClear (void)
 This method will be used to clear the LCD Date: 2/28/2009.
void lcdHomeLine1 (void)
 This method will be used to set the character position to first line first position Date: 2/28/2009.
void lcdHomeLine2 (void)
 This method will be used to set the character position to second line first position Date: 2/28/2009.
void lcdPutAString (char *chrString)
 This method will be used to print a string to the lcd.
void lcdPutAChar (char chrData)
 This method will be used to print one character to the LCD Date: 2/28/2009.


Detailed Description

will be used in all labs This source file will contain the implementation of all required basic LCD functions.

Author:
Dr.Zhao Zhang
Date: 2/28/2009

Function Documentation

void lcdCommand ( char  chrData  ) 

This method will be used to submit a command to the LCD controller.

Parameters:
chrData ?? Date: 2/28/2009

PA4 is tied to Register Select

Setting register select low for command mode

Setting register select high for character mode

void lcdHomeLine2 ( void   ) 

This method will be used to set the character position to second line first position Date: 2/28/2009.

This will be used as a counter for the loop

void lcdInitialize ( void   ) 

This method will be used to initialize the lcd.

Date: 2/28/2009

PA6 is tied to Enable

PA4 is tied to Register Select

Assumes Port A is dedicated to the LCD Seven Pins needed, but will assume all 8 are used.

Setting Port A for OutPut

Preparing to put HD44780 into 4-bit Mod

setting controller to 4 bit mode Need to set for 2 lines

setting disp on, cursor on, blink off

increment cursor, no display shift

clear LCD

Setting Register select high to enable character mode

void lcdPutAString ( char *  chrString  ) 

This method will be used to print a string to the lcd.

Parameters:
chrString The string to print on the LCD Date: 2/28/2009

This will hold the passed string length

This will be used to index the passed string

Instead of repeating code and since Strings are sequence of characters then we can use the lcdPutAChar function

void lcdToggleClear ( char  chrDelay  ) 

This method will trigger loading of bits by LCD controller and clears bits after toggle.

Parameters:
chrDelay Time to wait before clearing the bits Date: 2/28/2009

PA6 is tied to Enable

void lcdWriteAChar ( char  chrData  ) 

This method will be used to print a single character to the lcd.

Parameters:
chrData The character to print Date: 2/28/2009


Generated on Tue Apr 14 21:09:29 2009 for LCD by  doxygen 1.5.8