Download: 8-bit Microcntroller Application Note

8-bit Microcntroller Application Note Rev. 2532A–AVR–01/03 AVR243: Matrix Keyboard Decoder Features • 64-key Push-button Keyboard in8x8Matrix • No External Components Required • Wakes Up from Sleep Mode on Keypress • Easily Implemented into Other Applications • Low Power Consumption • Software Contact Bounce Elimination • Support for Alternate Function Keys, Easily Removable to Reduce Code Size • Suitable for Any AVR® with a Minimum of 17 IO-lines and Pin Change Interrupt (Currently Only ATmega162 and ATmega169) • Can Be Modified for Other Devices, Using One Common Interrupt, See Application N...
Author: Walway Shared: 8/19/19
Downloads: 99 Views: 2251

Content

8-bit

Microcntroller Application Note

Rev. 2532A–AVR–01/03

AVR243: Matrix Keyboard Decoder Features

• 64-key Push-button Keyboard in8x8Matrix • No External Components Required • Wakes Up from Sleep Mode on Keypress • Easily Implemented into Other Applications • Low Power Consumption • Software Contact Bounce Elimination • Support for Alternate Function Keys, Easily Removable to Reduce Code Size • Suitable for Any AVR® with a Minimum of 17 IO-lines and Pin Change Interrupt (Currently Only ATmega162 and ATmega169) • Can Be Modified for Other Devices, Using One Common Interrupt, See Application Note “AVR240: 4x4Keypad – Wake-up on Keypress”

Introduction

This application note describes a software driver interfacing an8x8keyboard. The application is designed for low power battery operation. The AVR spends most of its time in Power-down sleep mode, waking up when a key is pressed. The keyboard is scanned, scancodes are processed and the AVR finally reenters sleep mode. The application also supports user-defined alternation keys to implement Caps Lock, Ctrl-, Shift- and Alt-like functionality. A test application implementsa4x4keyboard with one digit and three letters on each key. Alternation keys choose the keys’ functions. Figure 1. Application Status LEDs

ATmega162

123Alt1456Alt2789Alt3 Terminal * 0 # Alt4 Port D Port C UART Port A, The application is suitable for all applications using matrix keyboards, e.g., remote con- trols, mobile phones and alarm and access systems. It is also easily upgradable using the AVR’s In-System Programming capability or the Self-programming feature of the ATmega devices. (See application notes “AVR910: In-System Programming” and “AVR109: Self-programming”.) An example on using the Self-programming feature is a general purpose re-programmable remote control. The implementation described in this application note is using the ATmega162 device as target. The code can, however, be used with the ATmega169 device with minor modifications.

Theory of Operation The keyboard matrix is organized in8x8pushbuttons connected with row and column

lines as shown in Figure 2. A keypress connects the key’s row and column lines. When pressing the top left key, the leftmost column line is connected to the topmost row line. Figure 2. Keyboard Connection Pin 0 Pin 7 ATmega162 Pin 0 Pin 7 Keyboard Matrix Matrix keyboards can be scanned in several ways. When only single keys are pressed, a quick method is to first select (drive low) all row lines and read the column result. Then all column lines are selected, and the row result is read. Returned column and row is combined into a unique scancode for the specific key pressed. This method is used in this application note. When simultaneous keypress capability is required, the method above cannot be used. The rows must be scanned separately. The row lines must be selected (driven low) sequentially, reading the column result for each row, thus getting all pressed keys. One limitation is when keys are pressed in such a pattern that unwanted interconnections appear. In Figure 3, the three highlighted keys pressed connect the row and column lines in such a way that the X-marked key appears to be pressed too. Therefore, this “ghost” key represents an error state. Port D PortC2AVR243,

AVR243

Figure 3. Ghost Key as Result of Multiply Keys Pressed Simultaniously To detect a keypress and wake-up from sleep mode, the pin change interrupt on the AVR is used. Prior to entering sleep mode, all rows are selected (driven low), thus driv- ing a column line low on any keypress in any row. (The result of a key will cause an interrupt, but will decode as “No key pressed”.) Due to the use of the pin change interrupt, only one key event is caught per key press. Automatically repeating keys, by interrupt, are not possible with this implementation. Repetition must be handled separately by the main application, by manually repeating the key’s associated action until all keys are released.

