Clock and Fuses. Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

Similar documents
Arduino Uno R3 INTRODUCTION

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

ATmega128. Introduction

ARDUINO MEGA INTRODUCTION

8. Power Management and Sleep Modes

Figure 1.1: Some embedded device. In this course we shall learn microcontroller and FPGA based embedded system.

AVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director

AVR Microcontrollers Architecture

AVR Training Board-I. VLSI Design Lab., Konkuk Univ. LSI Design Lab

VLSI Design Lab., Konkuk Univ. Yong Beom Cho LSI Design Lab

MICROPROCESSOR BASED SYSTEM DESIGN

AVR- M16 development board Users Manual

LBAT90USB162 Atmel. LBAT90USB162 Development Board User s Manual

The Atmel ATmega328P Microcontroller

SBAT90USB162 Atmel. SBAT90USB162 Development Board User s Manual

Doc: page 1 of 8

8051 Microcontroller

The Atmel ATmega168A Microcontroller

Mega128-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

An Arduino Controlled 1 Hz to 60 MHz Signal Generator

LAMPIRAN. Universitas Sumatera Utara

8-bit Microcontroller with 1K Bytes Flash. ATtiny10 ATtiny11 ATtiny12. Preliminary. Features. Pin Configuration

8-bit Microcontroller with 1K Byte Flash. ATtiny11. ATtiny12

Doc: page 1 of 6

