ATTINY45-20PU Microcontroller

5,000 د.ع

Source reliable, high-performance microcontrollers for your embedded projects with the ATTINY45-20PU, an original integrated circuit from Microchip Technology. This compact 8-bit AVR microcontroller is renowned for its small footprint, low power consumption, and versatile feature set, making it an ideal choice for compact electronics, wearable devices, sensor interfaces, and battery-powered applications. The ATTINY45-20PU offers a perfect balance of performance and simplicity for projects where space is at a premium.

In stock

Compare
SKU: DIYS10847 Category:

Description

ATTINY45-20PU Original Microcontroller – 8-bit AVR IC with 4KB Flash Memory

Source reliable, high-performance microcontrollers for your embedded projects with the ATTINY45-20PU, an original integrated circuit from Microchip Technology. This compact 8-bit AVR microcontroller is renowned for its small footprint, low power consumption, and versatile feature set, making it an ideal choice for compact electronics, wearable devices, sensor interfaces, and battery-powered applications. The ATTINY45-20PU offers a perfect balance of performance and simplicity for projects where space is at a premium.

The ATTINY45-20PU features 4KB of in-system programmable flash memory, 256 bytes of SRAM, and 256 bytes of EEPROM, providing essential memory resources for small to medium-scale embedded applications. Operating at speeds up to 20 MHz, this microcontroller delivers responsive performance for real-time control tasks, including PWM generation, analog signal reading, and communication protocol implementation. The device supports a wide operating voltage range of 2.7V to 5.5V, making it suitable for both battery-powered portable devices and industrial control systems.

With 6 general-purpose I/O pins, a 4-channel 10-bit analog-to-digital converter, two 8-bit timers, and support for USI (Universal Serial Interface), the ATTINY45-20PU packs substantial functionality into its compact 8-pin DIP package. This makes it an excellent choice for simple automation tasks, LED lighting effects, motor control, sensor reading, and countless other DIY electronics projects.

Key Features

High-Performance AVR RISC Architecture

Features an advanced AVR RISC architecture with 120 powerful instructions, most of which execute in a single clock cycle, delivering up to 20 MIPS throughput at 20 MHz for efficient program execution.

4KB In-System Programmable Flash

Provides 4KB of flash memory for program storage with read-while-write capabilities, supporting up to 10,000 write/erase cycles for reliable long-term use.

Low Power Consumption

Optimized for battery-powered applications with multiple power-saving sleep modes, consuming as little as 0.1µA in power-down sleep mode.

4-Channel 10-bit ADC

Integrated 4-channel, 10-bit analog-to-digital converter enables direct connection to analog sensors, potentiometers, and other analog signal sources without external components.

6 General-Purpose I/O Pins

Features 6 programmable I/O lines with high current sink/source capability (40mA per pin) for direct driving of LEDs, small relays, and other peripherals.

Universal Serial Interface (USI)

Built-in USI supports multi-purpose communication including SPI and I2C (TWI) protocols, enabling easy connection to sensors, memory chips, and other peripherals.

Two 8-bit Timers/Counters

Includes two 8-bit timers/counters with separate prescaler and PWM capability, ideal for generating precise timing signals and analog-style outputs.

Internal and External Oscillator Options

Features a calibrated internal RC oscillator (8 MHz) with selectable frequencies, plus support for external crystal or ceramic resonators for precision timing.

Wide Operating Voltage Range

Operates from 2.7V to 5.5V DC, making it compatible with both 3.3V and 5V systems, as well as battery-powered applications using 2x AA or single Li-Ion cells.

DIP-8 Package for Easy Prototyping

Standard 8-pin DIP (Dual In-line Package) with 2.54mm pin spacing allows for easy breadboarding, through-hole PCB mounting, and manual soldering.

DebugWIRE On-chip Debug System

Built-in DebugWIRE interface enables real-time debugging and program downloading using a single wire, simplifying development and troubleshooting.

Specifications

Parameter Value
Manufacturer Microchip Technology (formerly Atmel)
Part Number ATTINY45-20PU
Core Architecture 8-bit AVR RISC
Clock Speed Up to 20 MHz
Flash Memory 4 KB
SRAM 256 bytes
EEPROM 256 bytes
I/O Pins 6
ADC Channels 4 (10-bit)
Timers 2 x 8-bit (with PWM)
Communication Interfaces USI (SPI, I2C compatible)
Operating Voltage 2.7V – 5.5V DC
Power Consumption (Active) 6mA typical at 5V, 4MHz
Power Consumption (Power-down) 0.1µA typical
Flash Endurance 10,000 write/erase cycles
EEPROM Endurance 100,000 write/erase cycles
Package Type PDIP-8 (Plastic Dual In-line)
Pin Pitch 2.54mm (0.1 inch)
Operating Temperature -40°C to +85°C (Industrial grade)
Programming Interface ISP (In-System Programming), DebugWIRE
RoHS Compliant Yes