Alternation Keys Many keyboard interfaces use secondary key functions. This can be implemented in

several ways. One common method is to dedicate a number of keys to be alternation keys. When pressed simultaneously with ordinary keys, secondary scancodes are gen- erated. It is also common to use sequential combinations, where an alternation key pressed prior to an ordinary key generates secondary codes. This eliminates the need to handle simultaneous key presses. The alternation key(s) only applies to the first ordinary keypress after the alternation key(s) has been activated. This type of alternation key is in this document referred to as a “one-shot” alternation key. It is also possible to implement the alternation keys as a toggle function, where the first press on the alternation key enables the secondary mode, and the next disables it again. The alternation applies to all keys pressed subsequently and is only terminated by second press on the alternation key. This is used on ordinary PC keyboards’ Caps Lock keys. This application uses a combination of both one-shot and lock-based alter- nation keys. By using sequential keys rather than simultaneous keys, the problem with ghost keys is avoided. The application simply ignores all but the top left of the keys pressed.,

Contact Bounce When a keyboard button is pressed, the contact bounces for some time before settling

in a steady on-state as illustrated in Figure 4. This must be handled in a way that won’t generate multiple keypresses. One common way to do this is to wait a short while from the keypress detection, letting the contact settle, and then read the actual state. This also eliminates errors due to noise spikes on the lines. Alternatively, a hardware imple- mented bounce eliminator or software digital filter can be applied. This application uses the first method, simply waiting for the contact to settle, since it is the most inexpensive and uses least power. Figure 4. Contact Bounce Delay Change Value Detection Read

Implementation The following implementation uses the ATmega162 device. Guidelines on porting to the

ATmega169 device are listed on page 10. The keyboard is connected to the AVR using two 8-bit IO ports. One port (Port D) is con- figured as output and is connected to the row selection lines. One port (Port C) is configured as input and is connected to the column return lines. See Figure 2 for details. When scanning the keyboard matrix, the port currently used for output must be driven low, while the input port must be internally pulled high, waiting to be driven low due to a keypress. This application’s test function also uses Pin 1 of Port E as a serial output for transmit- ting the keypress information. See application note “AVR306: Using the AVR UART in C” for details using the UART. An ordinary keypress generates a scancode in the range 0 - 63 (8 output lines * 8 input lines) even if not all rows and columns are used. Pressing an alternation key also gener- ates ordinary scancodes, but in addition the alternation state flags are updated accordingly. The state flags are contained in a global variable. Three of the alternation keys are configured as lock keys, enabling secondary mode on all following keys until pressed a second time. The lower four is one-shot, changing only the next key’s function before the Flag is cleared automatically. See Figure 5 for more details. When pressed, alternation keys also returns an ordinary scancode, allowing the application to handle alternation keys as ordinary keys. Another global variable is used to pass the scancode together with the alternation Flags to the application. The six lower bits are used to indicate the code (0 - 63), while the MSB (bit 15) indicates the update status. The keyboard driver sets the bit when a key is 4 AVR243,

AVR243

pressed. The application polls this bit and clears it when it has read the scancode. The global byte and word are illustrated in Figure 5. Figure 5. Extended Scancode Global State Flags Temporary Scancode Lock Keys Row # Col # XXXMSB One-shot Keys Global Scanword1XXMSB Alternation Flags Scancode The keyboard software is implemented as an interrupt-controlled driver. The main appli- cation enters sleep mode when waiting for keypresses. The keyboard driver wakes up the AVR when a key is pressed, gets the scancode and updates the global bytes. The main application has the responsibility of reentering sleep mode, since a SLEEP instruc- tion inside an interrupt would halt the CPU.

