ATmega8 Pin Diagram
One of the most important features of ATmega8 microcontroller is that except 5 pins, all other pins can be used for supporting two signals.
- Pins 9,10,14,15,16,17,18,19 are used for port B, Whereas Pins 23,24,25,26,27,28 and 1 are used for port C and Pins 2,3,4,5,6,11,12 are used for port D.
- Pin 1 is used as Reset pin and on applying low level signal for time longer than minimum pulse length will generate a reset signal.
- Pins 3 and 2 can also be used in serial communication for USART (Universal Synchronous and Asynchronous Receiver Transmitter).
- Pin 5 and 4 are used as external interrupts.
- Pins 10 and 9 are used as timer counter oscillators as well as external oscillator where the crystal is connected directly between the pins.
- Pin 19 is used as slave clock input or master clock output for Serial Peripheral Interface (SPI) channel.
- Pin 18 is used as slave clock output or master clock input
- Pins 23 to 28 are used for analog to digital conversion (ADC) channels.
- Pin 12 and 13 are used as Analog Comparator inputs.
- Pins 6 and 11 are used as counter/timer sources.
ATmega8 Microcontroller Sleep Modes:
The Microcontroller operates in 5 sleep modes as given below:
- Power save Mode: It is used when Counter/Timer is clocked asynchronously. In general this mode used for saving the operational power requirement of microcontroller.
- Idle Mode: It stops the functioning of CPU, but allows operation of ADC, TWI, SPI, and interrupts system and Watchdog. It is achieved by setting SM0 to SM2 bits of Microcontroller Unit register flag at zero.
- Power down Mode: It enables external interrupts, the 2-wire serial interface, and watchdog while disabling the external oscillator. It stops all generated clocks.
- ADC Noise Reduction Mode: It stops the central processing unit but allows the functioning of ADC, timer/counter and external interrupts.
- Stand By mode: In this mode, only oscillator is allowed to operate by slowing all other operation of microcontroller.