LIST ; LCD Module commands ; My macros ; ᪨ 㪢 LCD Module ; P16F84.INC Standard Header File, Version 2.00 Microchip Technology, Inc. NOLIST ; LCD Module commands ; =================== LINE1 EQU 0x080 ; Set display to line 1 character 0 LINE2 EQU 0x0C0 ; Set display to line 2 character 0 FUNCTION_SET EQU 0x028 ; 4 bits, 2 lines, 5x7 Font ;CLR_DISP - clears all display, and cursor home to addr 0 CLR_DISP EQU 0x001 ; Clear the Display ;RTN_HOME - cursor home and display unshifted, DDRAM unchanged RTN_HOME EQU 0X002 ;DISP_... - Display on / off control, C = cursor ON, B = chr pos blink DISP_ON EQU 0x00C ; Display on DISP_ON_C EQU 0x00E ; Display on, Cursor on DISP_ON_B EQU 0x00F ; Display on, Cursor on, Blink cursor DISP_OFF EQU 0x008 ; Display off ;ENTRY_... - sets entry mode, S = display shift on, INC / DEC cursor move dir ENTRY_INC EQU 0x006 ; ENTRY_INC_S EQU 0x007 ; ENTRY_DEC EQU 0x004 ; ENTRY_DEC_S EQU 0x005 ; ;SHIFT_. - Cursor & Display shift, S = Display, C = cursor, L = Left, R = Right SHIFT_C_L EQU 0x010 SHIFT_C_R EQU 0x014 SHIFT_S_L EQU 0x018 SHIFT_S_R EQU 0x01C DD_RAM_ADDR EQU 0x080 ; Least Significant 7-bit are for address DD_RAM_UL EQU 0x080 ; Upper Left coner of the Display ; My macros ; ========= cmp macro f,const movlw const subwf f,w endm mvi macro f,const movlw const movwf f endm movff macro f1,f2 movf f1,w movwf f2 endm selb0 macro bcf 3,5 endm selb1 macro bsf 3,5 endm sz macro btfss STATUS,Z endm snz macro btfsc STATUS,Z endm sc macro btfss STATUS,C ; 3,0 endm snc macro btfsc STATUS,C endm ; ᪨ 㪢 LCD Module ; ============================ #define retlw 'a' ; 쪨 #define retlw 0b2h #define retlw 0b3h #define retlw 0b4h #define retlw 0e3h #define retlw 065h #define retlw 0b5h #define retlw 0b6h #define retlw 0b7h #define retlw 0b8h #define retlw 0b9h #define retlw 0bah #define retlw 0bbh #define retlw 0bch #define retlw 0bdh #define retlw 06fh #define retlw 0beh #define retlw 070h #define retlw 063h #define retlw 0bfh #define retlw 079h #define retlw 0e4h #define retlw 078h #define retlw 0e5h #define retlw 0c0h #define retlw 0c1h #define retlw 0e6h #define retlw 0c2h #define retlw 0c3h #define retlw 0c4h #define retlw 0c5h #define retlw 0c6h #define retlw 0c7h #define _ retlw 020h #define retlw 'A' ; #define retlw 0A0H #define retlw 'B' #define retlw 0A1H #define retlw 0E0H #define retlw 'E' #define retlw 0A2H #define retlw 0A3H #define retlw 0A4H #define retlw 0A5H #define retlw 0A6H #define retlw 'K' #define retlw 0A7H #define retlw 'M' #define retlw 'H' #define retlw 'O' #define retlw 0A8H #define retlw 'P' #define retlw 'C' #define retlw 'T' #define retlw 0A9H #define retlw 0AAH #define retlw 'X' #define retlw 0E1H #define retlw 0ABH #define retlw 0ACH #define retlw 0E2H #define retlw 0ADH #define retlw 0AEH #define retlw 'b' #define retlw 0AFH #define retlw 0B0H #define retlw 0B1H ; P16F84.INC Standard Header File, Version 2.00 Microchip Technology, Inc. ; ============================================================================ ; This header file defines configurations, registers, and other useful bits of ; information for the PIC16F84 microcontroller. These names are taken to match ; the data sheets as closely as possible. ; Note that the processor must be selected before this file is ; included. The processor may be selected the following ways: ; 1. Command line switch: ; C:\ MPASM MYFILE.ASM /PIC16F84 ; 2. LIST directive in the source file ; LIST P=PIC16F84 ; 3. Processor Type entry in the MPASM full-screen interface ;========================================================================== ; ; Revision History ; ;========================================================================== ;Rev: Date: Reason: ;2.00 07/24/96 Renamed to reflect the name change to PIC16F84. ;1.01 05/17/96 Corrected BADRAM map ;1.00 10/31/95 Initial Release ;========================================================================== ; ; Verify Processor ; ;========================================================================== IFNDEF __16F84 MESSG "Processor-header file mismatch. Verify selected processor." ENDIF ;========================================================================== ; ; Register Definitions ; ;========================================================================== W EQU H'0000' F EQU H'0001' ;----- Register Files------------------------------------------------------ INDF EQU H'0000' TMR0 EQU H'0001' PCL EQU H'0002' STATUS EQU H'0003' FSR EQU H'0004' PORTA EQU H'0005' PORTB EQU H'0006' EEDATA EQU H'0008' EEADR EQU H'0009' PCLATH EQU H'000A' INTCON EQU H'000B' OPTION_REG EQU 1 ; H'0081' TRISA EQU H'0085' TRISB EQU H'0086' EECON1 EQU H'0088' EECON2 EQU H'0089' ;----- STATUS Bits -------------------------------------------------------- IRP EQU H'0007' RP1 EQU H'0006' RP0 EQU H'0005' NOT_TO EQU H'0004' NOT_PD EQU H'0003' Z EQU H'0002' DC EQU H'0001' C EQU H'0000' ;----- INTCON Bits -------------------------------------------------------- GIE EQU H'0007' EEIE EQU H'0006' T0IE EQU H'0005' INTE EQU H'0004' RBIE EQU H'0003' T0IF EQU H'0002' INTF EQU H'0001' RBIF EQU H'0000' ;----- OPTION Bits -------------------------------------------------------- NOT_RBPU EQU H'0007' INTEDG EQU H'0006' T0CS EQU H'0005' T0SE EQU H'0004' PSA EQU H'0003' PS2 EQU H'0002' PS1 EQU H'0001' PS0 EQU H'0000' ;----- EECON1 Bits -------------------------------------------------------- EEIF EQU H'0004' WRERR EQU H'0003' WREN EQU H'0002' WR EQU H'0001' RD EQU H'0000' ;========================================================================== ; ; RAM Definition ; ;========================================================================== __MAXRAM H'CF' __BADRAM H'07', H'50'-H'7F', H'87' ;========================================================================== ; ; Configuration Bits ; ;========================================================================== _CP_ON EQU H'000F' _CP_OFF EQU H'3FFF' _PWRTE_ON EQU H'3FF7' _PWRTE_OFF EQU H'3FFF' _WDT_ON EQU H'3FFF' _WDT_OFF EQU H'3FFB' _LP_OSC EQU H'3FFC' _XT_OSC EQU H'3FFD' _HS_OSC EQU H'3FFE' _RC_OSC EQU H'3FFF' LIST