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
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