Download: 8-bit Microcontroller Application Note

8-bit Microcontroller Application Note Rev. 1259D–AVR–04/05 AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features • Real Time Clock with Very Low Power Consumption (4 µA @ 3.3V) • Very Low Cost Solution • Adjustable Prescaler to Adjust Precision • Counts Time, Date, Month, and Year with Auto Leap Year Configuration • Year 2000 Compliant Date Format • Can be Used on all AVR Controllers with RTC Module • “C”-Code for ATMega103 Inculded Introduction This application note describes how to implement a Real Time Clock (RTC) on AVR microcontrollers that features the RTC module. The impl...
Author: Walway Shared: 8/19/19
Downloads: 344 Views: 2777

Content

8-bit

Microcontroller Application Note

Rev. 1259D–AVR–04/05

AVR134: Real Time Clock (RTC) using the Asynchronous Timer Features

• Real Time Clock with Very Low Power Consumption (4 µA @ 3.3V) • Very Low Cost Solution • Adjustable Prescaler to Adjust Precision • Counts Time, Date, Month, and Year with Auto Leap Year Configuration • Year 2000 Compliant Date Format • Can be Used on all AVR Controllers with RTC Module • “C”-Code for ATMega103 Inculded

Introduction

This application note describes how to implement a Real Time Clock (RTC) on AVR microcontrollers that features the RTC module. The implementation requires only one discrete component – a 32.768 kHz watch crystal. The application has very low power consumption because the microcontroller operates in Power-save mode most of the time. In Power-save mode the AVR controller is sleeping with only a Timer running. The Timer is clocked by the external crystal. On every Timer overflow the time, date, month, and year are counted. This RTC implementation is written for the ATmega103, and can easily be ported to other AVRs with RTC Module. The advantages of imple- menting a RTC in software compared to an external hardware RTC are obvious: • Lower cost • Few external components • Lower power • Greater flexibility

Theory of Operation

The implementation of a RTC utilizes the asynchronous operation of the RTC module. In this mode, Timer/Counter0 runs independently from the CPU clock. Figure 1 shows that the AVR controller operates from the 4 MHz main clock source in normal operation. When low power operation is desired the AVR operates in Power- down mode, with only the asynchronous timer running from an external 32.768 kHz crystal. The software Real Time Clock (RTC) is is implemented using a 8-bit Timer/Counter with Overflow Interrupt. The software controls the Overflow Interrupt to count clock and calendar variables. The Timer Overflow Interrupt is used to update the software variables “second”, “minute”, “hour”, “date”, “month” and “year” at the correct intervals., Figure 1. Oscillator Connection for Real Time Clock XTAL1 4.000 MHz

R

AVR XTAL2 VCC ATmega103 TOSC2 TIMER/COUNTER0 32.768 kHz TOSC1 Because of the amount time for the Timer/Counter to complete one overflow is always the same, each of these timer variables will be incremented by a fixed number with every Timer Overflow. The Timer Overflow Interrupt routine is used to perform this task. To reduce power consumption, AVR enters Power-save mode, in which all On-chip modules are disabled except for the RTC. As shown in Table 1, the MCU typically con- sumes less than 4 µA in this mode. The device will wake-up on the Timer Overflow Interrupt. The updates of the timer variables are performed during the active period. Then the AVR re-enters the Power-save mode until the next Timer Overflow occurs. Figure 2 and Figure 3 shows the time the AVR controller operates in Power-save mode versus that Active mode. To calculate the total power consumption, the power consumption in Power-save mode must be added to the power consumption in Active mode. The time it takes to update the timer variables in the interrupt routine is less than 100 cycles, witha4MHz main clock this is 25 µs. The power consumption for this period is neglectable. More important is the wake-up period for the controller. The wake-up time can be programmed to 35 ms for use with external crystal, or 1 ms for use with ceramic resonator. An example of a cir- cuit that wake up once every second to update the RTC will show the power consumption for the two types of clock source: Figure 2. Current Figures for Crystal Oscillator, 35 ms Startup Time Current 1s 35ms Active Mode 4µA 6mA Power-save Time Total current consumption per second: = (1 sec * 4 µA) + (35 ms * 6 mA) = 4 µAs + 210 µAs = 214 µAs This shows that the dominating part of the current consumption is in Active mode. 2 AVR134,

AVR134

Figure 3. Current Figures for Ceramic Resonator, 0.5 ms Startup Time Current 1s 1 ms Active Mode µ 6mA4 A Power-save Time Total current consumption per second: = (1 sec * 4 µA) + (1 ms * 6 mA) = 4 µAs + 6 µAs = 10 µAs This shows that by reducing the startup time the current consumption is reduced from 100 µAs to 7 µAs. Table 1. Current Consumption by the AVR Controller in Each Mode Mode Typical Max Active 4 MHz, 3.3 VCC 4 mA 6.0 mA Idle 4 MHz, 3.3 VCC 1.8 mA 2.0 mA Power-down 4 MHz, 3.3 VCC < 1.0 µA 2.0 µA Power-save 4 MHz, 3.3 VCC < 4.0 µA 6.0 µA

