Connect a transistor to the output to amplify the current. Any PB3, PB4, PB5 pin can be used as an output GPIO pin. The LED cathode end is then further attached to PB0/GND. Attach the output pin of ATtiny85 to the anode terminal of the LED. So, this register is addressed as DDRB = 0b00100000įirst, the power is given to ATtiny85 by connecting 5V to Vcc and connecting the GND pin to the ground. Setting a pint to ‘1’ will configure the GPIO pin as ‘output’ and ‘0’ will configure it as ‘input’.įor example, to configure PB5 pin as an output pin set DDB5 bit as ‘1’. Each of these bits (DDB1, DDB2, DDB3, DDB4, DDB5) is associated with 5 pins (PB1, PB2, PB3, PB4, PB5). As shown in the diagram this register has 5 Readable/Writable bits.
Also read aboutĨ051 Registers 8086 Registers DDRB Register There are three registers associated with attiny85, each name represented with red colored font is a register. As Attiny85 does not require any extra passive components for functioning, it is considered a good fit for various applications. 6 pins out of 8 are I/O pins and the rest being power pins. GPIO | Attiny85Īs shown in the upcoming figures, ATtiny85 has a total 8-pin interface. ATtiny (also known as TinyAVR) are a subfamily of the popular 8-bit AVR microcontrollers, which typically has fewer features, fewer I/O pins, and less. Atmel-42505A-8-bit AVR MicrocontrollerDatasheetPreliminary Summary-02/2016. Most I/O pins of the chip have more than one. It is an 8 pin IC as shown in Atiny85 pin diagram shown above. It has 8 Kbytes of In-System Programmable Flash and is popular because of its compact size and its features. So a GPIO port handles both incoming and outgoing digital signals. ATtiny85 is a high performance, low power 8-bit microcontroller based on Advanced RISC Architecture. Input mode is the default mode wherein input is received from the connected device, output mode data is delivered to the connected device. Since the 4.54 volts output by out voltage divider is higer than that, it should be seen as a '1' and not reset the chip.
GPIO is used in three main modes: input, output and UART interface. The datasheet for the ATTINY85 specifies the minimum voltage on the Reset pin that will interpreted as '1' as 0.9 volts (V IH2), which comes out to 4.5 volts. To connect microcontrollers with various available devices, this simple standard interface is used i.e. GPIO stands for General Purpose Input/Output.