Cover image for Using LEDs, LCDs, and GLCDs in microcontroller projects
Title:
Using LEDs, LCDs, and GLCDs in microcontroller projects
Personal Author:
Publication Information:
Hoboken, N.J. : Wiley, 2012
Physical Description:
xiv, 479 p. : ill. ; 25 cm.
ISBN:
9781119940708

9781118361047

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010306254 TK7882.I6 I37 2012 Open Access Book Book
Searching...

On Order

Summary

Summary

Describing the use of displays in microcontroller based projects, the author makes extensive use of real-world, tested projects. The complete details of each project are given, including the full circuit diagram and source code. The author explains how to program microcontrollers (in C language) with LED, LCD and GLCD displays; and gives a brief theory about the operation, advantages and disadvantages of each type of display.

Key features:

Covers topics such as: displaying text on LCDs, scrolling text on LCDs, displaying graphics on GLCDs, simple GLCD based games, environmental monitoring using GLCDs (e.g. temperature displays) Uses C programming throughout the book - the basic principles of programming using C language and introductory information about PIC microcontroller architecture will also be provided Includes the highly popular PIC series of microcontrollers using the medium range PIC18 family of microcontrollers in the book. Provides a detailed explanation of Visual GLCD and Visual TFT with examples. Companion website hosting program listings and data sheets Contains the extensive use of visual aids for designing LED, LCD and GLCD displays to help readers to understand the details of programming the displays: screen-shots, tables, illustrations, and figures, as well as end of chapter exercises

Using LEDs, LCDS, and GLCDs in Microcontroller Projects is an application oriented book providing a number of design projects making it practical and accessible for electrical & electronic engineering and computer engineering senior undergraduates and postgraduates. Practising engineers designing microcontroller based devices with LED, LCD or GLCD displays will also find the book of great use.


Author Notes

Dogan Ibrahim, Department of Computer Engineering, Near East University,Cyprus
Professor Ibrahim is currently Head of the Department of Computer Engineering at Near East University, Cyprus. He has been a lecturer at Near East University since 1999, and prior to this held a range of roles including Principal Research Engineer at GEC Hirst Research Centre, London and Lecturer at South Bank University, London. He is an IEE Fellow.


Table of Contents