Calculation Given the frequency of the watch crystal, the user can determine the time for each tick in

the Timer/Counter by selecting the desired prescale factor. As shown in Table 2, CS02, CS01, and CS00 in the TCCR0 (Timer/Counter0 Control Register) define the prescaling source of the Timer/Counter, where CK is the frequency of the watch crystal. For exam- ple, if CK equals 32.768 kHz, the Timer/Counter will tick at a frequency of 256 Hz with a prescaler of CK/128. Table 2. Timer/Counter0 Prescale Select CS02 CS01 CS00 Description(1) Overflow Period000Timer/Counter0 is stopped – 001CK 1/64s010CK/8 1/8s011CK/32 1/4s100CK/64 1/2s101CK/128 1s110CK/256 2s111CK/1024 8s Note: 1. CK = 32.768 kHz,

Configuration As shown in Figure 1, the crystal should be connected directly between pins TOSC1 Example and TOSC2. Note that some low voltage devices require external capacitors on these

pins. The Oscillator is optimized for use with a 32.768 kHz watch crystal, or an external clock signal in the interval of 0 Hz - 256 kHz. In this example, the eight LEDs in port B are used to display the RTC. The LED on Port B pin 0 will change state every second. The next six LEDs represents the minute in binary, and the LED on pin 7 stays on for one hour and off for the next. Considerations should be taken when clocking the Timer/Counter from an asynchro- nous clock source. A 32.768 kHz crystal have a stabilization time up to one second after Power-up. The controller must therefore not enter Power-save mode less than a second after Power-up. Care must be taken when changing to asynchronous operation. See the data sheet for detailed instructions. When updating the Timer Register the data is trans- ferred to a temporary register and latched after two external clock cycles. The Asynchronous Status Register (ASSR) contains status flags that can be checked to con- trol that the written register is updated.

Implementation The software consists of two subroutines. “counter” is the Timer/Counter Overflow ser-

vice routine, which updates all the timer variables whenever a Timer Overflow occurs. The other one, “not_leap”, corrects the date for leap years. The main program sets up all the necessary I/O Registers to enable the RTC module and controls the Power-down sequence. The AS0 bit in the ASSR (Asynchronous Status Register) is set to configure Timer/Counter0 to be clocked from an external clock source. Only this timer can perform asynchronous operations. The start value for the Timer is Reset and the desired pres- caler value is selected. To synchronize with the external clock signal the program wait for the ASSR Register to be updated. TOIE0 bit in the TIMSK (Timer/Counter Interrupt Mask Register) is then set to enable Timer/Counter0 Overflow Interrupt. The Global Interrupt Enable bit in SREG (Status Register) also has to be set to enable all interrupts. SM1 and SM0 bit in MCUCR (MCU Control Register) are set to select Power-save mode. The SLEEP instruction will then place the controller. in sleep mode. A loop in the main program executes the SLEEP instruction. 4 AVR134,

AVR134

“counter” Overflow The interrupt routine is executed every time a Timer Overflow occurs. It wakes up the

Interrupt Routine MCU to update the timer variables. An interrupt procedure cannot return or accept any

variables. A global structure with timer variables are declared to keep track of time: “second”, “minute”, “hour”, “date”, “month” and “year”. Since the time required to com- plete one Timer Overflow is known, “second” will be incremented by a fixed number every time. Once it reaches 60, “minute” is incremented by “1” and “second” is set to “0”. Figure 4. Flow Chart, CounterInterrupt Routine CounterABN++ Second =60? Y Date = 32?

Y N

Minute=Minute +1 Second = 0 Y Date = 31 & Month = 4,6,9,11?

N

Minute = 60? NYYDate = 30? Hour = Hour +1 Minute = 0 N

Y

N Date = 29? Hour = 24?

N Y

Month=2 N Date = Date +1 and Not_Leap Hour = 0

Y

Month = Month +1 Date=1AB

N

Month = 13?

Y

Year = Year +1 Month=1 Return, “not_leap” This routine checks whether or not it is a leap year. It returns true if the year is not leap

Subroutine and false for leap. It is considered a leap year if both of the following conditions are

satisfied: 1. The year is divisible by 4, and 2. If the year is divisible by 100, it also has to be divisible by 400.

Accuracy The RTC on the AVR controller maintains high accuracy as long as the watch crystal is

accurate. Asynchronous operation allows the Timer to run without any delays even when the CPU is under heavy computation. However, a small neglible discrepancy does occur because the timer variables are not updated in parallel. By the time they are fin- ished updating, they deviate from the Timer/Counter very slightly. The largest discrepancy occurs when all the timer variables are overflowed. At this moment, “sec- ond” is 59, “minute” is 59, “hour” is 23, and so on. It takes 94 cycles for the MCU to complete the update. Ata4MHz CPU clock, the error between the RTC and the watch crystal will not exceed 23.5 µs found by 94/(4 * 106). A typical error should be 6 µs since 24 cycles are needed to update “second”. This error does not accumulate since the Timer is always synchronous with the watch crystal. Figure 5. Flow Chart not_leap

