ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies ATmega32A Datasheet - Sunrom Technologies

12.07.2015 Views

ATmega32A8.10 Register Description8.10.1 OSCCAL – Oscillator Calibration RegisterBit 7 6 5 4 3 2 1 0CAL7 CAL6 CAL5 CAL4 CAL3 CAL2 CAL1 CAL0 OSCCALRead/Write R/W R/W R/W R/W R/W R/W R/W R/WInitial ValueDevice Specific Calibration Value• Bits 7:0 – CAL7:0: Oscillator Calibration ValueWriting the calibration byte to this address will trim the Internal Oscillator to remove process variationsfrom the Oscillator frequency. During Reset, the 1MHz calibration value which is locatedin the signature row High Byte (address 0x00) is automatically loaded into the OSCCAL Register.If the internal RC is used at other frequencies, the calibration values must be loadedmanually. This can be done by first reading the signature row by a programmer, and then storethe calibration values in the Flash or EEPROM. Then the value can be read by software andloaded into the OSCCAL Register. When OSCCAL is zero, the lowest available frequency ischosen. Writing non-zero values to this register will increase the frequency of the Internal Oscillator.Writing $FF to the register gives the highest available frequency. The calibrated Oscillatoris used to time EEPROM and Flash access. If EEPROM or Flash is written, do not calibrate tomore than 10% above the nominal frequency. Otherwise, the EEPROM or Flash write may fail.Note that the Oscillator is intended for calibration to 1.0, 2.0z, 4.0, or 8.0MHz. Tuning to othervalues is not guaranteed, as indicated in Table 8-11.Table 8-11.OSCCAL ValueInternal RC Oscillator Frequency Range.Min Frequency in Percentage ofNominal Frequency (%)Max Frequency in Percentage ofNominal Frequency (%)$00 50 100$7F 75 150$FF 100 2008155C–AVR–02/1132

ATmega32A9. Power Management and Sleep Modes9.1 Sleep ModesSleep modes enable the application to shut down unused modules in the MCU, thereby savingpower. The AVR provides various sleep modes allowing the user to tailor the power consumptionto the application’s requirements.Figure 8-1 on page 25 presents the different clock systems in the ATmega32A, and their distribution.The figure is helpful in selecting an appropriate sleep mode. Table 9-1 shows thedifferent clock options and their wake-up sources.Table 9-1.Active Clock Domains and Wake Up Sources in the Different Sleep ModesActive Clock domains Oscillators Wake-up SourcesSleep Modeclk CPUclk FLASHclk IOclk ADCclk ASYMain ClockSource EnabledTimer OscillatorEnabledINT2INT1INT0TWI AddressMatchTimer2SPM / EEPROMReadyADCOtherI/OIdle X X X X X (2) X X X X X XADC NoiseReductionX X X X (2) X (3) X X X XPower-down X (3) XPower-save X (2) X (2) X (3) X X (2)Standby (1) X X (3) XExtendedStandby (1) X (2) X X (2) X (3) X X (2)Notes: 1. External Crystal or resonator selected as clock source.2. If AS2 bit in ASSR is set.3. Only INT2 or level interrupt INT1 and INT0.To enter any of the six sleep modes, the SE bit in MCUCR must be written to logic one and aSLEEP instruction must be executed. The SM2, SM1, and SM0 bits in the MCUCR Registerselect which sleep mode (Idle, ADC Noise Reduction, Power-down, Power-save, Standby, orExtended Standby) will be activated by the SLEEP instruction. See Table 9-2 on page 37 for asummary.If an enabled interrupt occurs while the MCU is in a sleep mode, the MCU wakes up. The MCUis then halted for four cycles in addition to the start-up time, it executes the interrupt routine, andresumes execution from the instruction following SLEEP. The contents of the Register File andSRAM are unaltered when the device wakes up from sleep. If a Reset occurs during sleepmode, the MCU wakes up and executes from the Reset Vector.9.2 Idle ModeWhen the SM2:0 bits are written to 000, the SLEEP instruction makes the MCU enter Idle mode,stopping the CPU but allowing SPI, USART, Analog Comparator, ADC, Two-wire Serial Inter-8155C–AVR–02/1133

<strong>ATmega32A</strong>8.10 Register Description8.10.1 OSCCAL – Oscillator Calibration RegisterBit 7 6 5 4 3 2 1 0CAL7 CAL6 CAL5 CAL4 CAL3 CAL2 CAL1 CAL0 OSCCALRead/Write R/W R/W R/W R/W R/W R/W R/W R/WInitial ValueDevice Specific Calibration Value• Bits 7:0 – CAL7:0: Oscillator Calibration ValueWriting the calibration byte to this address will trim the Internal Oscillator to remove process variationsfrom the Oscillator frequency. During Reset, the 1MHz calibration value which is locatedin the signature row High Byte (address 0x00) is automatically loaded into the OSCCAL Register.If the internal RC is used at other frequencies, the calibration values must be loadedmanually. This can be done by first reading the signature row by a programmer, and then storethe calibration values in the Flash or EEPROM. Then the value can be read by software andloaded into the OSCCAL Register. When OSCCAL is zero, the lowest available frequency ischosen. Writing non-zero values to this register will increase the frequency of the Internal Oscillator.Writing $FF to the register gives the highest available frequency. The calibrated Oscillatoris used to time EEPROM and Flash access. If EEPROM or Flash is written, do not calibrate tomore than 10% above the nominal frequency. Otherwise, the EEPROM or Flash write may fail.Note that the Oscillator is intended for calibration to 1.0, 2.0z, 4.0, or 8.0MHz. Tuning to othervalues is not guaranteed, as indicated in Table 8-11.Table 8-11.OSCCAL ValueInternal RC Oscillator Frequency Range.Min Frequency in Percentage ofNominal Frequency (%)Max Frequency in Percentage ofNominal Frequency (%)$00 50 100$7F 75 150$FF 100 2008155C–AVR–02/1132

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!