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

will be used in all labs This header file will contain all required definitions and basic LCD functions. More...

#include <inttypes.h>
#include <avr/io.h>
#include <avr/interrupt.h>

Go to the source code of this file.

Defines

#define HD_LCD_CLEAR   0x01
#define HD_RETURN_HOME   0x02
#define HD_CURSOR_SHIFT_DEC   0x05
#define HD_CURSOR_SHIFT_INC   0x07
#define HD_DISPLAY_CONTROL   3
#define HD_DISPLAY_ON   2
#define HD_CURSOR_ON   1
#define HD_BLINK_ON   0
#define HD_CURSOR_MOVE_LEFT   0x10
#define HD_CURSOR_MOVE_RIGHT   0x14
#define HD_DISPLAY_SHIFT_LEFT   0x18
#define HD_DISPLAY_SHIFT_RIGHT   0x1C

Functions

void lcdPutAString (char *chrString)
 This method will be used to print a string to the lcd.
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 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 header file will contain all required definitions and 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