Tinusaur Starter: We are making a beginners kit

Tinusaur Starter Kit

To start making things with the Tinusaur you need the board, the parts, a programmer with a cable and couple of LEDs to make your first blinking lights program for ATtiny85 microcontroller.

Tinusaur Starter Kit for Beginners PartsWe’re ordering the PCBs and the parts from the manufacturers and it seems that the total cost for the full package will be 8 to 9 USD. Once we have everything here we’ll run a small test sale to see what’s the interest in the kit. The estimated cost for delivery of the kit to any country in the world is about 2 USD. So the total cost to get it would be 10 to 11 USD – very affordable for everyone.

Here is a list of everything that will be included in the Tinusaur Starter:

Name Description
PCB Tinusaur Board
MCU, Attiny85 Atmel AVR ATtiny85 microcontroller
Socket, DIP-8 DIP-8 socket for MCU
H1, Header Header 2×4, Female
H2, Header Header 2×5, Female
ISP, Header Header 2×5, Male, for ISP
RESET, Button Tactile push button, for RESET
Power, Header Header 1×2, Male, for external power
Battery, Header Header 1×2, Male, for battery power on/off
Battery, Jumper Jumper, 2-pin, for battery power on/off
C1, Capacitor Capacitor 100uF, Low profile 5×5 mm
C2, Capacitor Capacitor 100nF, Small
R1, Resistor Resistor 10K, Small, 1/8W
Battery holder Battery holder for CR2032
Battery 3V Battery 3V, CR2032
LED1 LED, 3mm, red
LED2 LED, 3mm, green
Resistor (LED1) Resistor 330 ohm, Small, 1/8W, for LED
Resistor (LED2) Resistor 330 ohm, Small, 1/8W, for LED
Header (LED1) Header 1×2, Male, for LED
Header (LED2) Header 1×2, Male, for LED
ISP Programmer USB ASP, with 10-pin connector and cable
Packaging Packaging bag, plastic

Check more often Twitter, Facebook, Google+ and The Tinusaur Project site for news about this kit.

Advertisements

Tutorial 001: Blinking LED

Tinusaur Tutorial 001: Blinking LED

UPDATE: New version of this tutorial is available at the Tutorial 001: Blinking LED x1 page.

Tinusaur Tutorial 001: Blinking LEDThis is very simple tutorial how to make a LED blinking.

Since the Tinusaur board is a very standard ATtiny breakout board this could be applied to almost any such other board.

The code was tested to work with ATtiny13, ATtiny25, ATtiny45 and ATtiny85 but will probably work other chips too.

We assume that the Tinusaur board is already assembled, successfully; connected through the ISP programmer to the computer; and development environment . It is not the subject of this tutorial how to assemble the board or how to setup development environment.

The LED should be connected on pin 2 of the ATtiny – this is PB3 – through a resistor, and to the GND.

The LED, marked as D1, is just a standard light emitting diode.

The resistor, marked as R1,  is 270 to 330 ohm.

The most important fragment of the code is this:

	while (1) {
		PORTB |= (1 << LED_PORT);
		_delay_ms(200);
		PORTB &= ~(1 << LED_PORT);
		_delay_ms(400);
	}

What is does is this:

  1. Start an infinite loop.
  2. Set the LED wire signal to “1” – that will make it to light.
  3. Wait a little – 200 milliseconds.
  4. Clear the LED wire signal to “0” – that will turn it off.
  5. Wait a little -400 milliseconds.
  6. Do it again.

Here is the entire source code:

/**
 * The Tinusaur Project
 *
 * Tutorial 001: Blinking LED
 *
 * file: main.c
 * created: 2014-01-04
 *
 **/

#include <avr/io.h>
#include <util/delay.h>

// ====================================
//                ATtiny
//               25/45/85
//              +--------+
//            --+ o  Vcc +------------
//  LED - PB3 --+        +--
//            --+        +--
//  ------------+ GND    +--
//              +--------+
// ====================================

// Define the I/O port to be used for the LED.
// This a number between 0 and 7 that tells which bit to use.
#define LED_PORT PB3

int main(void) {

	// Set the LED port number as output.
	// The DDRB is the data direction for port B.
	// This ...
	//  - shifts the "1" on left to the desired position and ...
	//  - does bitwise "OR" with the value in the port register.
	DDRB |= (1 << LED_PORT);

	// Start infinite loop.
	// (this is how most programs work)
	while (1) {

		// Set the LED bit to "1" - LED will be "on".
		PORTB |= (1 << LED_PORT);

		// Wait a little.
		// The delay function simply does N-number of "empty" loops.
		_delay_ms(200);

		// Set the LED bit to "0" - LED will be "off".
		PORTB &= ~(1 << LED_PORT);

		// Wait a little.
		_delay_ms(400);

		// Do it again ...
	}

	// Return the mandatory for the "main" function value.
	return (0);
}

Copy the code above to your “main.c” file.

The source code could be also found on Bitbucket at this address: https://bitbucket.org/tinusaur/tutorials/src/1f61873ae382/tut001/src/main.c.

The circuit schematics, even though very simple, was drown on 123d.circuits.io and it is available at this address: http://123d.circuits.io/circuits/76781.