Initialization and Main The driver initialization and main loop routine is shown in Figure 6. The alternation Flags Loop and global variables are cleared and the ports are initialized according to the previous

description. Power-down sleep mode is selected, allowing the application to enter sleep mode when no processing is required. Figure 6. Initialization

START

Init Global Variables and IO Ports Initialization Init Timer Init Interrupts and Select Power-down Sleep Mode

SLEEP

Handle Keypress if Main Loop Anything Pressed Your Other Code Goes Here,

Keyboard Decoder Main The driver’s main loop is executed on pin change interrupt. It first selects Idle sleep Loop mode, allowing the AVR to wake-up on Timer Overflow, since a Timer Overflow Interrupt

will not wake up the AVR from Power-down sleep mode. The timer is then set up to wait a short while (5 ms typical) for the contacts to settle. During this delay, the main applica- tion regains control and may enter sleep mode. When the delay is finished, the keypress processing function is called. This completes the retrieval of a keypress. Finally, all row lines are driven low and Power-down sleep mode is selected, allowing the main applica- tion to enter sleep mode and wake up on next keypress. The flow chart for this loop is shown in Figure 7. Figure 7. Keyboard Decoder Main Loop WAKE UP Select Idle Sleep Mode Timer Delay Process Keypress Drive All Row Lines Low Select Power- down Sleep Mode

SLEEP

6 AVR243,

AVR243 Keyboard Scanning The keyboard scanning process is illustrated in Figure 8. First the column result is

(Process Keypress) scanned. The three lower bits (column part) of the scancode is incremented until the low column line is found. Then, the port directions are inverted and the row result is scanned. The row part of the scancode is incremented until the low row bit is found.

Finally, the scancode processing function is called. Figure 8. Keyboard Scanning

Check Column Result Process Keypress Test Column Result Get Column Position Any Columns Yes Low? No Initialize Temporary Scancode

RETURN

Check Row Result LSB of Column Yes Result Low? No Invert Port Directions Shift Column Result Right 1 Bit Drive All Column Lines Low Increment Column Part of Scancode Test Row Result Get Row Position Any Rows Low? Yes No LSB of Row Yes Result Low? Set Original Port Directions ProcessNo scancode Shift Row Result RETURN Right 1 Bit Set Original Port Directions Increment Row Part of Scancode

RETURN

, The scancode processing function first copies the generated scancode to the global variable. Then the scancode is compared to the predefined alternation key codes, updating alternation Flags accordingly. The flags are copied to the global variable. If the key wasn’t an alternation key, the one-shot Flags are cleared. Finally, the update Flag is set, indicating a new keypress has been received. The procedure is shown in Figure 9. Figure 9. Scancode Processing Process Scancode Copy Scancode to Global Variable Set Update Flag in Global Variable Copy Alternation Flags to Global Variable Compare to Alternation Codes and Toggle Flags Key is Alternation No Key? Yes Clear One-shot Flags

RETURN The Test Application The source includes a simple test application that implements a cellphone-like key-

– myCellPhone board. Resulting characters are transmitted using the USART. Usinga4x4keypad, all digits and letters are available using four alternation keys. The digit keys alone will transmit digits. Three alternation keys are used to choose between the three letters on each digit key, and finally a Caps-Lock key chooses between lowercase and uppercase. Conversion tables are used to convert scancodes to characters, based on the current alternation state. The scancode is used as an index into the tables. The scancode is also a direct representation of the key’s position on an8x8keypad. The tables must therefore have eight entries per row, even if the keypad only has four keys per row. If the test application is modified to utilize larger keypads, it is, therefore, most size-efficient to add columns and not rows to the keypad. 8 AVR243,

AVR243 Code Size and The code size for the keyboard matrix interface functions is shown in Table 1. Timings Table 1. Keyboard Matrix Code Size