Prefacep. xiii
Acknowledgementsp. xv
1 Introduction to Microcontrollers and Display Systemsp. 1
1.1 Microcontrollers and Microprocessorsp. 2
1.2 Evolution of the Microcontrollerp. 3
1.3 Parts of a Microcontroller yp. 4
1.3.1 Addressp. 4
1.3.2 ALUp. 5
1.3.3 Analogue Comparatorp. 5
1.3.4 Analogue - to - Digital Converterp. 5
1.3.5 Brown - out Detectorp. 5
1.3.6 Busp. 5
1.3.7 CANp. 6
1.3.8 CISCp. 6
1.3.9 Clockp. 6
1.3.10 CPCp. 6
1.3.11 EEPROMp. 6
1.3.12 EPROMp. 6
1.3.13 Ethernetp. 7
1.3.14 Flash Memoryp. 7
1.3.15 Harvard Architecturep. 7
1.3.16 Idle Modep. 1
1.3.17 Interruptsp. 7
1.3.18 LCD Driversp. 8
1.3.19 Pipeliningp. 8
1.3.20 Power - on Resetp. 8
1.3.21 PROMp. 8
1.3.22 ROMp. 8
1.3.23 Real - time Clockp. 8
1.3.24 Registerp. 9
1.3.25 Resetp. 9
1.3.26 RISCp. 9
1.3.27 ROMp. 9
1.3.28 Serial Input - Outputp. 9
1.3.29 Sleep Modep. 9
1.3.30 Supply Voltagep. 10
1.3.31 Timersp. 10
1.3.32 USBp. 10
1.3.33 Watchdogp. 10
1.4 Display Devicesp. 10
1.4.1 LEDp. 10
1.4.2 7 - Segment LEDp. 11
1.4.3 OLEDp. 12
1.4.4 LCDp. 12
1.5 Summaryp. 15
Exercisesp. 15
2 PIC18F Microcontrollersp. 17
2.1 The PIC18F2410 Microcontrollerp. 18
2.2 PIC18F2410 Architecturep. 19
2.2.1 The Program Memoryp. 21
2.2.2 The Data Memoryp. 21
2.2.3 Power Supply Requirementsp. 22
2.2.4 Oscillator Configurationsp. 24
2.2.5 The Resetp. 30
2.2.6 Parallel I/O Portsp. 31
2.2.7 Timer Modulesp. 38
2.2.8 Analogue - to - Digital Converter Modulep. 43
2.2.9 Special Features of the CPUp. 48
2.2.10 Interruptsp. 49
2.2.11 Pulse Width Modulator Modulep. 53
2.3 Summaryp. 56
Exercisesp. 56
3 C Programming Languagep. 59
3.1 C Languages for Microcontrollersp. 59
3.2 Your First mikroC Pro for PIC Programp. 61
3.2.1 Commentsp. 61
3.2.2 Beginning and Ending a Programp. 62
3.2.3 White Spacesp. 63
3.2.4 Variable Namesp. 63
3.2.5 Reserved Namesp. 64
3.2.6 Variable Typesp. 64
3.2.7 Constantsp. 66
3.2.8 Escape Sequencesp. 68
3.2.9 Volatile Variablesp. 69
3.2.10 Accessing Bits of a Variablep. 69
3.2.11 sbit Typep. 70
3.2.12 bit Typep. 70
3.2.13 Arraysp. 70
3.2.14 Pointersp. 73
3.2.15 Structuresp. 76
3.2.16 Onionsp. 80
3.2.17 Operators in mikroC Pro for PICp. 80
3.2.18 The Flow of Controlp. 90
3.3 Functions in mikroC Pro for PICp. 101
3.3.1 Function Prototypesp. 102
3.3.2 void Functionsp. 103
3.3.3 Passing Parameters to Functionsp. 104
3.3.4 Passing Arrays to Functionsp. 106
3.3.5 Interrupt Processingp. 106
3.4 mikroC Pro for PIC Built - in Functionsp. 108
3.5 mikroC Pro for PIC Librariesp. 109
3.5.1 ANSI C Libraryp. 109
3.5.2 Miscellaneous Libraryp. 111
3.6 Using the mikroC Pro for PIC Compilerp. 111
3.6.1 mikroC Pro for PIC IDEp. 112
3.6.2 Creating a New Source Filep. 118
3.6.3 Compiling the Source Filep. 122
3.7 Using the mikroC Pro for PIC Simulatorp. 123
3.7.1 Setting a Break - Pointp. 124
3.8 Other mikroC Pro for PIC Featuresp. 126
3.8.1 View Statisticsp. 126
3.8.2 View Assemblyp. 127
3.8.3 ASCII Chartp. 127
3.8.4 USART Terminalp. 127
3.8.5 Seven Segment Editorp. 127
3.8.6 Helpp. 128
3.9 Summaryp. 128
Exercisesp. 129
4 PIC Microcontroller Development Tools - Including Display Development Toolsp. 131
4.1 PIC Hardware Development Boardsp. 132
4.1.1 Super Bundle Development Kitp. 132
4.1.2 PIC18 Explorer Boardp. 132
4.1.3 PIC18F4XK20 Starter Kitp. 134
4.1.4 PICDEM4p. 135
4.1.5 PIC16F887Development Kitp. 135
4.1.6 FUTURLEC PIC18F4550 Development Boardp. 137
4.1.7 EasyPIC6 Development Boardp. 137
4.1.8 EasyPIC7 Development Boardp. 139
4.2 PIC Microcontroller Display Development Toolsp. 140
4.2.1 Display - Hardware Toolsp. 140
4.2.2 Display Software Toolsp. 143
4.3 Using the In - Circuit Debugger with the EasyPIC7 Development Boardp. 145
4.4 Summaryp. 149
Exercisesp. 149
5 Light Emitting Diodes (LEDs)p. 151
5.1 A Typical LEDp. 151
5.2 LED Coloursp. 153
5.3 LED Sizesp. 154
5.4 Bi - Colour LEDsp. 154
5.5 Tri - Colour LEDsp. 155
5.6 Hashing LEDsp. 155
5.7 Other LED Shapesp. 155
5.8 7 - Segment LEDsp. 156
5.8.1 Displaying Numbersp. 157
5.8.2 Multi - digit 7 - Segment Displaysp. 159
5.9 Alphanumeric LEDsp. 159
5.10 mikroC Pro for PIC 7 - Segment LED Editorp. 163
5.11 Summaryp. 163
Exercisesp. 164
6 Liquid Crystal Displays (LCDs) and mikroC Pro for PIC LCD Functionsp. 165
6.1 HD44780 Controllerp. 165
6.2 Displaying User Defined Datap. 168
6.3 DDRAM Addressesp. 169
6.4 Display Timing and Controlp. 171
6.4.1 Clear Displayp. 172
6.4.2 Return Cursor to Homep. 172
6.4.3 Cursor Move Directionp. 172
6.4.4 Display ON/OFFp. 172
6.4.5 Cursor and Display Shiftp. 173
6.4.6 Function Setp. 173
6.4.7 Set CGRAM Addressp. 173
6.4.8 Set DDRAM Addressp. 173
6.4.9 Read Busy Flagp. 174
6.4.10 Write Data to CGRAM or DDRAMp. 174
6.4.11 Read Data from CGRAM or DDRAMp. 174
6.5 LCD Initialisationp. 174
6.5.1 8 - bit Mode Initialisationp. 175
6.5.2 4 - bit Mode Initialisationp. 175
6.6 Example LCD Display Setup Programp. 177
6.7 mikroC Pro for PIC LCD Functionsp. 180
6.7.1 Lcd_Initp. 180
6.7.2 Lcd_Outp. 181
6.7.3 Lcd_Out_Cpp. 181
6.7.4 Lcd_Chrp. 181
6.7.5 Lcd_Chr_Cpp. 181
6.7.6 Lcd_Cmdp. 182
6.8 Summaryp. 182
Exercisesp. 183
7 Graphics LCD Displays (GLCD)p. 185
7.1 The 128×64 Pixel GLCDp. 185
7.2 Operation of the GLCD Displayp. 187
7.3 mikroC Pro for PIC GLCD Library Functionsp. 189
7.3.1 Glcd_Initp. 189
7.3.2 Glcd_Set_Sidep. 190
7.3.3 Glcd_Set_Xp. 190
7.3.4 Glcd_Set_Pagep. 190
7.3.5 Glcd__Write_Datap. 190
7.3.6 Glcd_Fillp. 190
7.3.7 Glcd_Dotp. 191
7.3.8 Glcd_Linep. 191
7.3.9 Glcd_V_Linep. 191
7.3.10 Glcd_H_Linep. 191
7.3.11 Glcd_Rectanglep. 192
7.3.12 Glcd_Rectangle_Round_Edgesp. 192
7.3.13 Glcd__Rectangle Round_Edges_Fillp. 192
7.3.14 Glcd_Boxp. 193
7.3.15 Glcd_Circlep. 193
7.3.16 Glcd_Circle_Fillp. 194
7.3.17 Glcd_Set_Fontp. 194
7.3.18 Glcd_Set_Font_Advp. 194
7.3.19 Glcd_Write_Charp. 195
7.3.20 Glcd_Write_Char_Advp. 195
7.3.21 Glcd_Write_Textp. 195
7.3.22 Glcd_Write_Text_Advp. 195
7.3.23 Glcd_Write_Const_Text_Advp. 196
7.3.24 Glcd_Imagep. 196
7.4 Example GLCD Displayp. 196
7.5 mikroC Pro for PIC Bitmap Editorp. 198
7.6 Adding Touch - screen to GLCDsp. 199
7.6.1 Types of Touch - screen Displaysp. 200
7.6.2 Resistive Touch Screensp. 200
7.7 Summaryp. 203
Exercisesp. 204
8 Microcontroller Program Developmentp. 205
8.1 Using the Program Description Language and Flowchartsp. 205
8.1.1 BEGIN - ENDp. 206
8.1.2 Sequencingp. 206
8.1.3 IF - THEN - ELSE - ENDIFp. 206
8.1.4 DO - ENDDOp. 207
8.1.5 REPEAT - UNTILp. 209
8.1.6 Calling Subprogramsp. 209
8.1.7 Subprogram Structurep. 209
8.2 Examplesp. 211
8.3 Representing for Loops in Flowchartsp. 216
8.4 Summaryp. 218
Exercisesp. 218
9 LED Based Projectsp. 219
9.1 PROJECT 9.1 - Flashing LEDp. 219
9.2 PROJECT 9.2 - Binary Counting Up LEDsp. 226
9.3 PROJECT 9.3 - Rotating LEDsp. 229
9.4 PROJECT 9.4 - Wheel of Lucky Dayp. 231
9.5 PROJECT 9.5 - Random Hashing LEDsp. 239
9.6 PROJECT 9.6 - LED Dicep. 240
9.7 PROJECT 9.7 - Connecting more than one LED to a Port Pinp. 246
9.8 PROJECT 9.8 - Changing the Brightness of LEDsp. 250
9.9 PROJECT 9.9 - LED Candlep. 264
9.10 Summaryp. 267
Exercisesp. 267
10 7 - Segment LED Display Based Projectsp. 269
10.1 PROJECT 10.1 - Single Digit Up Counting 7 - Segment LED Displayp. 269
10.2 PROJECT 10.2 - Display a Number on 2 - Digit 7 - Segment LED Displayp. 271
10.3 PROJECT 10.3 - Display Lottery Numbers on 2 - Digit 7 - Segment LED Displayp. 278
10.4 PROJECT 10.4 - Event Counter Using 4 - Digit 7 - Segment LED Displayp. 285
10.5 PROJECT 10.5 - External Interrupt Based Event Counter Using 4 - Digit 7 - Segment LED Display with Serial Driverp. 292
10.6 Summaryp. 302
Exercisesp. 303
11 Text Based LCD Projectsp. 305
11.1 PROJECT 11.1 - DisplayingText on LCDp. 305
11.2 PROJECT 11.2 - Moving Text on LCDp. 307
11.3 PROJECT 11.3 - Counting with the LCDp. 310
11.4 PROJECT 11.4 - Creating Custom Fonts on the LCDp. 315
11.5 PROJECT 11.5 - LCD Dicep. 317
11.6 PROJECT 11.6 - Digital Voltmeterp. 325