background image

             

PIC EK Lab Operation Guide (for PIC18F4550)

 

 

38

Lab35. PS2 K LCD1602 Display 

a).Hardware Connection 

 

b). 

OBJECTIVES 

To understand the operation of

 PS/2 

Keyboard using a Microcontroller. 

c). Experimental Principle and Results 

Press a keys on the keyboard, the key value will be displayed on LCD1602.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Summary of Contents for PIC-EK

Page 1: ...e the performance thereof in order to better suit your needs Please share your thoughts and feelings regarding our operation so that we can serve you better in the future I thank you for your continued support and patronage Your Dream is our Destination The Microchip TI Freescale ST Atmel Silicon and CYPRESS name logo and products names are trademarks of Microchip TI Freescale ST Atmel Silicon and...

Page 2: ...otor 21 Lab19 LCD1602 Display Char 22 Lab20 LCD1602 Display Arabic numerals 23 Lab21 LCD1602 Display number 24 Lab22 Timer0 V0 25 Lab23 Timer0 16digit segled Display 26 Lab24 Timer0 LCD1602 Display 27 Lab25 Timer1 V0 28 Lab26 Timer1 16digit segled Display 29 Lab27 Timer1 LCD1602 Display 30 Lab28 Timer2 V0 31 Lab29 Timer2 16digit segled Display 32 Lab30 Timer2 LCD1602 Display 33 Lab31 Interrupt RB0...

Page 3: ...602 Display 58 Lab54 AN3 10BIT LCD1602 Display 59 Lab55 AN4 10BIT LCD1602 Display 60 Lab56 AN5 10BIT LCD1602 Display 61 Lab57 AN6 10BIT LCD1602 Display 62 Lab58 AN7 10BIT LCD1602 Display 63 Lab59 Voltage Measuring Using 86BIT AN0 LCD1602 Display 64 Lab60 Voltage Measuring Using 106BIT AN0 LCD1602 65 Lab61 AN06CCP1 V2 66 Lab62 AN06CCP2 V1 67 Lab63 DS18B20 LCD1602 Display 68 Lab64 24CXX LCD1602 Disp...

Page 4: ...4550 4 Lab1 Speaker1 a Hardware Connection b OBJECTIVES 1 To understand the operation of an IO 2 To interface and drive a Buzzer Speaker c Result RC2 1 The transistor T1 S8050 is saturated and ON and the Speaker will be continued activated ...

Page 5: ...eration of an IO 2 To interface and drive a Buzzer Speaker c Experimental Principle and Results RC2 1 the transistor T1 S8050 is saturated and ON and the Speaker will be activated RC2 0 the transistor T1 S8050 is OFF and the speaker will be stop chirping When running this application the buzzer sounds intermittently ...

Page 6: ...ation Guide for PIC18F4550 6 Lab3 Drive one LED V0 a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive an LED c Experimental Principle and Results RD0 1 and the V0 will be ON ...

Page 7: ...0 flashing a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive an LED c Experimental Principle and Results RD0 1 and the V0 will be ON RD0 0 and the V0 will be OFF We give it some frequency via delay the V0 will be flashing ...

Page 8: ... Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive an LED c Experimental Principle and Results Make a value table and send the value to the RD port to make the 8 LEDs running in flowing water mode from left to right reciprocating cycle ...

Page 9: ...18F4550 9 Lab6 16digit Segled Display a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results segment b and c ON the others segments OFF ...

Page 10: ...git Segled Display 069 a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Make a table to save value 0 9 and send them to RD port d Table for value 069 ...

Page 11: ...isplay ones place a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y0 0 on 74HC138 and send 0 to the RD port at the same time The fourth digit will display 0 ...

Page 12: ...Display tens place a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y1 0 on 74HC138 and send 1 to the RD port at the same time The third digit will display 1 ...

Page 13: ...splay hundreds place a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y2 0 on 74HC138 and send 2 to the RD port at the same time The second digit will display 2 ...

Page 14: ...splay thousands place a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y3 0 on 74HC138 and send 3 to the RD port at the same time The first digit will display 3 ...

Page 15: ...splay 0123 a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y06Y3 to 0 one by one and send 0 3 to the RD port at the same time The four digit will display 0123 ...

Page 16: ...ed Display 000069999 a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results Set Y06Y3 to 0 one by one and send value to the RD port at the same time and then value 1 ...

Page 17: ...ttons 16digit Segled a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a dynamic state SEGLED c Experimental Principle and Results The Key value display on the 4 digit segled when Button1 Button3 or Joystick is pressed ...

Page 18: ...15 Jostick Buttons Speaker a Hardware Connection b OBJECTIVES To understand the operation of an IO To interface and drive a Buzzer speaker c Experimental Principle and Results The Speaker will be activated when Button1 Button3 or Joystick is pressed ...

Page 19: ...Lab16 4x4Keyboard 16digit segled a Hardware Connection b OBJECTIVES To understand the operation of an IO To understand the keypad scan tech c Experimental Principle and Results The Key value display on the 1 digit segled when KEY1 KEY16 is pressed ...