Function Code Size (Words) Description key_init 25 Keyboard interface initialization key_stop 7 Temporary stop the driver key_get 15 Wait for a keypress key_processAltKeys 88 Process the alternation keys and update flags accordingly pinChangeISR 24 Interrupt handler for pin change interrupt Timer0OVFISR 107 Interrupt handler for timer overflow interrupt Total 266 When running at 8 MHz on the ATmega162, the following execution timings in Table 2 were measured. It shows the sequence from wake-up on the first detected keypress, to re-entering sleep mode after keypress processing. Table 2. Code Timings Sequence Execution Time Pin change wake-up -> Init timer -> Enter idle sleep 40 µs Idle sleep -> Timer overflow 65,4 ms Timer wake-up -> Keyboard scanning -> Enter Power-down sleep 351 µs Total time not in Power-down sleep mode 65,7 ms When not in Power-down sleep mode the keyboard interface spends most of it’s time waiting in Idle sleep mode. The device is in Active mode only 0.3 ms, which means 0.5%. The relative time spend in the differen modes is listed in Table 3. Table 3. Time Spend in Sleep/Active Mode Mode of Operation Time Active 0.5 % (15 mA) Idle sleep 99.5 % (7 mA) Power-down When waiting for a keypress (< 1 µA) Consider that a key is pressed every 10 minutes. This would give an average current consumption of less than 2 µA.,

Porting The only difference from ATmega162 to ATmega169 affecting this application is the port Considerations connected to the column lines of the matrix keyboard. ATmega162 uses Port C, while

Port B or E must be used on ATmega169. This is due to the Pin Change Interrupt pin configuration. ATmega162 has Pin Change Interrupt capabilities on Port A and C, while ATmega169 uses Port B and E for these interrupts. The application can easily be modi- fied to use the other port capable of handling Pin Change Interrupts, if the default port’s alternate capabilities are needed. Also note that ATmega169 uses the SMCR Register instead of MCUCR for sleep mode selection. Porting this application to devices without Pin Change Interrupts requires the use of external components and different interrupt usage. This is covered in application note “AVR240: 4x4Keypad – Wake-up on Keypress”. The rest of the scanning functionality in this application needs no changes. 10 AVR243,

Atmel Headquarters Atmel Operations Corporate Headquarters Memory RF/Automotive

2325 Orchard Parkway 2325 Orchard Parkway Theresienstrasse 2 San Jose, CA 95131 San Jose, CA 95131 Postfach 3535 TEL 1(408) 441-0311 TEL 1(408) 441-0311 74025 Heilbronn, Germany FAX 1(408) 487-2600 FAX 1(408) 436-4314 TEL (49) 71-31-67-0 FAX (49) 71-31-67-2340

Europe Microcontrollers

Atmel Sarl 2325 Orchard Parkway 1150 East Cheyenne Mtn. Blvd. Route des Arsenaux 41 San Jose, CA 95131 Colorado Springs, CO 80906 Case Postale 80 TEL 1(408) 441-0311 TEL 1(719) 576-3300 CH-1705 Fribourg FAX 1(408) 436-4314 FAX 1(719) 540-1759 Switzerland TEL (41) 26-426-5555 La Chantrerie Biometrics/Imaging/Hi-Rel MPU/ FAX (41) 26-426-5500 BP 70602 High Speed Converters/RF Datacom 44306 Nantes Cedex 3, France Avenue de Rochepleine

Asia TEL (33) 2-40-18-18-18 BP 123

Room 1219 FAX (33) 2-40-18-19-60 38521 Saint-Egreve Cedex, France Chinachem Golden Plaza TEL (33) 4-76-58-30-00 77 Mody Road Tsimhatsui ASIC/ASSP/Smart Cards FAX (33) 4-76-58-34-80 East Kowloon Zone Industrielle Hong Kong 13106 Rousset Cedex, France TEL (852) 2721-9778 TEL (33) 4-42-53-60-00 FAX (852) 2722-1369 FAX (33) 4-42-53-60-01

Japan 1150 East Cheyenne Mtn. Blvd.

