13-14.04.2011CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06.

Slides:



Advertisements
Similar presentations
Electronics Design Lab TUTORIAL PIC Microcontrollers Francesco Tenore 2/10/2006.
Advertisements

Lab 12 : Liquid Crystal Displays: Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 DMD Basics : Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Data Write the.
PIC16F bit 8-channel Analog-to-Digital Converter.
Slides created by: Professor Ian G. Harris Inputs and Outputs PIC Vcc RA3 RA4 RA5  Make an LED toggle state when button is pressed  Need to read RA3,
Data acquisition and manipulation
Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18.
Introduction of Holtek HT-46 series MCU
ECT 357 Ch 10 Analog to Digital COnversion. Today’s Quote: It’s better to die with a good name than to live with a bad one. It’s better to die with a.
S4525A Peripherals & Enhanced FLASH 1 © 1999 Microchip Technology Incorporated. All Rights Reserved. S4525A Peripherals & Enhanced FLASH 1 Peripherals.
Spring EE 316 Computer Engineering Junior Lab LCD modules, PROMs, Serial Ports.
MP3 player on PC using PIC controller via USB. Supervisor: Dmitry Sokolik Performed by: Yoav Gershoni Shachar Faigenblat.
ASPPRATECH.
16x2 LCD Module on DE2-115 數位電路實驗 TA: 吳柏辰 Author: Trumen.
Engineering 1040: Mechanisms & Electric Circuits Fall 2011 Introduction to Embedded Systems.
KyungHee Univ. 2-0 Parallel Port LCD Interface with the HD44780 Controller.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
Digital Outputs LCD Display
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Digital to Analogue Converter
8279 KEYBOARD AND DISPLAY INTERFACING
EE 316 Computer Engineering Junior Lab Serial Ports, LCD Displays & PROMs.
Chapter 10 Glass Bliss Using the Parallel Master Port to communicate with Alphanumeric LCD displays.
8279 KEYBOARD AND DISPLAY INTERFACING
Chapter Microcontroller
Components of a typical full-featured microcontroller.
CEng3361/18 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2007 Recitation 01.
LCD AND LCD INTERFACING. INDEX:-  INTRODUCTION  PIN DISCRIPTION  INITIALIZATION OF LCD  LCD INTERFACING  LCD INTERFACING WITH ATMEGA 32  INTERFACING.
Microcontrollers Part II BME 201. Overview ADC Serial.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
USING TV REMOTE AS A CORDLESS MOUSE FOR THE COMPUTER
CORDLESS MOUSE FEATURES BY TV REMOTE USING PIC MICROCONTROLLER
Application Case Study Christmas Lights Controller
Introduction to Microcontroller Technology
Embedded Microcontroller Systems
INT. TO EMBEDDED SYSTEMS DEVELOPMENT
LCD Interfacing using Atmega 32
AVR ATMEGA 8 MICRO-CONTROLLER
Embedded Microcontroller Systems
Homework Reading Machine Projects Labs
LCD and Keyboard Interfacing
SCADA for Remote Industrial Plant
Microcontroller Applications
GANDHINAGAR INSTITUTE OF TECHNOLOGY
INT. TO EMBEDDED SYSTEMS DEVELOPMENT
DIGITAL CALCULATOR USING 8051
Chapter 9 Alphanumeric Displays
16x2 LCD Module on DE2-115 Digital Circuit Lab TA: Po-Chen Wu.
EET 2261 Unit 11 Controlling LCD and Keypad
Introduction to Microprocessors and Microcontrollers
Interfacing Memory Interfacing.
LCD and Keyboard Interfacing
8051 Single Board Computer (SBC) Version 1.0
EET 2261 Unit 11 Controlling LCD and Keypad
ECE 354 Computer Systems Lab II
LCD and Keyboard Interfacing
PIC18F458 Analog-to-Digital
LCD and Keyboard Interfacing
LCD and Keyboard Sepehr Naimi
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
ADC and DAC Data Converter
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
8051 Micro Controller.
LCD and Keyboard Interfacing
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
INTERRUPTS.
ADC and DAC Data Converter
PIC Microcontroller ADC interfacing Prof. Ashvini Kulkarni
Presentation transcript:

CEng3361 CENG 336 INT. TO EMBEDDED SYSTEMS DEVELOPMENT Spring 2011 Recitation 06

CEng3362 OUTLINE A/D Module LCD Driving Specs Sample code

CEng3363 A/D Conversion Many sensors used to monitor the real world produce analog or continuous voltage signals. These signals must be converted to digital form before the computer can process them. Analog-to-digital converter (ADC or A/D) converts analog signals to digital values. 3-bit AD converter time Digital output 5 V

CEng3364 A/D Module in PIC16F877 8 Analog input channels 10-bit resolution Software selectable reference voltages Can operate in SLEEP mode using its own internal RC oscillator

CEng3365 Block Diagram

CEng3366 Registers A/D Result High Register (ADRESH) A/D Result Low Register (ADRESL) A/D Control Register0 (ADCON0) A/D Control Register1 (ADCON1)

CEng3367 Registers

CEng3368 Registers

CEng3369 Registers A/D Result Justification

CEng33610 A/D Module Operation The analog input charges a sample and hold capacitor. The output of the sample and hold capacitor is the input into the converter. The converter then generates a digital result of this analog level

CEng33611 Analog Input Model

CEng33612 A/D Acquisition Time Requirements There is a minimum acquisition time to ensure that the holding capacitor is charged to a level that will give the desired accuracy for the A/D conversion. Look at the datasheet for calculations.

CEng33613 A/D Conversion T AD Cycles The A/D conversion time per bit is defined as T AD. The A/D conversion requires T AD per 10-bit conversion.

CEng33614 Selecting A/D Conversion Clock The four possible options for TAD are: 2T OSC 8T OSC 32T OSC Internal RC oscillator For correct A/D conversions, the A/D conversion clock (TAD) must be selected to ensure a minimum TAD time of 1.6 μs.

CEng33615 A/D Module Operation The analog input channels must have their corresponding TRIS bits selected as inputs.

CEng33616 A/D Module Operation When the A/D conversion is complete, the result is loaded into this A/D result register pair, the GO/DONE bit (ADCON0 ) is cleared, and A/D interrupt flag bit, ADIF, is set.

CEng33617 Some Notes If the TRIS bit is cleared (output), the digital output level (VOH or VOL) will be converted.

CEng33618 LCD

CEng33619 LCD Pinouts PinLevelDescriptionConnection 10 VGroundGND 2+5 VVcc+5V 3VariableContrast VoltagePot. 4H/L"R/S“, H:DATA, L:InstructionRC0 5H/L"R/W“, H:Read (Lcd →Pic), L:Write(Pic → Lcd)GND 6H, H→L"E" Clock inputRC1 7-14H/LI/O PinsPORTD 15-Backlight anode+5V 16-Backlight cathodeRA5(INVERTED)

CEng33620 R/S, R/W and E The "R/S" bit is used to select whether data or an instruction is being transferred between the microcontroller and the LCD. H:DATA, L:Instruction H:Read (Lcd →Pic), L:Write(Pic → Lcd) On the demo board you can make only write operations since the "R/W" pin is connected to GND. After an instruction code or a data presented to the I/O pins a clock pulse should be sent to the "E" pin. PORTD

CEng33621 Addressing and Memories Inside LCD DDRAM : Data Display RAM is the working data buffer of the display. Each character on the display has a corresponding DDRAM location and the byte loaded in DDRAM controls which character is displayed. Relationship between DDRAM addresses (7-bit) and positions on the liquid crystal display. CGROM : Character Graphics ROM that holds the fixed character set, namely all the standard patterns of dots for dot matrix characters CGRAM : Character Graphics RAM that allows the user to define special supplementary non-standard character types that are not in the CGROM. You can load your own dot pattern shapes and display them.

CEng33622 LCD Instruction Codes The value of R/S bit: Low

CEng33623 RSR/WD7D6D5D4D3D2D1D Clear Display Clears all display memory and returns the cursor to the home position (leftmost character of Line1).

CEng33624 RSR/WD7D6D5D4D3D2D1D X Return Home Returns the cursor to the home position DDRAM contents remain unchanged

CEng33625 RSR/WD7D6D5D4D3D2D1D I/DS Entry Mode Set Sets the cursor move direction and specifies or not to shift the display. These operations are performed during data write and read. I/D = 1 : Increment DDRAM address I/D = 0 : Decrement DDRAM address S = 1 : Display shift [I/D = 1 : Left, I/D = 0 : Right] S = 0 : No display shift

CEng33626 Command: Decrement Address Counter Display Shift :OFF Command: Display Shift :ON Shift RIGHT Command: Increment Address Counter Display Shift :OFF Command: Display Shift :ON Shift LEFT Example entry mode settings* * images taken from:

CEng33627 RSR/WD7D6D5D4D3D2D1D DCB Display & Cursor Control Sets display (D), cursor (C), and blinking of cursor (B) on/off control bit. D = 1 : Display is ON D = 0 : Display is OFF C = 1 : Cursor ON C = 0 : Cursor OFF B = 1 : Blink ON B = 0 : Blink OFF

CEng33628 RSR/WD7D6D5D4D3D2D1D S/CR/LXX Cursor or Display Shift Moves the cursor or shifts the display without changing DD RAM contents. S/CR/LOperation 00The cursor position is shifted to the left 01The cursor position is shifted to the right 10The entire display is shifted to the left with the cursor 11The entire display is shifted to the right with the cursor

CEng33629 RSR/WD7D6D5D4D3D2D1D DLNFXX Function Set Sets interface data length (DL), number of display lines (N), and character font (F). DL = 1 : 8-bit DL = 0 : 4-bit N = 1 : 2 lines N = 0 : 1 line F = 1 : 5x11 dots F = 0 : 5x8 dots

CEng33630 RSR/WD7D6D5D4D3D2D1D0 001A6A5A4A3A2A1A0 Set DDRAM Address Sets the DDRAM address Relationship between I/O port (PORTD in our case) values and positions on the liquid crystal display.

CEng33631 RSR/WD7D6D5D4D3D2D1D0 0001A5A4A3A2A1A0 Set CGRAM Address Sets the CGRAM address

CEng33632 RSR/WD7D6D5D4D3D2D1D0 10D7D6D5D4D3D2D1D0 Write Data to RAM Writes data into the RAM