Page 20: ...8F4550 20 Lab17 4x4Keyboard Speaker a Hardware Connection b OBJECTIVES To understand the operation of an IO To understand the keypad scan tech c Experimental Principle and Results The Speaker will be activated when KEY1 KEY16 is pressed ...

Page 21: ...ardware Connection b OBJECTIVES To understand how to control a stepmotor c Experimental Principle and Results We use a 4 phase step motor in this application The step motor will rotate when we add different voltage on the 4 lines Red Orang Yellow Green Pink Color IO ...

Page 22: ...PIC EK Lab Operation Guide for PIC18F4550 22 Lab19 LCD1602 Display Char a Hardware Connection b OBJECTIVES To understand the operation of a Char LCD c Experimental Principle and Results ...

Page 23: ...PIC EK Lab Operation Guide for PIC18F4550 23 Lab20 LCD1602 Display Arabic numerals a Hardware Connection b OBJECTIVES To understand the operation of a Char LCD c Experimental Principle and Results ...

Page 24: ...PIC EK Lab Operation Guide for PIC18F4550 24 Lab21 LCD1602 Display number a Hardware Connection b OBJECTIVES To understand the operation of a Char LCD c Experimental Principle and Results ...

Page 25: ...ration Guide for PIC18F4550 25 Lab22 Timer0 V0 a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T0 250us 200 0 5s V0 ON 0 5s V0 OFF 0 5s V0 ON BB ...

Page 26: ...tion Guide for PIC18F4550 26 Lab23 Timer0 16digit segled Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T0 250us 400 1s 0 1 2 3 B9 0 1 2B ...

Page 27: ...de for PIC18F4550 27 Lab24 Timer0 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T0 250us 400 1s 00000 00001 00002BB 50000 00000 00001BBB ...

Page 28: ...ration Guide for PIC18F4550 28 Lab25 Timer1 V0 a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T1 250us 200 0 5s V0 ON 0 5s V0 OFF 0 5s V0 ON BB ...

Page 29: ...tion Guide for PIC18F4550 29 Lab26 Timer1 16digit segled Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T1 250us 400 1s 0 1 2 3 B9 0 1 2B ...

Page 30: ...de for PIC18F4550 30 Lab27 Timer1 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T1 250us 400 1s 00000 00001 00002BB 50000 00000 00001BBB ...

Page 31: ...ration Guide for PIC18F4550 31 Lab28 Timer2 V0 a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T2 250us 200 0 5s V0 ON 0 5s V0 OFF 0 5s V0 ON BB ...

Page 32: ...tion Guide for PIC18F4550 32 Lab29 Timer2 16digit segled Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T2 250us 400 1s 0 1 2 3 B9 0 1 2B ...

Page 33: ...de for PIC18F4550 33 Lab30 Timer2 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of timer c Experimental Principle and Results Set timer T2 250us 400 1s 00000 00001 00002BB 50000 00000 00001BBB ...

Page 34: ...or PIC18F4550 34 Lab31 Interrupt RB0 BUTTON1 LEDs a Hardware Connection b OBJECTIVES To understand the operation of RB0 Interrupt c Experimental Principle and Results Press BUTTON1 RB0 LEDs will return to the initial state restart ...

Page 35: ...Lab32 Interrupt RB0 BUTTON1 16digit segled Display a Hardware Connection b OBJECTIVES To understand the operation of RB0 Interrupt c Experimental Principle and Results Press BUTTON1 RB0 the 1 digit segled will return to the initial state restart 0 ...

Page 36: ...b33 Interrupt RB0 BUTTON1 46digit segled Display a Hardware Connection b OBJECTIVES To understand the operation of RB0 Interrupt c Experimental Principle and Results Press BUTTON1 RB0 the 4 digit segled will return to the initial state restart 0000 ...

Page 37: ...F4550 37 Lab34 Interrupt RB0 BUTTON1 LCD1602 a Hardware Connection b OBJECTIVES To understand the operation of RB0 Interrupt c Experimental Principle and Results Press BUTTON1 RB0 the LCD1602 will return to the initial state restart 0000 ...

Page 38: ...Lab35 PS2 KEYBOARD LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of PS 2 Keyboard using a Microcontroller c Experimental Principle and Results Press a keys on the keyboard the key value will be displayed on LCD1602 ...

Page 39: ...PIC EK Lab Operation Guide for PIC18F4550 39 Lab36 Watch Dog LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation Watch Dog c Experimental Principle and Results ...

Page 40: ...ternal eeprom LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of internal eeprom c Experimental Principle and Results Read the data X from address 0x10 X 1 write X 1 to 0x10 and display on LCD1602 Reset or re power the board ...

Page 41: ...8 PWM CCP1 V2 a Hardware Connection b OBJECTIVES To understand the operation of PWM c Experimental Principle and Results Use different duty cycle to control the brightness of the LED The V2 will be activated and act from Dim to BrightB Bright to DimB ...