Pin Configuration

Pin Name Function Alternate Functions
1 PB5 Digital I/O RESET (programming), ADC0
2 PB3 Digital I/O ADC3, ~RESET (debugWire)
3 PB4 Digital I/O ADC2
4 GND Ground Power supply ground
5 PB0 Digital I/O MOSI (ISP), SDA (USI), AIN0
6 PB1 Digital I/O MISO (ISP), AIN1, OC1A (PWM)
7 PB2 Digital I/O SCK (ISP), USCK (USI), T0
8 VCC Power Supply 2.7V – 5.5V DC

Wiring Diagram

Basic Power Connection

text
Power Supply (3.3V/5V) -----> VCC (Pin 8)
                          -----> GND (Pin 4)

ISP Programming Connection (using USBasp or similar)

text
ATTINY45                    ISP Programmer
---------                   -------------
PB5 (Pin 1) -----> RESET
PB0 (Pin 5) -----> MOSI
PB1 (Pin 6) -----> MISO
PB2 (Pin 7) -----> SCK
VCC (Pin 8) -----> VCC
GND (Pin 4) -----> GND

Simple LED Blink Circuit

text
ATTINY45                    External Components
---------                   -------------------
PB0 (Pin 5) -----> 220Ω Resistor -----> LED (+) -----> LED (-) -----> GND
VCC (Pin 8) -----> +5V
GND (Pin 4) -----> GND

Arduino IDE Setup (using Arduino as ISP)

Step 1: Install ATTiny Core

  1. Open Arduino IDE

  2. Go to File > Preferences

  3. Add the following URL to “Additional Boards Manager URLs”:
    https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

  4. Open Tools > Board > Boards Manager

  5. Search for “ATTiny” and install the “ATTiny” core by David A. Mellis

Step 2: Select Board Configuration

  • Select ATtiny25/45/85 (No bootloader) from the Boards menu

  • Select Processor: ATtiny45

  • Select Clock: External 20MHz (for 20PU version with external crystal)

  • Or Clock: Internal 8MHz (for internal oscillator operation)

Step 3: Program Using Arduino as ISP

  1. Upload the “ArduinoISP” sketch to an Arduino Uno

  2. Wire the ATTiny45 to the Arduino Uno according to the ISP wiring diagram

  3. Select Programmer: Arduino as ISP

  4. Select Tools > Burn Bootloader (to set fuses, optional)

  5. Click Upload to program the ATTiny45

Arduino Code Example

cpp
// Simple LED Blink Example for ATTINY45

const int ledPin = 0;  // PB0 (Pin 5 on DIP-8)

void setup() {
  pinMode(ledPin, OUTPUT);
}

void loop() {
  digitalWrite(ledPin, HIGH);
  delay(500);
  digitalWrite(ledPin, LOW);
  delay(500);
}

Arduino Code Example (Analog Input with PWM Output)

cpp
// Read potentiometer on PB2 (ADC1) and output PWM on PB1 (OC1A)

const int analogPin = 2;  // PB2 (Pin 7) - ADC1
const int pwmPin = 1;     // PB1 (Pin 6) - OC1A

void setup() {
  pinMode(pwmPin, OUTPUT);
}

void loop() {
  int sensorValue = analogRead(analogPin);
  int pwmValue = map(sensorValue, 0, 1023, 0, 255);
  analogWrite(pwmPin, pwmValue);
  delay(10);
}

AVR C Code Example (Without Arduino)

c
#define F_CPU 8000000UL  // 8 MHz internal clock
#include <avr/io.h>
#include <util/delay.h>

int main(void) {
    // Set PB0 (Pin 5) as output
    DDRB |= (1 << PB0);
    
    while(1) {
        PORTB |= (1 << PB0);   // LED ON
        _delay_ms(500);
        PORTB &= ~(1 << PB0);  // LED OFF
        _delay_ms(500);
    }
    return 0;
}

Pin Functions Overview

Pin Primary Function ADC Channel ISP / Debug PWM
PB0 Digital I/O MOSI
PB1 Digital I/O MISO OC1A
PB2 Digital I/O SCK T0
PB3 Digital I/O ADC3
PB4 Digital I/O ADC2
PB5 Digital I/O ADC0 RESET

Common Applications

  • LED lighting effects and controllers

  • Small motor and servo control

  • Battery-powered sensor nodes

  • Wearable electronics and e-textiles

  • Simple automation tasks

  • PWM signal generation

  • Capacitive touch sensing

  • IR remote control transmitters/receivers

  • Small game controllers and input devices

  • Educational AVR programming projects

  • Low-cost embedded systems

  • Toy and hobby electronics

Important Usage Notes

  • For external clock operation at 20MHz, connect a 20MHz crystal between PB3 and PB4 with appropriate capacitors

  • When using internal oscillator, the maximum stable frequency is 8MHz; operation at 20MHz requires external crystal

  • The DebugWIRE interface uses the PB3 pin; avoid using this pin for other functions when debugging

  • For ISP programming, the RESET pin (PB5) is used; ensure no external pull-ups interfere with programming

  • The device can operate down to 1.8V at lower frequencies (check datasheet for detailed specifications)

  • Fuse settings control clock source, startup time, and other device configurations; incorrect fuse settings can lock the device

Package Contents

  • 1 x ATTINY45-20PU Original Microcontroller IC

متحكم ATTINY45-20PU أصلي – دائرة متكاملة AVR 8 بت بذاكرة فلاش 4 كيلوبايت

قم بتوفير متحكمات دقيقة عالية الأداء وموثوقة لمشاريعك المدمجة باستخدام ATTINY45-20PU، وهي دائرة متكاملة أصلية من Microchip Technology. تشتهر هذه الدائرة المصغرة 8 بت AVR بمساحتها الصغيرة واستهلاكها المنخفض للطاقة ومجموعة ميزاتها المتعددة الاستخدامات، مما يجعلها خيارًا مثاليًا للإلكترونيات المدمجة والأجهزة القابلة للارتداء وواجهات الاستشعار والتطبيقات التي تعمل بالبطارية. يقدم ATTINY45-20PU توازنًا مثاليًا بين الأداء والبساطة للمشاريع حيث المساحة محدودة.

يتميز ATTINY45-20PU بذاكرة فلاش قابلة للبرمجة داخل النظام بسعة 4 كيلوبايت و 256 بايت من ذاكرة الوصول العشوائي و 256 بايت من ذاكرة EEPROM، مما يوفر موارد ذاكرة أساسية للتطبيقات المدمجة صغيرة إلى متوسطة الحجم. يعمل بسرعات تصل إلى 20 ميجاهرتز، ويقدم هذا المتحكم أداءً سريع الاستجابة لمهام التحكم في الوقت الفعلي. يدعم الجهاز نطاق جهد تشغيل واسع من 2.7V إلى 5.5V، مما يجعله مناسبًا لكل من الأجهزة المحمولة التي تعمل بالبطارية وأنظمة التحكم الصناعية.

مع 6 دبابيس إدخال/إخراج للأغراض العامة، ومحول تماثلي رقمي 10 بت بـ 4 قنوات، ومؤقتين 8 بت، ودعم لواجهة التسلسل العالمية، يضع ATTINY45-20PU وظائف كبيرة في حزمة DIP-8 المدمجة. هذا يجعله خيارًا ممتازًا لمهام الأتمتة البسيطة وتأثيرات إضاءة LED والتحكم في المحركات وقراءة أجهزة الاستشعار والعديد من مشاريع الإلكترونيات DIY الأخرى.

المميزات الرئيسية

بنية AVR RISC عالية الأداء

يتميز بهندسة AVR RISC متقدمة مع 120 تعليمات قوية، معظمها يتم تنفيذها في دورة ساعة واحدة، مما يوفر إنتاجية تصل إلى 20 MIPS عند 20 ميجاهرتز لتنفيذ تعليمات برمجية فعالة.

ذاكرة فلاش قابلة للبرمجة داخل النظام بسعة 4 كيلوبايت

يوفر 4 كيلوبايت من ذاكرة الفلاش لتخزين البرامج مع قدرات القراءة أثناء الكتابة، ويدعم ما يصل إلى 10,000 دورة كتابة/مسح للاستخدام الموثوق طويل الأمد.

استهلاك طاقة منخفض

محسن للتطبيقات التي تعمل بالبطارية مع أوضاع سكون متعددة لتوفير الطاقة، حيث يستهلك 0.1 ميكروأمبير فقط في وضع السكون الكامل.