N

Year Divisable by 100?

Y

Return Year/400 Return Year/4 6 AVR134,

AVR134 Resources

Table 3. CPU and Memory Usage Code Size Example Function (Bytes) Cycles Register Interrupt Description main 104 – R16 Timer0 Overflow Sets the necessary configuration counter 356 – R16, R17, – Updates the R30, R31 variables not_leap 48 10 (typical) R16, R17, – Checks for leap R20, R21 year Total 508 – – Table 4. Peripheral Usage Peripheral Description Interrupts Enabled TOSC1, TOSC2 connected to external crystal – Timer/counter0 real-time clock Timer/counter0 overflow 8 I/O pins on port B flashing LEDs (example only) –,

Code /**** AVRAPPLICATIONNOTE134

************************** * * Title: Real-Time Clock * Version: 1.01 * Last Updated: 12.10.98 * Target: ATmega103 (All AVR Devices with secondary external oscillator) * Support E-mail: email is hidden * * Description * This application note shows how to implement a Real-Time Clock utilizing a * secondary external oscilator. Included a test program that performs this * function, which keeps track of time, date, month, and year with auto * leap-year configuration. 8 LEDs are used to display the RTC. The 1st LED * flashes every second, the next six represents the minute, and the 8th LED * represents the hour. * ******************************************************************** **********************/ #include #include char not_leap(void); type def struct{ unsigned char second; //enter the current time, date, month, and //year unsigned char minute; unsigned char hour; unsigned char date; unsigned char month; unsigned int year; }time; time t; void C_task main(void) //C_task means "main" is never called from //another function { 8 AVR134,

AVR134

int temp0,temp1; for(temp0=0;temp0<0x0040;temp0++)// Wait for external clock crystal to //stabilize { for(temp1=0;temp1<0xFFFF;temp1++); } DDRB=0xFF; TIMSK &=~((1<AVR134 if (!(t.year%100)) return (char)(t.year%400); else return (char)(t.year%4); },

Atmel Corporation Atmel Operations

2325 Orchard Parkway Memory RF/Automotive

San Jose, CA 95131, USA 2325 Orchard Parkway Theresienstrasse 2 Tel: 1(408) 441-0311 San Jose, CA 95131, USA Postfach 3535 Fax: 1(408) 487-2600 Tel: 1(408) 441-0311 74025 Heilbronn, Germany Fax: 1(408) 436-4314 Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340 Regional Headquarters Microcontrollers Europe 2325 Orchard Parkway 1150 East Cheyenne Mtn. Blvd. Atmel Sarl San Jose, CA 95131, USA Colorado Springs, CO 80906, USA Route des Arsenaux 41 Tel: 1(408) 441-0311 Tel: 1(719) 576-3300 Case Postale 80 Fax: 1(408) 436-4314 Fax: 1(719) 540-1759 CH-1705 Fribourg Switzerland La Chantrerie Biometrics/Imaging/Hi-Rel MPU/ Tel: (41) 26-426-5555 BP 70602 High Speed Converters/RF Datacom Fax: (41) 26-426-5500 44306 Nantes Cedex 3, France Avenue de Rochepleine Tel: (33) 2-40-18-18-18 BP 123 Asia Fax: (33) 2-40-18-19-60 38521 Saint-Egreve Cedex, France Room 1219 Tel: (33) 4-76-58-30-00 Chinachem Golden Plaza ASIC/ASSP/Smart Cards Fax: (33) 4-76-58-34-80

77 Mody Road Tsimshatsui Zone Industrielle

East Kowloon 13106 Rousset Cedex, France Hong Kong Tel: (33) 4-42-53-60-00 Tel: (852) 2721-9778 Fax: (33) 4-42-53-60-01 Fax: (852) 2722-1369

1150 East Cheyenne Mtn. Blvd.

Japan Colorado Springs, CO 80906, USA

9F, Tonetsu Shinkawa Bldg. Tel: 1(719) 576-3300 1-24-8 Shinkawa Fax: 1(719) 540-1759

Chuo-ku, Tokyo 104-0033 Japan Scottish Enterprise Technology Park Tel: (81) 3-3523-3551 Maxwell Building Fax: (81) 3-3523-7581 East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 Literature Requests

www.atmel.com/literature Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL’S TERMS AND CONDI- TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDEN- TAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. © Atmel Corporation 2005. All rights reserved. Atmel®, logo and combinations thereof, AVR®, and AVR Studio® are registered trademarks, and Everywhere You AreSM are the trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. Printed on recycled paper.]
15

Similar documents

  Wiring Diagram
Wiring Diagram Samsung Electronics 6-1
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 Conta
  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