Page 42: ...9 PWM CCP2 V1 a Hardware Connection b OBJECTIVES To understand the operation of PWM c Experimental Principle and Results Use different duty cycle to control the brightness of the LED The V1 will be activated and act from Dim to BrightB Bright to DimB ...

Page 43: ...tal Principle and Results After pressed on the infrared remote controller the code signal is received by the infrared receiver on PIC6EK board trigger an interrupt Decoding based on pulse width send the decoding value to LCD1602 Press the key on the Remoter the key value will be displayed on the LCD1602 1 Power on the board 2 For example Press 2 OX18 will be displayed Table for Key value ...

Page 44: ...PIC EK Lab Operation Guide for PIC18F4550 44 ...

Page 45: ...or PIC18F4550 45 Lab41 Remote SPEAKER a Hardware Connection b OBJECTIVES To understand the operation of infrared Remote control c Experimental Principle and Results Press the any key on the Remoter the speaker will be be activated ...

Page 46: ...Experimental Principle and Results After pressed on the infrared remote controller the code signal is received by the infrared receiver on PIC6EK board trigger an interrupt Decoding based on pulse width send the decoding value to LCD1602 Press the key on the Remoter the key value will be displayed on the LCD1602 2 Power on the board 2 For example Press 2 OX18 will be displayed Table for Key value ...

Page 47: ...PIC EK Lab Operation Guide for PIC18F4550 47 ...

Page 48: ...AN0 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD0 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 49: ...AN1 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD1 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 50: ...AN2 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD2 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 51: ...AN3 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD3 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 52: ...AN4 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD4 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 53: ...AN5 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD5 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 54: ...AN6 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD6 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 55: ...AN7 8BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD7 sampling value will be displayed on the LCD1602 the range of 0 255 ...

Page 56: ...0 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD0 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 57: ...1 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD1 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 58: ...2 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD2 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 59: ...3 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD3 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 60: ...4 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD4 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 61: ...5 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD5 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 62: ...6 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD6 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 63: ...7 10BIT LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD7 sampling value will be displayed on the LCD1602 the range of 0 1023 ...

Page 64: ...age Measuring Using 86BIT AN0 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 8 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 8 bit AD0 sampling voltage will be displayed on the LCD1602 ...

Page 65: ...ltage Measuring Using 106BIT AN0 LCD1602 a Hardware Connection b OBJECTIVES To understand the operation of 10 bit ADC c Experimental Principle and Results Adjust the potentiometer ADC_INPUT The 10 bit AD0 sampling voltage will be displayed on the LCD1602 ...

Page 66: ...de for PIC18F4550 66 Lab61 AN06CCP1 V2 a Hardware Connection b OBJECTIVES To understand the operation of CCP1 and AD0 c Experimental Principle and Results Adjust the potentiometer ADC_INPUT the LED brightness V2 will changing ...

Page 67: ...de for PIC18F4550 67 Lab62 AN06CCP2 V1 a Hardware Connection b OBJECTIVES To understand the operation of CCP2 and AD0 c Experimental Principle and Results Adjust the potentiometer ADC_INPUT the LED brightness V1 will changing ...

Page 68: ...4550 68 Lab63 DS18B20 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of 1 wire device DS18B20 c Experimental Principle and Results The current environment s temperature value will be displayed on the LCD1602 ...

Page 69: ... LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of external eeprom 24Cxx c Experimental Principle and Results Press the Reset KEY the external eeprom will record the number of times Press Reset Button or re power up the boardB ...

Page 70: ...uide for PIC18F4550 70 Lab65 RTC PCF8563 LCD1602 Display a Hardware Connection b OBJECTIVES To understand the operation of PCF8563 using IIC c Experimental Principle and Results The RTC will will be displayed on the LCD1602 ...

Page 71: ...IVES To understand the operation of RS232 c Experimental Principle and Results Send a data X from PC the MCU will receive it and return X 1 to PC All data will be displayed on the LCD1602 1 Start to run Baud Rate will be displayed 2 On SComAssistant 37 is data for sending 38 is data for receiving ...

Page 72: ...PIC EK Lab Operation Guide for PIC18F4550 72 3 Sent data 0x37 and received data 0x 38 will be displayed on LCD1602 ...

Page 73: ...PIC EK Lab Operation Guide for PIC18F4550 73 Lab67 LCD12864 with st7920 controller a Hardware Connection b OBJECTIVES To understand the operation of LCD12864 c Experimental Principle and Results ...

Page 74: ...49 Skype love100mhz E MAIL love100mhz hotmail com Website www LogiFind com ebay Store 1 http stores ebay com logifind ebay Store 2 http stores ebay com kitfind ebay Store 3 http stores ebay com opendiy If you want to learn more about our products please visit our website at www LogiFind com If you have any questions comments or business proposals contact us at love100mhz hotmail com wxl07297662156...

Page 75: ...interruption or any other pecuniary loss arising out of the use of this manual or product even if LogiFind has been advised of the possibility of such damages LogiFind reserves the right to change information contained in this manual at any time without prior notice if necessary HIGH RISK ACTIVITIES The products of LogiFind are not fault tolerant nor designed manufactured or intended for use or re...

Reviews: