ECE 353 Introduction to Microprocessor SystemsAdministrative MattersTopicsMechanical SwitchesSlide 5Keypads and KeyboardsRotary EncodersLED DisplaysLCD Display CharacteristicsLCD TechnologySlide 11Slide 12Slide 13Slide 14Slide 15LCD Character ModulesSlide 17LCD CommandsDesigning a Software InterfaceWrapping UpMatrix-Connected SwitchesKeypad ExampleMatrix Scanning Algorithm74C923 20-Key EncoderMaxim MAX6816/7/8Quadrature Rotary EncodersIndexed Rotary EncodersAbsolute Rotary EncodersRotary Encoder with InterruptsTypical LED CharacteristicsSlide 31MAX7219 Multiplexed Display DriverMultiplexed DisplayHW Switch DebouncingSlide 35ECE 353Introduction to Microprocessor SystemsMichael SchulteWeek 12Administrative MattersHomework #6 due Friday, May 9thReading for week 12 (switches, keypads, and displays)Textbook 7.6-7.10Supplement #5 (Learn@UW)Final exam on Saturday, May 17th from 7:45am to 9:45am in 3418 EHCumulative exam covering Modules 1-6More details coming soonTopicsDigital InputsMechanical switchesKeypads and keyboardsRotary encodersDisplaysLED displaysLCD displaysMechanical SwitchesTypes of switchesPolesThrowsContact actionConverting switch position to a logic levelMechanical contact bounceDebouncing in HardwareRS latchIntegrator/Schmitt-triggerDedicated ICs (MAX6816/7/8)Mechanical SwitchesDebouncing in SoftwareHow to do?Exercise1. Develop an algorithm for debouncing of a single pressed switch. (Assume 0 when pressed.)2. Draw a flowchart to implement your algorithm in an ISR that will be invoked by a periodic timer interrupt.Keypads and KeyboardsSwitch connectionsLinearMatrixKeypad scanningRow/column scanningAlgorithmDedicated keypad encoders (74C923)Keypad issuesPhantom keysRoll-overRotary EncodersConvert angular position to digital valueEncoding schemesQuadrature EncodersAbsolute EncodersIndexed EncodersInterfacingSoftwareUsing interruptsHardwareDesign logic or use dedicated devicesLED DisplaysCharacteristicsDriver requirementsDisplay typesDriversMultiplexed displaysDriver circuitsRefresh rateDuty cycleIntensity controlDisplay Driver ICsLED ISR algorithm and routineLCD Display CharacteristicsNumeric, text and/or graphic displaysExtremely low powerPassiveTemperature sensitiveComplex drivers required to create segment waveformsRequire no net DC offset on segments – on single polarity systems this adds to driver complexityLCD Technologyhttp://en .wikipedia.org/wiki/Liquid _crystal_displayNatural stateMolecules are arranged in a loosely ordered fashion with their long axes parallel. Aligned stateWhen coming into contact with a finely grooved surface (alignment layer), molecules line up in parallel along the grooves.LCD TechnologyWhen liquid crystals are sandwiched between upper and lower plates, they line up with grooves pointing in directions 'a' and 'b,' respectively. The molecules along the upper plate point in direction 'a' and those along the lower plate in direction 'b,' thus forcing the liquid crystals into a twisted structural arrangement. (figure shows a 90-degree twist) (TN type liquid crystal)LCD TechnologyLight passes through liquid crystals, following the direction in which the molecules are arranged. When the molecule arrangement is twisted 90 degrees as shown in the figure, the light also twists 90 degrees as it passes through the liquid crystals.LCD TechnologyThe molecules in liquid crystals are easily rearranged by applying voltage or another external force. When voltage is applied, molecules rearrange themselves vertically (along the electric field) and light passes straight through.LCD TechnologyLight passes when two polarizing filters are arranged with their axes aligned (left).Light is blocked when two polarizing filters are arranged with their axes perpendicular (right).LCD TechnologyA combination of polarizing filters and twisted liquid crystal is used to create a liquid crystal display.LCD Character ModulesBased on Hitachi LCD-II controller protocol1 to 4 lines, 8-20 characters per line4 or 8 bit parallel interfaceMotorola style control signals256 character font8 user defined characters (Character Generator RAM)Controllable cursor2 read/write registersInstruction/statusdataLCD Character ModulesStandard Hardware InterfaceContrast adjustmentTemperature considerationsControl bus connectionsRegister addressingBus Timing RequirementsOften slower than processor – may require wait statesSequential operations often require delayCan drive LCD module bus from I/O pins and manipulate to get proper waveforms (bit-banging)BacklightsLEDCCFL/ELLCD CommandsCommandsDisplay ClearCursor HomeEntry Mode SetDisplay On/Off ControlCursor/Display ShiftFunction SetSet CGRAM AddressSet DDRAM AddressUsing BUSY FlagDesigning a Software InterfaceWhat procedures would you write in order to create a higher-level software interface to the LCD display?Build a hierarchy using low-level procedures as building blocks –LCD InitializationSend Command (pass command)Send Data (pass data)Check if Busy (return state)Wait until Ready Write Character at Location (pass char, location)Write Character String (pass address)Write Character String at Location (pass addr, location)Wrapping UpHomework #6 due Friday, May 9thth.Final exam on Saturday, May 17th from 7:45am to 9:45am in 3418 EHCumulative exam covering Modules 1-6More details coming soonMatrix-Connected SwitchesEach switch connected between a row line and a column line.More complicated circuitry required to poll switches.Why connect in a matrix? Think about keyboard with 100+ keys...1 2345 67 8 9* 0 #BackKeypadExampleBack1 2345 67 8 9* 0 #D-FFBUFFERD0D1D2D3/ROW/COLVddOECLKD QMatrix Scanning AlgorithmAlgorithmDrive columns (or rows) low one at a time.Read the rows (or columns), any low rows (columns) correspond to pressed switches.Circuit RequirementsPull-up resistors to ensure that open rows (or columns) are high.Use open-drain / open-collector driver on each column (row) to avoid contention issues with multiple presses.Switch AmbiguitiesIf more than two switches are pressed, may “see” more switches active than there really are. (phantom paths)Can be solved by placing a series diode at each switch.Back74C923 20-Key EncoderBackMaxim MAX6816/7/8BackBackQuadrature Rotary EncodersThere are normally many
View Full Document