XMEGA Series Of AVR Processor. Presented by: Manisha Biyani ( ) Shashank Bolia (

Hello, and welcome to this presentation of the STM32L4 power controller. The STM32L4 s power management functions and all power modes will also be

Cerebot Nano Reference Manual. Overview. Revised April 15, 2016 This manual applies to the Cerebot Nano rev. A

8-bit Microcontroller with 8K Bytes Programmable Flash AT90C8534. Preliminary

More than Compatibility

[MG2420] MCU Module Datasheet. (No. ADS0705) V1.0

MegaAVR-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

INTERRUPT, TIMER/COUNTER. KONKUK UNIV. VLSI Design Lab. LSI Design Lab

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

AVR-TLCD-128CAN development board Users Manual

Doc: page 1 of 6

3.3V regulator. JA H-bridge. Doc: page 1 of 7

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

PIC16F87X. 28/40-pin 8-Bit CMOS FLASH Microcontrollers. Devices Included in this Data Sheet: Pin Diagram PDIP. Microcontroller Core Features:

DBAT90USB162 Atmel. DBAT90USB162 Enhanced Development Board User s Manual

AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

Product Change Notification

AVR MICROCONTROLLER ARCHITECTURTE

8-bit Microcontroller with 4K Bytes In-System Programmable Flash. ATtiny40. Preliminary

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

Embedded Systems and Software

Mega128-Net Mega128-Net Mega128 AVR Boot Loader Mega128-Net

ARDUINO UNO REV3 SMD Code: A The board everybody gets started with, based on the ATmega328 (SMD).

ATxmega64D3 Automotive

ARDUINO MEGA 2560 REV3 Code: A000067

8/16-bit Atmel AVR XMEGA Microcontrollers

ATxmega384C3. 8/16-bit Atmel XMEGA C3 Microcontroller. Features

PIC Microcontroller Introduction

Building Interactive Devices and Objects. Prof. Dr. Michael Rohs, Dipl.-Inform. Sven Kratz MHCI Lab, LMU München

8/16-bit Atmel XMEGA A3U Microcontroller

AVR097: Migration between ATmega128 and ATmega1281/ATmega bit Microcontrollers. Application Note. Features. 1 Introduction

8/16-bit Atmel XMEGA B3 Microcontroller

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

Introducing STM32 L0x Series. April

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Mohammad Shaffi 1, D Ravi Nayak 2. Dadi Institute of Engineering & Technology,

8/16-bit Atmel XMEGA D4 Microcontroller

VCC PB2 (SCK/ADC1/T0/PCINT2) PB1 (MISO/AIN1/OC0B/INT0/PCINT1) PB0 (MOSI/AIN0/OC0A/PCINT0)

Hardware Manual. Crumb128. Rapid Prototyping Module with the Atmega128 AVR Microcontroller

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L

ATxmega128B3 / ATxmega64B3

ARDUINO MEGA ADK REV3 Code: A000069

AVR Microcontroller with Core Independent Peripherals and PicoPower technology

8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2323 AT90LS2323 AT90S2343 AT90S/LS2323. Features.

ARDUINO UNO REV3 Code: A000066

Let s first take a look at power consumption and its relationship to voltage and frequency. The equation for power consumption of the MCU as it

AVR FLASH MICROCONTROLLERS. Atmel Corporation

Wireless Sensor Networks. FireFly 2.2 Datasheet

Microcontroller basics

ATxmega32E5/16E5/8E5. XMEGA E5 Data Sheet. Introduction. Features

Wasp Embedded Controller

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller with 2K Bytes of Flash. ATtiny28L ATtiny28V

STM8L and STM32 L1 series. Ultra-low-power platform

8-bit Microcontroller with 2K Bytes Flash. ATtiny26 ATtiny26L. Preliminary. Features

FIFTH SEMESTER DIPLOMA EXAMINATION IN ENGINEERING/ TECHNOLOGY-MARCH 2014 EMBEDDED SYSTEMS (Common for CT,CM) [Time: 3 hours] (Maximum marks : 100)

8-bit Microcontroller with 1K Byte Flash. ATtiny15L

ARDUINO LEONARDO WITH HEADERS Code: A000057

Arduino ADK Rev.3 Board A000069

CN310 Microprocessor Systems Design

Embedded AVR Microcontroller Including RF Transmitter and Immobilizer LF Functionality for Remote Keyless Entry ATA5795. Summary.

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

keyestudio Keyestudio MEGA 2560 R3 Board

Hello, and welcome to this presentation of the STM32 Real- Time Clock. It covers the main features of this peripheral, which is used to provide a

10. Battery Backup System

Microcontroller Based Digital Clock

Driver Fatigue Detection System Using MEMS Technology

Basic Components of Digital Computer

8-bit Microcontroller with 1K Byte of In-System Programmable Flash AT90S1200

8-bit Microcontroller with 2K Bytes of In-System Programmable Flash AT90S2313

Various power connectors. 3.3V regulator. 64K Flash (Internal) 2K EEPROM (Internal) 4K SRAM (Internal) JA Mem Adr/ Data. Doc: page 1 of 9

EasyAVR6 Development System

8-bit Microcontroller with 4K Bytes of In-System Programmable Flash AT90S4433 AT90LS4433. Features. Not Recommend for New Designs. Use ATmega8.

Transcription:

Clock and Fuses Prof. Prabhat Ranjan Dhirubhai Ambani Institute of Information and Communication Technology, Gandhinagar

Reference WHY YOU NEED A CLOCK SOURCE - COLIN O FLYNN avrfreaks.net http://en.wikibooks.org/wiki/atmel_avr

Need for Clock Clock is like heartbeat for uc defining when a processor will do an instruction Normal instructions for the chip take between one to three clock cycles to complete; a clock cycle is the low-hi-low transition of the clock So the faster the clock runs, the faster the chip works However clock is not the only thing that determines the processing capability Anyway the point is that it needs something that tells the processor when it will be doing instructions (the clock)

Selecting a Clock Source External Clock Crystal Two pin ceramic resonator Three pin ceramic resonator Internal Oscillator

External Clock This one is fairly easy - all you do is to have some circuit that creates TTL compatible logic pulses, and feed those pulses into pin XTAL1 External clock could be a cesium-based atomic clock or any other source The external clock should be very clean and fall and rise times should be fast Useful for synchronizing the uc

Crystal The crystal is a very accurate and (in theory) simple way to get a clock Crystals do not change their value (much) with a changing external temperature Crystals are available in many frequencies and sizes, and needs two external 'load capacitors' to work

Two Pin Ceramic Resonator A ceramic resonator is similar to a crystal, except that it is much cheaper However as a consequence it is also not as accurate and the value can change at different temperatures An advantage is that they are less fragile than a crystal - so in high-vibration environments they can perform (fairly) well

Two Pin Ceramic Resonator... The ceramic resonator may not be accurate enough for reliable serial data transfer (using the UART), but sometimes it is (depends on quality) For reliable data transfer, a crystal is a better choice The two pin ceramic resonator needs two external 'loading capacitors'

Three Pin Ceramic Resonator The three pin ceramic resonator is similar to the two pin - except that it doesn't need the external loading capacitors as they are built in One pin of the resonator goes to ground, one to XTAL1 and one to XTAL2 (it doesn't matter which pin goes to XTAL1 or XTAL2, but the pin to ground matters!)

Internal Oscillator A few of the chips are given an internal RC oscillator The new 'Mega' series almost all have an internal oscillator This oscillator can vary from different chips, but one of the faults of them is that the frequency will change with changing voltage on VCC pin and temperature However one can often calibrate them for relative accuracy (still not near a crystal and not quite as good as a resonator) To use them one has to enable the proper fuse

Important note! Many chips have this selected by default, so even if one connects a 16 MHz crystal to AtMega128-16AC it may only be running at 1 MHz! Make sure to select the proper fuse bits if you are using a Mega series chip (as opposed to the AT90S series)

Selection Selection depends on application: If we need high accuracy, then external clock or crystal is the way to go If we need low cost, then internal oscillator or ceramic resonator is the way to go If we want the easiest solution, then internal oscillator or three pin ceramic resonator is the best choice

Clock Source Options - ATMega32

Clock Distribution in ATMega32

CPU Clock clk CPU The CPU clock is routed to parts of the system concerned with operation of the AVR core Examples of such modules are the General Purpose Register File, the Status Register and the data memory holding the Stack Pointer Halting the CPU clock inhibits the core from performing general operations and calculations

I/O Clock - clki/o I/O clock-used by majority of the I/O modules, like Timer/Counters, SPI, and USART Also used by the External Interrupt module, but note that some external interrupts are detected by asynchronous logic, allowing such interrupts to be detected even if the I/O clock is halted Address recognition in the TWI module is carried out asynchronously when clki/o is halted, enabling TWI address reception in all sleep modes.

Flash Clock The Flash clock controls operation of the Flash interface The Flash clock is usually active simultaneously with the CPU clock

Asynchronous Timer Clock The Asynchronous Timer clock allows the Asynchronous Timer/Counter to be clocked directly from an external 32 khz clock crystal The dedicated clock domain allows using this Timer/Counter as a real-time counter even when the device is in sleep mode

ADC Clock The ADC is provided with a dedicated clock domain This allows halting the CPU and I/O clocks in order to reduce noise generated by digital circuitry This gives more accurate ADC conversion results

Power Management and Sleep Modes Sleep modes enable the application to shut down unused modules in the MCU, thereby saving power The AVR provides various sleep modes allowing the user to tailor the power consumption to the application s requirements

MCU Control Register MCUCR SE Sleep Enable SM2..0 Sleep Mode

Sleep Mode Select : ATMega32

Minimizing Power Consumption There are several issues to consider when trying to minimize the power consumption in an AVR controlled system In general, sleep modes should be used as much as possible, and the sleep mode should be selected so that as few as possible of the device s functions are operating All functions not needed should be disabled In particular, the following modules may need special consideration when trying to achieve the lowest possible power consumption

If enabled, the ADC will be enabled in all sleep modes. To save power, the ADC should be disabled before entering any sleep mode When entering Idle mode, the Analog Comparator should be disabled if not used When entering ADC Noise Reduction mode, the Analog Comparator should be disabled In the other sleep modes, the Analog Comparator is automatically disabled

If the Brown-out Detector is not needed in the application, this module should be turned off Similarly most of the other blocks should be turned off or put to minimum power mode to achieve minimum power consumption

PicoPower AVR ultra-low power AVR microcontrollers, the ATmega169P and the ATmega165P Drawing as little as 650nA in clock sleep mode and 100nA in standby, these devices enable applications like ZigBee and keyless entry to perform for years on the same battery The new ultra low power technology for Atmel microcontrollers, dubbed "picopower", draws only 650nA low power run current with only the 32 KHz real time clock running

Conform to ZigBee specifications for low power operation Up to 16 MIPS performance 16 KBytes of Flash memory 512 Bytes EEPROM 1 KBytes SRAM 10-bit ADC, USART, SPI 1.8 to 5.5 volt operating voltage 340 ua in active run mode 150 ua in idle mode at 1 MHz 650 na in power-save mode with real time clock running 100 na in power-down mode Brown-out detector 4x25 segment LCD controller (ATmega169P only) 64-pin TQFP and 64-pin QFN packages

FUSE Settings A Fuse is a magical EEPROM bit that changes low level features and pin assignments Fuses are not mapped anywhere in memory, they can only be adjusted by a chip programmer Some pins have alternate functions that must be decided upon before a program can run and set control registers, those read their setting from a fuse

FUSE Settings Some famous fuses - JTAG debugging or IO Port RESET or IO Pin Anything with the oscillator/crystal Brown Out Detect (BOD) enable and BOD voltage trigger points

AVRDUDE : Fuse programming avrdude -p m128 -U flash:w:diag.hex \ > -U eeprom:w:eeprom.hex \ > -U efuse:w:0xff:m \ > -U hfuse:w:0x89:m \ > -U lfuse:w:0x2e:m