Freelance Electronics Components Distributor
Closed Dec 25th-26th
800-300-1968
We Stock Hard to Find Parts

ATMEGA48-20AU

Part # ATMEGA48-20AU
Description MCU 8BIT ATMEGA RISC 4KB FLASH 3.3V/5V 32TQFP - Trays
Category IC
Availability Out of Stock
Qty 0
Qty Price
1 + $1.49230



Technical Document


DISCLAIMER: The information provided herein is solely for informational purposes. Customers must be aware of the suitability of this product for their application, and consider that variable factors such as Manufacturer, Product Category, Date Codes, Pictures and Descriptions may differ from available inventory.

ii
2545M–AVR–09/07
ATmega48/88/168
8.8External Clock .........................................................................................................36
8.9Clock Output Buffer .................................................................................................36
8.10Timer/Counter Oscillator ........................................................................................37
8.11System Clock Prescaler ........................................................................................37
8.12Register Description ..............................................................................................38
9 Power Management and Sleep Modes ................................................. 40
9.1Sleep Modes ............................................................................................................40
9.2Idle Mode .................................................................................................................40
9.3ADC Noise Reduction Mode ....................................................................................41
9.4Power-down Mode ...................................................................................................41
9.5Power-save Mode ....................................................................................................41
9.6Standby Mode .........................................................................................................42
9.7Power Reduction Register .......................................................................................42
9.8Minimizing Power Consumption ..............................................................................42
9.9Register Description ................................................................................................44
10 System Control and Reset .................................................................... 46
10.1Resetting the AVR .................................................................................................46
10.2Reset Sources .......................................................................................................46
10.3Power-on Reset .....................................................................................................47
10.4External Reset .......................................................................................................48
10.5Brown-out Detection ..............................................................................................48
10.6Watchdog System Reset .......................................................................................49
10.7Internal Voltage Reference ....................................................................................49
10.8Watchdog Timer ....................................................................................................50
10.9Register Description ..............................................................................................54
11 Interrupts ................................................................................................ 57
11.1Overview ................................................................................................................57
11.2Interrupt Vectors in ATmega48 ..............................................................................57
11.3Interrupt Vectors in ATmega88 ..............................................................................59
11.4Interrupt Vectors in ATmega168 ............................................................................62
11.5Register Description ..............................................................................................65
12 External Interrupts ................................................................................. 67
12.1Pin Change Interrupt Timing ..................................................................................67
12.2Register Description ..............................................................................................68
iii
2545M–AVR–09/07
ATmega48/88/168
13 I/O-Ports .................................................................................................. 72
13.1Overview ................................................................................................................72
13.2Ports as General Digital I/O ...................................................................................73
13.3Alternate Port Functions ........................................................................................77
13.4Register Description ..............................................................................................88
14 8-bit Timer/Counter0 with PWM ............................................................ 90
14.1Features ................................................................................................................90
14.2Overview ................................................................................................................90
14.3Timer/Counter Clock Sources ...............................................................................92
14.4Counter Unit ..........................................................................................................92
14.5Output Compare Unit .............................................................................................93
14.6Compare Match Output Unit ..................................................................................94
14.7Modes of Operation ...............................................................................................95
14.8Timer/Counter Timing Diagrams .........................................................................100
14.9Register Description ............................................................................................102
15 16-bit Timer/Counter1 with PWM ........................................................ 109
15.1Features ..............................................................................................................109
15.2Overview ..............................................................................................................109
15.3Accessing 16-bit Registers ..................................................................................111
15.4Timer/Counter Clock Sources .............................................................................114
15.5Counter Unit ........................................................................................................115
15.6Input Capture Unit ...............................................................................................116
15.7Output Compare Units .........................................................................................118
15.8Compare Match Output Unit ................................................................................120
15.9Modes of Operation .............................................................................................121
15.10Timer/Counter Timing Diagrams .......................................................................128
15.11Register Description ..........................................................................................131
16 Timer/Counter0 and Timer/Counter1 Prescalers .............................. 138
16.1Register Description ............................................................................................140
17 8-bit Timer/Counter2 with PWM and Asynchronous Operation ...... 141
17.1Features ..............................................................................................................141
17.2Overview ..............................................................................................................141
17.3Timer/Counter Clock Sources .............................................................................142
17.4Counter Unit ........................................................................................................142
17.5Output Compare Unit ...........................................................................................143
iv
2545M–AVR–09/07
ATmega48/88/168
17.6Compare Match Output Unit ................................................................................145
17.7Modes of Operation .............................................................................................146
17.8Timer/Counter Timing Diagrams .........................................................................150
17.9Asynchronous Operation of Timer/Counter2 .......................................................152
17.10Timer/Counter Prescaler ...................................................................................153
17.11Register Description ..........................................................................................154
18 SPI – Serial Peripheral Interface ......................................................... 162
18.1Features ..............................................................................................................162
18.2Overview ..............................................................................................................162
18.3SS
Pin Functionality ............................................................................................167
18.4Data Modes .........................................................................................................167
18.5Register Description ............................................................................................169
19 USART0 ................................................................................................. 172
19.1Features ..............................................................................................................172
19.2Overview ..............................................................................................................172
19.3Clock Generation .................................................................................................173
19.4Frame Formats ....................................................................................................176
19.5USART Initialization .............................................................................................178
19.6Data Transmission – The USART Transmitter ....................................................180
19.7Data Reception – The USART Receiver .............................................................182
19.8Asynchronous Data Reception ............................................................................186
19.9Multi-processor Communication Mode ................................................................189
19.10Register Description ..........................................................................................191
19.11Examples of Baud Rate Setting .........................................................................195
20 USART in SPI Mode ............................................................................. 200
20.1Features ..............................................................................................................200
20.2Overview ..............................................................................................................200
20.3Clock Generation .................................................................................................200
20.4SPI Data Modes and Timing ................................................................................201
20.5Frame Formats ....................................................................................................201
20.6Data Transfer .......................................................................................................204
20.7AVR USART MSPIM vs. AVR SPI ......................................................................206
20.8Register Description ............................................................................................207
21 2-wire Serial Interface .......................................................................... 210
21.1Features ..............................................................................................................210
PREVIOUS117118119120121122123124125126NEXT