; ;**************************************************************************** ; ; Purpose: ; Provides Connection From LCD Driver Code To Hardware ; ; Date: ; 07/21/92 ; ; Author: ; John C. Wren ; ; Modications: ; 02/04/97 - Added Description Fields For Archive ; ; Processor: ; Generic 8031 ; ; Assembler: ; Avocet AVA51 ; ; Dependencies: ; None ; ; Files: ; None ; ; Philosophic: ; This Is An Extract Of The Generic IO.ASM File. Usually, All I/O ; Support Is Incorporated Into One File. A Version Of This Is Made ; For The Real Hardware, And If There Is A Prototype Board, A Verison ; Is Created To Support It ; ;**************************************************************************** ; ; Includes ; ; %include "equates.inc" seg code ; ;**************************************************************************** ; ; Publics ; public IO_INIT public IO_LCDRS_LO public IO_LCDRS_HI public IO_LCDEN_LO public IO_LCDEN_HI public IO_LCDRW_LO public IO_LCDRW_HI public IO_LCD_WR public IO_LCD_RD ; ;******************************************************************************* ; ; Equates ; LCDEN bit p3.0 ; LCD Enable LCDRW bit p3.1 ; LCD R/W LCDRS bit p3.2 ; LCD Register Select LCDDATA equ p1 ; LCD Data Register ; ;**************************************************************************** ; ; Description: ; Initializes Various I/O To A Known State. ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; This Should Be Called Before The Global Interrupts Are Enabled (EA) ; IO_INIT proc clr LCDEN ; LCD De-Selected setb LCDRW ; LCD To Read Mode setb LCDRS ; LCD Data Register Selected ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Register Select Line To The Data State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDRS_LO proc clr LCDRS ; Select Command Register ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Register Select Line To The Command State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDRS_HI proc setb LCDRS ; Select Data Register ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Enable Line To The Inactive State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDEN_LO proc clr LCDEN ; Enable Low ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Enable Line To The Active State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDEN_HI proc setb LCDEN ; Enable High ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Read/Write Line To The Write State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDRW_LO proc clr LCDRW ; Select Write ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Set The LCD Read/Write Line To The Read State ; ; Entry Requirements: ; None ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; None ; IO_LCDRW_HI proc setb LCDRW ; Select Read ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Write A Byte To The LCD Data Lines ; ; Entry Requirements: ; Acc Has Character To Setup To LCD Data Lines ; ; On Exit: ; None ; ; Affected: ; None ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; This Could Be Modified To Support An LCD Connected To The External ; Data Bus, Rather Than Port Pins. ; IO_LCD_WR proc mov LCDDATA,a ; Write To Data Bus ret ; Return To Caller endproc ; ;**************************************************************************** ; ; Description: ; Read A Byte From The LCD Data Lines ; ; Entry Requirements: ; None ; ; On Exit: ; Acc Has Character Read From The LCD Data Lines ; ; Affected: ; PSW.Z, PSW.P, Acc ; ; Stack: ; 0 Bytes, Not Including Called Routines ; ; Comments: ; This Could Be Modified To Support An LCD Connected To The External ; Data Bus, Rather Than Port Pins. ; IO_LCD_RD proc mov LCDDATA,#0ffh ; Configure As Inputs mov a,LCDDATA ; Write To Data Bus ret ; Return To Caller endproc ; ;**************************************************************************** ; end