Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AVR_Course_Day5 avr interfaces

This is a microcontroller course for atmega328 (the chip used in Arduino Uno) explained very simply .

Related Books

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

AVR_Course_Day5 avr interfaces

  1. 1. AVR Interfaces Eng:Mohamed Loay Ali 1
  2. 2. Contents • 7 Segments • LCD • Keypad Eng:Mohamed Loay Ali 2
  3. 3. 7-Segements Eng:Mohamed Loay Ali 3
  4. 4. Liquid Crystal Display(LCD) LCD Interfacing: The LCD has the ability to display (Numbers, Characters and graphics) so they are widely used in AVR real word applications. LCD Description: The following table shows the pin description of the LCD Eng:Mohamed Loay Ali 4
  5. 5. Liquid Crystal Display(LCD) RS (Register Select): When RS=0, this allow the user to send command such as (clear screen, go home, blink cursor). When RS=1, this allow the user to send data. Enable: It used to latch the information to the data pins, this done by send a high to low pulse (of width of 450 ns) so the LCD latches the data presented on the data pins. Eng:Mohamed Loay Ali 5
  6. 6. Liquid Crystal Display(LCD) The Instruction Command for the LCD: Eng:Mohamed Loay Ali 6
  7. 7. Liquid Crystal Display(LCD) Sending Commands and data to the LCD: The following steps should be done to send the command and data to the LCD: 1) Initialized the LCD. 2) Sending Commands to the LCD. 3) Sending data to the LCD. Eng:Mohamed Loay Ali 7
  8. 8. Liquid Crystal Display(LCD) 1)Initialized the LCD : For example to initialize LCD [2 lines 5*7 matrix 8bit mode] the following commands should be used: 1. 0x38 to select the type and mode of operation 2. 0x0E to display the cursor blinking. 3. 0x01 to clear the LCD display. Note: After powering up the LCD a 15 ms should be waited to send the commands. Eng:Mohamed Loay Ali 8
  9. 9. Liquid Crystal Display(LCD) 2)Sending Commands to the LCD : To send commands to the LCD the following steps should be done: 1. RS=0, RW=0. 2. The command number should be put on the data pins (D0 to D7). 3. A pulse (high to low) should be sent on the Enable pin. After each command a delay of (100us) should be placed. Eng:Mohamed Loay Ali 9
  10. 10. Liquid Crystal Display(LCD) 3) Sending data to the LCD : To send data to the LCD the following steps should be done: RS=1, RW=0. 1. The data should be put on the data pins (D0 to D7). 2. A pulse (high to low) should be sent on the Enable pin. After each data a delay of (100us) should be placed. Eng:Mohamed Loay Ali 10
  11. 11. Liquid Crystal Display(LCD) Typical Connection of LCD(8bit mode) : Eng:Mohamed Loay Ali 11
  12. 12. Liquid Crystal Display(LCD) Typical Connection of LCD(4bit mode) :  Remember that there are a special pins on the AVR for example (ADC pins, Interrupt pins, Communication pins).  If one of those purposes is required in the application try to not connect the LCD with those special pins required for the application.  See 4bit and 8bit examples of LCD. Eng:Mohamed Loay Ali 12
  13. 13. KeyPad Eng:Mohamed Loay Ali 13

×