ATmega32A Datasheet - Sunrom Technologies
ATmega32A Datasheet - Sunrom Technologies ATmega32A Datasheet - Sunrom Technologies
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
- Page 3 and 4: ATmega32A2. OverviewThe Atmel ® AV
- Page 5: ATmega32Ametrical drive characteris
- Page 9 and 10: ATmega32A6.3.1 SREG - AVR Status Re
- Page 11 and 12: ATmega32A6.4.1 The X-register, Y-re
- Page 13 and 14: ATmega32AFigure 6-5.Single Cycle AL
- Page 15: ATmega32AA return from an interrupt
- Page 18 and 19: ATmega32AFigure 7-2.Data Memory Map
- Page 20 and 21: ATmega32AEEPROM data corruption can
- Page 22 and 23: ATmega32ASupport - Read-While-Write
- Page 24 and 25: ATmega32AThe next code examples sho
- Page 26 and 27: ATmega32A8.1.3 Flash Clock - clk FL
- Page 28 and 29: ATmega32AThe CKSEL0 Fuse together w
- Page 30 and 31: ATmega32A8.7 Calibrated Internal RC
- Page 34 and 35: ATmega32Aface, Timer/Counters, Watc
- Page 36 and 37: ATmega32A9.8.4 Internal Voltage Ref
- Page 38 and 39: ATmega32A10. System Control and Res
- Page 40 and 41: ATmega32AFigure 10-3.MCU Start-up,
- Page 42 and 43: ATmega32AADC is used. To reduce pow
- Page 44 and 45: ATmega32AThe WDP2, WDP1, and WDP0 b
- Page 46 and 47: ATmega32Athe case if the Reset Vect
- Page 48 and 49: ATmega32A$382D out SPL,r16$382E sei
- Page 50 and 51: ATmega32A12. I/O Ports12.1 Overview
- Page 52 and 53: ATmega32AIf PORTxn is written logic
- Page 54 and 55: ATmega32AThe following code example
- Page 56 and 57: ATmega32AFigure 12-5. Alternate Por
- Page 58 and 59: ATmega32ATable 12-3.Table 12-4 and
- Page 60 and 61: ATmega32A• MOSI - Port B, Bit 5MO
- Page 62 and 63: ATmega32A12.3.3 Alternate Functions
- Page 64 and 65: ATmega32ATable 12-11. Overriding Si
- Page 66 and 67: ATmega32A12.4 Register Description1
- Page 68 and 69: ATmega32A12.4.13 PIND - Port D Inpu
- Page 70 and 71: ATmega32Alow level interrupt is sel
- Page 73 and 74: ATmega32A14. 8-bit Timer/Counter0 w
- Page 75 and 76: ATmega32ASignal description (intern
- Page 77 and 78: ATmega32Athe OCR0 value, the compar
- Page 79 and 80: ATmega32AFigure 14-5.CTC Mode, Timi
- Page 81 and 82: ATmega32AThe PWM resolution for the
<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