lab5 -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ;========================================================== ; Group: (Your Group Name Here) ;========================================================== ; Lab 5: LCD display interface ;========================================================== ; ; This code handles the confiuration of the LCD display, ; subroutines for printing to, reseting, and clearing the ; LCD, as well as writing characters to it. ; ; Your group will be responsible for the following ; tasks: ; ; 1) ; 2) ;========================================================== ; ;======================================= ; Initalization of the environment ;======================================= list p=16F874 ; list directive to define processor #include <p16F874.inc> ; processor specific variable definitions ; ;======================================= ; Configuration of the PIC ;======================================= __CONFIG B'11111100110001' ;setting configuration word (see PIC16F87X Data Sheet, p. 120, setting device to PIC16F874) ; || | |||| ; || | ||ww====== Oscillator = XT ; || | || ; || | |w======== Watchdog Timer = disabled ; || | | ; || | w========= Power-Up Timer = enabled ; || | ; || w============ Brown-Out Reset = disabled ; || ; ww================== Code Protection = off (also bits 5-4) ; ;=======================================; ; Constant Declaration ; ;=======================================; ; ;LCD display commands CLR EQU 0x01 ;Clears display, returns cursor home FSET EQU 0x38 ;Function Set command, Sets operational parameters OFF EQU 0x08 ;Turn Display Off ON EQU 0x0C ;Turn Display On MODSET EQU 0x06 ;Sets cursor auto-move direction after char. write ; ;Delay values for timer0 (for Pre-Scalar = 1:256) D5m EQU-D'20' ; 5 ms delay D15m EQU-D'59' ;15 ms delay D33m EQU-D'131' ;33 ms delay ; ;control pin identifiers on display (PORT B) RS EQU RW EQU 1 ENA EQU 2 ;=======================================; ; Variable Declaration ; ;=======================================; ; ;***** RAM BANK 0 *****; COUNT EQU 0x20 ; used in LCD display initialization ; CNTD EQU 0x30 ; used in LCD display ADDR EQU 0X40 COUNTUP EQU 0X60 ; used in LCD display KEY EQU 0X50 ; used to store key value from RCREG ; ;=======================================; ; Reset/Interrupt Vectors ; ;=======================================; ORG 0x0000 ; The PIC enters execution here RESTART GOTO MAIN M ORG 0x0004 ; The Interrupt vector enters here INTHND RETFIE R ;=======================================; ; Device Configuration ; ;=======================================; ORG 0x0050 MAIN M ;= Timer0 configuration ========; BSF STATUS,RP0 ; Set the PIC to use bank 1 registers (see page 18 & 14) MOVLW B'11000111' ;<-------- Modify here -------------------------------------------- ; This value will be 'AND'ed with the default value of the OPTION ; register (81h) of the PIC (see next line). The default value on ; reset is B'11111111'. For more information on this register see ; page 19 of the datasheet (on carmen) ; ; You must provide values to set:...
View Full Document

This note was uploaded on 05/19/2011 for the course ECE 667 taught by Professor Staff during the Winter '08 term at Ohio State.

Page1 / 9

lab5 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online