ADC 10 بت بـ 4 قنوات

يتيح محول تماثلي رقمي 10 بت مدمج بـ 4 قنوات اتصالًا مباشرًا بأجهزة الاستشعار التماثلية ومقاييس الجهد ومصادر الإشارات التماثلية الأخرى دون مكونات خارجية.

6 دبابيس إدخال/إخراج للأغراض العامة

يتميز بـ 6 خطوط إدخال/إخراج قابلة للبرمجة مع قدرة عالية على سحب/تزويد التيار للتشغيل المباشر لمصابيح LED والمرحلات الصغيرة والمحيطات الأخرى.

واجهة تسلسلية عالمية

يدعم USI المدمج اتصالات متعددة الأغراض بما في ذلك بروتوكولات SPI و I2C، مما يتيح اتصالاً سهلاً بأجهزة الاستشعار ورقائق الذاكرة والمحيطات الأخرى.

مؤقتان/عدادان 8 بت

يتضمن مؤقتين/عدادين 8 بت مع مقياس مسبق منفصل وقدرة PWM، مثالي لتوليد إشارات توقيت دقيقة ومخرجات على غرار التماثلي.

خيارات مذبذب داخلية وخارجية

يتميز بمذبذب RC داخلي معاير مع ترددات قابلة للتحديد، بالإضافة إلى دعم البلورات الخارجية أو الرنانات الخزفية للتوقيت الدقيق.

نطاق جهد تشغيل واسع

يعمل من 2.7V إلى 5.5V تيار مستمر، مما يجعله متوافقًا مع كل من أنظمة 3.3V و 5V، بالإضافة إلى التطبيقات التي تعمل بالبطارية.

حزمة DIP-8 للنمذجة الأولية السهلة

حزمة DIP-8 قياسية بمسافة دبابيس 2.54 مم تسمح بسهولة التركيب على لوحات التجارب و PCBs من خلال الفتحة واللحام اليدوي.

نظام تصحيح DebugWIRE على الرقاقة

واجهة DebugWIRE مدمجة تمكن من تصحيح الأخطاء وتنزيل البرامج في الوقت الفعلي باستخدام سلك واحد، مما يبسط التطوير واستكشاف الأخطاء وإصلاحها.

المواصفات الفنية

المعامل القيمة
الشركة المصنعة Microchip Technology
رقم القطعة ATTINY45-20PU
بنية النواة AVR RISC 8 بت
تردد الساعة حتى 20 ميجاهرتز
ذاكرة الفلاش 4 كيلوبايت
ذاكرة الوصول العشوائي 256 بايت
ذاكرة EEPROM 256 بايت
دبابيس الإدخال/الإخراج 6
قنوات ADC 4 (10 بت)
المؤقتات 2 × 8 بت
واجهات الاتصال USI
جهد التشغيل 2.7V – 5.5V
نوع الحزمة PDIP-8
تباعد الدبابيس 2.54 مم
درجة حرارة التشغيل -40°C إلى +85°C
متوافق مع RoHS نعم

تكوين الدبابيس

الدبوس الاسم الوظيفة
1 PB5 إدخال/إخراج رقمي، RESET
2 PB3 إدخال/إخراج رقمي، ADC3
3 PB4 إدخال/إخراج رقمي، ADC2
4 GND أرضي
5 PB0 إدخال/إخراج رقمي، MOSI
6 PB1 إدخال/إخراج رقمي، MISO
7 PB2 إدخال/إخراج رقمي، SCK
8 VCC طاقة 2.7V-5.5V

التطبيقات الشائعة

  • تأثيرات إضاءة LED وأجهزة التحكم

  • التحكم في المحركات الصغيرة والسيرفو

  • عقد استشعار تعمل بالبطارية

  • الإلكترونيات القابلة للارتداء

  • مهام الأتمتة البسيطة

  • توليد إشارات PWM

  • أجهزة استشعار تعمل باللمس السعوية

  • أجهزة إرسال/استقبال التحكم عن بعد بالأشعة تحت الحمراء

  • مشاريع برمجة AVR التعليمية

  • الأنظمة المدمجة منخفضة التكلفة

  • إلكترونيات الألعاب والهوايات

محتويات العلبة

  • 1 × شريحة متحكم ATTINY45-20PU أصلية

Reviews

There are no reviews yet

Be the first to review “ATTINY45-20PU Microcontroller”

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