9F, Tonetsu Shinkawa Bldg. Colorado Springs, CO 80906 1-24-8 Shinkawa TEL 1(719) 576-3300 Chuo-ku, Tokyo 104-0033 FAX 1(719) 540-1759 Japan TEL (81) 3-3523-3551 Scottish Enterprise Technology Park FAX (81) 3-3523-7581 Maxwell Building East Kilbride G75 0QR, Scotland TEL (44) 1355-803-000 FAX (44) 1355-242-743 e-mail email is hidden

Web Site

http://www.atmel.com © Atmel Corporation 2003. Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems. ATMEL® and AVR® are the registered trademarks of Atmel. Other terms and product names may be the trademarks of others. Printed on recycled paper. 2532A–AVR–01/03 0M]
15

Similar documents

  Alignment and Adjustments
Alignment and Adjustments 1. Tuner FM THD Adjustment FMOutput Antenna GND SETSSG FREQ. 98 MHz Terminal Oscilloscope Adjustment FM S.S.G Input point FM DETECTOR COIL Speaker (FM DET) Terminal output Input Output 60 dB Distortion Meter Minumum Distortion (0.4% below) (Figure 1-1) Figure1-1 IF CENTER
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2540A–AVR–07/03 AVR104: Buffered Interrupt Controlled EEPROM Writes Features • Flexible Multi-byte EEPROM Buffer • Power Efficient EEPROM Access • Access Control on Buffers • EEPROM Buffer Rewrite Introduction Many applications use the built-in EEPROM of t
  Schematic Diagram - This Document can not be used without Samsung’s authorization -
Schematic Diagram - This Document can not be used without Samsung’s authorization - 7-1 MAIN 7-1 Samsung Electronics 7-2 FRONT - This Document can not be used without Samsung’s authorization - Samsung Electronics 7-2 7-3 DSP - This Document can not be used without Samsung’s authorization - 7-3 Sam
  TroubleShooting
TroubleShooting 9-1 Main 9-1 Samsung Electronics Samsung Electronics 9-2 9-3 Samsung Electronics Samsung Electronics 9-4 9-2 DVD Servo parts 9-5 Samsung Electronics Samsung Electronics 9-6 9-7 Samsung Electronics Samsung Electronics 9-8 9-9 Samsung Electronics Samsung Electronics 9-10 9-11 Samsung
AVR054: Run-time calibration of the internal RC oscillator
AVR054: Run-time calibration of the internal RC oscillator Features • Calibration of internal RC oscillator via UART • LIN 2.0 compatible synchronization/calibration to within +/-2% of target frequency • Alternate run-time synchronization/calibration to within +/-1% of target frequency • Support for
SERVICE Manual
DVD RECEIVER AMP HT-DB120 SERVICE Manual DVD RECEIVER AMP SYSTEM CONTENTS 1. Alignment and Adjustments 2. Exploded Views and Parts List 3. Electrical Parts List 4. Block Diagrams 5. PCB Diagrams 6. Wiring Diagram 7. Schematic Diagrams 8. IC block Diagrams 9.Troubleshooting - Confidential - ELECTRONI
8-bit Microcontroller Application Note AVR131: Using the AVR’s High-speed PWM
8-bit Microcontroller Application Note Rev. 2542A–AVR–09/03 AVR131: Using the AVR’s High-speed PWM Features • Analog Waveform Generation using PWM • High-speed Prescalable PWM Clock Introduction This application note is an introduction to the use of the high-speed Pulse Width Mod- ulator (PWM) avail
8-bit RISC Microcontroller Application Note AVR042: AVR® Hardware Design Considerations
8-bit RISC Microcontroller Application Note Rev. 2521B–AVR–01/04 AVR042: AVR® Hardware Design Considerations Features • Providing Robust Supply Voltage, Digital and Analog • Connecting the RESET Line • SPI Interface for In-System Programming • Using External Crystal or Ceramic Resonator Oscillators
8-bit Microcontroller Application Note AVR240: 4x4Keypad – Wake-up on Keypress Features Introduction
8-bit Microcontroller Application Note AVR240: 4x4Keypad – Wake-up on Keypress Features • 16 Key Pushbutton Pad in4x4Matrix • Very Low Power Consumption • AVR in Sleep Mode and Wakes Up on Keypress • Minimum External Components • ESD Protection Included if Necessary • Efficient Code • Complete Progr
Microcontrollers for Fluorescent and High Intensity Discharge Lamp Ballasts SMARTER, MORE FLEXIBLE LIGHTING SOLUTIONS
LIGHTINGMICROCONTROLLERSMicrocontrollers for Fluorescent and High Intensity Discharge Lamp Ballasts SMARTER, MORE FLEXIBLE LIGHTING SOLUTIONS Developed together with the industry leading lamp ballast manufac- turers, Atmel® microcontrollers are optimized for Linear and Dimmable Fluorescent tubes, as
AVR121: Enhancing ADC resolution by oversampling
AVR121: Enhancing ADC resolution by oversampling Features • Increasing the resolution by oversampling • Averaging and decimation • Noise reduction by averaging samples 1 Introduction Atmel’s AVR controller offers an Analog to Digital Converter with 10-bit resolution. In most cases 10-bit resolution
  IC Block Diagrams 8-1 Main
IC Block Diagrams 8-1 Main 8-1-1. FAN8082D 8-1 Samsung Electronics 8-1-2. LC87F66C8A Samsung Electronics 8-2 8-3 Samsung Electronics Samsung Electronics 8-4 8-5 Samsung Electronics 8-1-3. M62446AFP Samsung Electronics 8-6 8-7 Samsung Electronics 8-1-4. M66010FP 8-1-5. SI-8050SE 8-1-6. SI-8090JFE S
AVR053: Calibration of the internal RC oscillator Features Introduction
AVR053: Calibration of the internal RC oscillator Features • Calibration using STK500, AVRISP, JTAGICE or JTAGICE mkII • Calibration using 3rd party programmers • Adjustable RC frequency with +/-1% accuracy • Tune RC oscillator at any operating voltage and temperature • Tune RC oscillator to any fre
8-bit Microcontroller Application Note AVR230: DES Bootloader Features
8-bit Microcontroller Application Note Rev. 2541D–AVR–04/05 AVR230: DES Bootloader Features • Fits All AVR Microcontrollers with Bootloader Capabilities • Enables Secure Transfer of Compiled Software or Sensitive Data to Any AVR with Bootloader Capabilities • Includes Easy To Use, Configurable Examp
AVR106: C functions for reading and writing to Flash memory
AVR106: C functions for reading and writing to Flash memory Features • C functions for accessing Flash memory - Byte read - Page read - Byte write - Page write • Optional recovery on power failure • Functions can be used with any device having Self programming Program memory • Example project for us
8-bit Microcontroller Application Note AVR201: Using the AVR® Hardware Multiplier
8-bit Microcontroller Application Note Rev. 1631C–AVR–06/02 AVR201: Using the AVR® Hardware Multiplier Features • 8- and 16-bit Implementations • Signed and Unsigned Routines • Fractional Signed and Unsigned Multiply • Executable Example Programs Introduction The megaAVR is a series of new devices i
  Printed Circuit Board Diagram
Printed Circuit Board Diagram 5-1 MAIN 5-1 Samsung Electronics 5-2 FRONT Samsung Electronics 5-2 5-3 DSP 5-3 Samsung Electronics 5-4 JACK * RCA JACK * SCART JACK Samsung Electronics 5-4 5-5 DVD PACK * TOP VIEW * BOTTOM VIEW 5-5 Samsung Electronics
8-bit Microcontroller Application Note AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory
8-bit Microcontroller Application Note Rev. 2546A–AVR–09/03 AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory Features • Fast Storage of Parameters • High Endurance Flash Storage – 350K Write Cycles • Power Efficient Parameter Storage • Arbitrary Size of Parameters • Semi-redu
8-bit RISC Microcontoller Application Note AVR130: Setup and Use the AVR® Timers Features
8-bit RISC Microcontoller Application Note Rev. 2505A–AVR–02/02 AVR130: Setup and Use the AVR® Timers Features • Description of Timer/Counter Events • Timer/Counter Event Notification • Clock Options • Example Code for Timer0 – Overflow Interrupt • Example Code for Timer1 – Input Capture Interrupt •
8-bit RISC Microcontroller Application Note AVR151: Setup And Use of The SPI Features Introduction
8-bit RISC Microcontroller Application Note Rev. 2585A–AVR–11/04 AVR151: Setup And Use of The SPI Features • SPI Pin Functionality • Multi Slave Systems • SPI Timing • SPI Transmission Conflicts • Emulating the SPI • Code examples for Polled operation • Code examples for Interrupt Controlled operati
AVR241: Direct driving of LCD display using general IO
AVR241: Direct driving of LCD display using general IO Features • Software driver for displays with one common line • Suitable for parts without on-chip hardware for LCD driving • Control up to 15 segments using 16 IO lines • Fully interrupt driven operation Introduction As a low power alternative t
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 0938B–AVR–01/03 AVR204: BCD Arithmetics Features • Conversion 16 Bits ↔ 5 Digits, 8 Bits ↔ 2 Digits • 2-digit Addition and Subtraction • Superb Speed and Code Density • Runable Example Program Introduction This application note lists routines for BCD arith
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2530B–AVR–01/04 AVR065: LCD Driver for the STK502 and AVR Butterfly Features • Software Driver for Alphanumeric Characters • Liquid Crystal Display (LCD) Contrast Control • Interrupt Controlled Updating • Conversion of ASCII to LCD Segment Control Codes (S
8-bit Instruction Set Instruction Set Nomenclature
8-bit Instruction Set Rev. 0856D–AVR–08/02 Instruction Set Nomenclature Status Register (SREG) SREG: Status Register C: Carry Flag Z: Zero Flag N: Negative Flag V: Two’s complement overflow indicator S: N ⊕ V, For signed tests H: Half Carry Flag T: Transfer bit used by BLD and BST instructions I: Gl
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 0933B–AVR–05/02 AVR102: Block Copy Routines Features • Program Memory (Flash) to SRAM Copy Routine • SRAM to SRAM Copy Routine • Extremely Code Efficient Routines Flash → SRAM: 6 Words, SRAM → SRAM: 5 Words • Runable Test/Example Program Introduction This
Novice’s Guide to AVR Development intended for
Novice’s Guide to AVR Development Preparing your PC for AVR Development Basic AVR Knowledge An Introduction Let's make an easy start, and download the files that we will need later on. The AVR Microcontroller family is a modern architecture, with all the bells andFirst you should download the files
AVR079: STK600 Communication Protocol
AVR079: STK600 Communication Protocol Features 8-bit • Supported Commands and Command options • Command and Answer package formats Microcontrollers 1 Introduction Application Note This document describes the STK®600 protocol. The firmware is distributed with AVR Studio® 4.14 or later. The definition
8-bit Instruction Set Instruction Set Nomenclature
8-bit Instruction Set Rev. 0856G–AVR–07/08 Instruction Set Nomenclature Status Register (SREG) SREG: Status Register C: Carry Flag Z: Zero Flag N: Negative Flag V: Two’s complement overflow indicator S: N ⊕ V, For signed tests H: Half Carry Flag T: Transfer bit used by BLD and BST instructions I: Gl
Designer’s Designing for Efficient Production Corner with In-System Re-programmable Flash µCs
Designer’s Designing for Efficient Production Corner with In-System Re-programmable Flash µCs By: OJ Svendlsi always the component where the majority of the engi- neering hours are spent. Thus, making sure the micro- For products where time-to-market and efficient pro- controller has what it takes t
AVR069: AVRISP mkII Communication Protocol
AVR069: AVRISP mkII Communication Protocol Features • General commands • ISP commands • Return values • Parameters 1 Introduction This document describes the AVRISP mkII protocol. The firmware is distributed with AVR Studio 4.12 or later. Download the latest AVR Studio from the Atmel web site, http: