100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

Devry University - ECET 340: LAB#2 Keypad-LCD PROGRAMMING KEYPAD ON TWR-DEV-PERIPH.

Rating
-
Sold
-
Pages
16
Uploaded on
24-08-2021
Written in
2021/2022

Devry University - ECET 340: LAB#2 Keypad-LCD PROGRAMMING KEYPAD ON TWR-DEV-PERIPH. do{ mSDelay(15); PORTA = PORTA | 0x0F; //COLUMNS SET HIGH row = PORTA & 0xF0; //READ ROWS }while(row != 0x00); //MAKE SURE BUTTON IS NOT STILL HELD } //CLOSE WHILE(1) } //CLOSE MAIN /**********************SUBROUTINES***********/ void mSDelay(unsigned int itime){ unsigned int i; unsigned int j; for(i=0;i<itime;i++) for(j=0;j<1000;j++); } Lab Manual for “HCS12 Microcontroller and Embedded Systems” LAB#2 Keypad-LCD WORKSHEET ACTIVITY 2 Repeat Activity 1 to display the characters on LCD. Use the LCD program in Lab1A_LCD #include <hidef.h> /* common defines and macros */ #include "derivative.h" /* derivative-specific definitions */ #define LCD_DATA PORTC #define LCD_CTRL PORTC #define RS 0x01 // PORTCo for RS pin of LCD #define EN 0x04 // PORTC2 for en pin of LCd void COMWRT4(unsigned char); void DATWRT4(unsigned char); void mSDelay(unsigned int); const unsigned char keypad[4][4] = { 0x31,0x32,0x33,0x41, 0x34,0x35,0x36,0x42, 0x37,0x38,0x39,0x43, 0x2A,0x30,0x23,0x44 //Notice 0x2A is ASCII for '*' and 0x23 for '#' }; unsigned char column,row,mykey; /**************MAIN*******************************/ void main(void){ //OPEN MAIN DDRA = 0x0F; DDRC = 0xFF; //PORTC=output for data and control signals DDRB = DDRB | 0x80; //PB7 as output PORTB = PORTB & 0x7F; //PB7=0 for CSB pin of LCD DDRP = DDRP | 1; //PORTP7 as output for backlight control PTP = PTP | 1; //turn on the backlight (optional) PORTC =0x0; mSDelay(10); //Many of the initialization commmands of ST7036 LCD is the same as HD44780 covered in the Mazidi/Causey textbook. //However, for ST7034-bases LCD we need few more commands. See Page 42 of ST7036 datasheet COMWRT4(0x33); mSDelay(1); COMWRT4(0x32); mSDelay(1); COMWRT4(0x29); //Function set:DL=0(4-bit) This option is compatibe Lab Manual for “HCS12 Microcontroller and Embedded Systems”

Show more Read less
Institution
Module










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Module

Document information

Uploaded on
August 24, 2021
Number of pages
16
Written in
2021/2022
Type
Other
Person
Unknown

Subjects

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
registered_nurse Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
654
Member since
5 year
Number of followers
586
Documents
1536
Last sold
2 days ago

4.0

132 reviews

5
63
4
32
3
17
2
9
1
11

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions