AVR Microcontroller (Atmega32) – An Introduction

Mathew Kevin August 14, 2017 12 Comments

Hi all, We are introducing you to a new author Rakesh Bute today. Rakesh is an engineering student in the stream of Applied Electronics and Instrumentation from Asansol Engineering College.  He will be writing a series of articles about AVR micro controllers, which later will be combined to form as a tutorial of the same.

Introduction to ATmega32 (AVR Series) 8bit Microcontroller

In our days, there have been many advancement in the field of Electronics and many cutting edge technologies are being  developed every day, but still 8 bit microcontrollers have its own role in the digital electronics market dominated by 16-32 & 64 bit digital devices. Although powerful microcontrollers with higher processing capabilities exist in the market, 8bit microcontrollers still hold its value because of their easy-to-understand-operation, very much high popularity, ability to simplify a digital circuit, low cost compared to features offered, addition of many new features in a single IC and interest of manufacturers and consumers.

Today’s microcontrollers are much different from what it were in the initial stage, and the number of manufacturers are much more in count than it was a decade or two ago. At present some of the major manufacturers are Microchip (publication: PIC microcontrollers), Atmel (publication: AVR microcontrollers), Hitachi, Phillips, Maxim, NXP, Intel etc.  Our interest is upon ATmega32. It belongs to Atmel’s AVR series micro controller family. Let’s see the features.

PIN count: Atmega32 has got 40 pins. Two for Power (pin no.10: +5v, pin no. 11: ground), two for oscillator (pin 12, 13), one for reset (pin 9), three for providing necessary power and reference voltage to its internal ADC, and 32 (4×8) I/O pins.

About I/O pins: ATmega32 is capable of handling analogue inputs. Port A can be used as either DIGITAL I/O Lines or each individual pin can be used as a single input channel to the internal ADC of ATmega32, plus a pair of pins AREF, AVCC & GND (refer to ATmega32 datasheet) together can make an ADC channel.

No pins can perform and serve for two purposes (for an example: Port A pins cannot work as a Digital I/O pin while the Internal ADC is activated) at the same time. It’s the programmers responsibility to resolve the conflict in the circuitry and the program. Programmers are advised to have a look to the priority tables and the internal configuration from the datasheet.

Digital I/O pins: ATmega32 has 32 pins (4portsx8pins) configurable as Digital I/O pins.

Timers: 3 Inbuilt timer/counters, two 8 bit (timer0, timer2) and one 16 bit (timer1).

ADC: It has one successive approximation type ADC in which total 8 single channels are selectable. They can also be used as 7 (for TQFP packages) or 2 (for DIP packages) differential channels. Reference is selectable, either an external reference can be used or the internal 2.56V reference can be brought into action.  There external reference can be connected to the AREF pin.

Communication Options:  ATmega32 has three data transfer modules embedded in it. They are

  • Two  Wire Interface
  • USART
  • Serial Peripheral Interface

Atmega32 pin diagram

Atmega32 pin diagram

Atmega32 pin diagram

 

Analog comparator:  On-chip analog comparator is available. An interrupt is assigned for different comparison result obtained from the inputs.

External Interrupt: 3External interrupt is accepted. Interrupt sense is configurable.

Memory:  It has 32Kbytes of In-System Self-programmable Flash program memory, 1024 Bytes EEPROM, 2Kbytes Internal SRAM. Write/Erase Cycles: 10,000 Flash / 100,000 EEPROM.

Clock: It can run at a frequency from 1 to 16 MHz. Frequency can be obtained from external Quartz Crystal, Ceramic crystal or an R-C network. Internal calibrated RC oscillator can also be used.

More Features: Up to 16 MIPS throughput at 16MHz. Most of the instruction executes in a single cycle. Two cycle on-chip multiplication. 32 × 8 General Purpose Working Registers

Debug: JTAG boundary scan facilitates on chip debug.

Programming: Atmega32 can be programmed either by In-System Programming via Serial peripheral interface or by Parallel programming. Programming via JTAG interface is also possible. Programmer must ensure that SPI programming and JTAG are not be disabled using  fuse bits; if the programming is supposed to be done using SPI or JTAG.

Atmega32 block diagram

Atmega32 block diagram

 

Comments
  • NEHA
    July 13, 2016

    Do we have to do something to make the pin no 28(A5) analog if working with only IC atmega 328?
    or is it already analog? as it is showing constantly 5v in my IC.
    please help.

  • Shreyansh
    January 7, 2016

    good work,thank you,was very helpful

  • vineela
    March 23, 2013

    we want clear explanation of pin description.

  • edwin jacob daniel
    February 17, 2013

    our batch includes Athul, PK, ashwin, Anoop.. but aarum onnum padikkunnilla.. njangal enth cheiyyum.. we are waiting 4 ur reply.. pettenn para

  • edwin jacob daniel
    February 17, 2013

    my name was inserted wrong.. this is the correct name.

  • edwinb jacob daniel
    February 17, 2013

    very glad to `view your website which gives a very clear information.. but please give some basic information about each topic also.. thank you..

  • PANKAJ KUMAR SINGH
    December 9, 2012

    Sir, this is a great work on electronics!!! This is the best site for a beginner to start with. It has every thing that we need…… thanks for your effort!!

  • rowan walters
    September 30, 2012

    thanks im saving all this

    • rakesh
      September 30, 2012

      Thank you Rowan. All my articles on AVR are intended for beginners. I hope this would take you through the first steps. But I will be longing to see you go beyond what I’ve done.
      Reguards
      Rakesh Bute

  • Rakesh
    January 8, 2012

    Readers, The Pin diagram given in the picture is applicable for both ATmega32 and ATmega16.

  • PRASANTA KARMAKAR
    January 7, 2012

    Really commendable piece of work…… 🙂
    And helpful to all students like us……. 🙂

    Thank you bro … 🙂

  • Esam
    January 7, 2012

    I really do appreciate your efforts .. big thanks 🙂

Leave a Reply to edwin jacob daniel Cancel reply

Your email address will not be published. Required fields are marked *