Tag Archives: USB bootloader

ATtiny85 goes uber-mini with The Nanite

The Nanite is an uber-mini dev board built around Atmel’s ATtiny85 microcontroller (MCU). The board – which measures 0.4″ wide – boasts the same pin configuration as a DIP ATtiny85.

“[I wanted] to have my own ATtiny85 based development board based on a USB bootloader and optimized for the ubiquitous 170 point mini-breadboards. [The Nanite] sports a reset button, but lacks an integrated voltage converter as it is supposed to be powered by USB,” Nanite creator Tim explained in a recent blog post.

“Apart from the size considerations, the Nanite also uses a neat circuit trick to share a single pin with the LED and the reset button. The circuit of the board is shown below, the circuit attached to the reset pin, PB5, is to the right.”

Meaning, if PB5 is configured as the standard reset, the push button will simply act as a reset button, with the LED taking on the role of a pull up for the reset button. However, if reset is disabled and PB5 is configured as a normal I/O pin, the state of the button can be polled by simply reading from the port.

“The LED can be turned on by setting the output to ‘low’ and turned off by configuring the output into a high impedance state. It is not advised to set the output ‘high’, since in that case the pushbutton could short the output to ground,” said Tim.

“I use micronucleus in a configuration where it only starts when the button is pushed. This means that the user program is started without a delay after the device is powered up.”

Meanwhile, the functionality of the reset button is emulated via software, periodically polling the state of the button and activating the watch dog timer if it is pressed. If the watch dog times out, the device resets.

“Apart from the LED output, user interaction and soft-reset button, PB5 can also be used as a simple serial debug output – connected to the RX input of a serial to USB adapter. I use a simple software-UART implementation and a macro to redirect STDOUT to the serial output. This allows very convenient debugging with printf(),” he added.

Interested in learning more? You can check out Nanite’s official page here, while the Eagle design files and example code are available on Github here.