Atmel's tinyAVR Microcontrollers

The tinyAVR series of microcontrollers comes in many flavors now. The number of input/output (I/O) pins ranges from 4 in the smallest series, ATtiny4/5/9/10, to 28 in ATtiny48/88. Some packages of ATtiny48/88 series have 24 I/O pins only. A widely used device is ATtinyl3, which has a total of eight pins, with two mandatory pins for power supply, leaving you with six I/O pins. That doesn't sound like much, but it turns out that a lot can be done even with these six I/O pins, even without having to use additional I/O expansion circuits.

From the table of tinyAVR devices presented later in this chapter, we have selected ATtinyl3, ATtiny25/45/85, and ATtiny261/461/861 for most of the projects. They represent the entire spectrum of Tiny devices. All of these devices have an onchip static random access memory (SRAM), an important requisite for programming these chips using C. Tiny 13 has just IK of program memory, while Tiny 861 and Tiny 85 have 8K. Tiny 13 and Tiny25/45/85 are pin-compatible, but the devices of latter series have more memory and features. Whenever the code doesn't fit in Tinyl3, it can be replaced with Tiny25/45/85, depending on memory requirements.


The projects that are planned for this book have a distinguishing feature: Almost all of them have fascinating visual appeal in the form of large LED-based displays. A new technique of interfacing a large number of LEDs using a relatively small number of I/O pins, called Charlieplexing, makes it possible to interface up to 20 LEDs using just five I/O pins. This technique has been used to create appealing graphical displays or to add a seven-segment type of readout to the projects. Other projects that do not have LED displays feature graphical LCDs.

Each project can be built over a weekend and can be used gainfully in the form of a toy or an instrument.

tinyAVR Devices

tinyAVR devices vary from one another in several ways, such as the number of I/O pins, memory sizes, package type like dual in-line package (DIP), small outline integrated circuit (SOIC) or micro lead frame (MLF), peripheral features, communication interfaces, etc. Figure 1-1 shows some tinyAVRs in DIP packaging, while Figure 1-2 shows some tinyAVRs in surface mount device (SMD) SOIC packaging. The complete list


of these devices is highly dynamic, as Atmel keeps adding newer devices to replace the older ones regularly. The latest changes can always be tracked on www.avrgenius.com/tinyavrl.

Most of these devices are organized in such a way that each member of the series varies from the others only in a few features, like memory size, etc. Some major series and devices of the tinyAVR family that are the main focus of this book have been summarized in Table 1 - 1 , and are shown in Figures 1-1 and 1-2.

If you see the datasheet of any device and find that its name is suffixed by "A," it implies that it belongs to the picoPower technology AVR microcontroller class and incorporates features to reduce the power consumption on the go.

tinyAVR Architecture

This section deals with the internal details of the Tiny devices. It may be noted that this section follows a generic approach to summarize the common features of the Tiny series. Certain
features may be missing from some devices, while some additional ones may be present. For more information on these features, refer to the datasheet of the individual devices.



Memory

The AVR architecture has two main memory spaces: the data memory and the program memory space. In addition, these devices feature an electrically erasable programmable read-only memory (EEPROM) memory for data storage. The Flash program memory is organized as a linear array of 16-bit-wide locations because all the AVR instructions are either 16 bits or 32 bits wide. The internal memory SRAM uses the same address space as that used by register file and I/O registers. The lowermost 32 addresses are taken by registers, the next 64 locations are taken by I/O registers, and then the SRAM addressing continues from location 0x60. The internal EEPROM is used for temporary nonvolatile data storage. The following illustration shows the memory map of Tiny controllers

I/O Ports

Input/Output (I/O) ports of AVR devices are comprised of individual I/O pins, which can be configured individually for either input or output. Apart from this, when the pin is declared as an input, there is an option to enable or disable the pull-up on it. Enabling the pull-up is necessary to read the sensors that don't give an electrical signal, like microswitches. Each output buffer has a sink and source capability of 40mA. So, the pin driver is strong enough to drive LED displays directly. All I/O pins also have protection diodes to both VCC and Ground. The following illustration shows the block diagram of the AVR I/O ports.



Timers


tinyAVR devices generally have eight-bit timers that can be clocked either synchronously or asynchronously. The synchronous clock sources include the device clock or its factors (the clock divided by a suitable prescaler), whereas asynchronous clock sources include the external clock or phase lock loop (PLL) clock, which goes up to 64 MHz. Some devices also include 10-bit or 16-bit timers. Besides counting, these timers also have compare units, which generate pulse width modulation on I/O pins. These timers can be run in various modes, like normal mode, capture mode, pulse width modulation (pwm) mode, clear timer on compare match, etc. Each timer has several interrupt sources associated with it, which are described in the next section on interrupts. The following illustration shows the block diagram of the AVR timer.




source : https://archive.org/details/TinyavrMicrocontrollerProjectsForTheEvilGenius.pdf/page/n23/mode/2up?view=theater


No comments:

Post a Comment