Show Menu
Cheatography

AVR Programming Cheat Sheet - GPIO Cheat Sheet (DRAFT) by

AVR GPIO Cheat Sheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Introd­uction

GPIO stands for Genera­l-P­urpose Input/­Output. GPIO pins are versatile pins on an MCU that can be configured as either inputs or outputs. They provide a way to interface with the outside world, allowing you to connect and control various external devices, such as sensors, LEDs, displays, and more.

All AVR ports have true Read-M­odi­fy-­Write functi­onality when used as general digital I/O ports. This means that the direction of one port pin can be changed without uninte­nti­onally changing the direction of any other pin. The same applies when changing drive value (if configured as output) or enabli­ng/­dis­abling of pull-up resistors (if configured as input).

Each output buffer has symmet­rical drive charac­ter­istics with both high sink and source capabi­lity. The pin driver is strong enough to drive LED displays directly.

I/O Equivalent Schematic

All pins have diodes to protect against underv­oltage (D1) and overvo­ltage (D2).

Each pin features a selectable pull-up resistor (Rpu), ranging from 20k to 50k.

Cpin represents the pin parasitic capaci­tance; according to the datasheet, it should be less than 10 pF. However, it's important to note that this value is greatly influenced by the PCB layout.