Week 8

Embedded Programming

Final Project

ASSIGNMENT

  • Read a micro controller datasheet.
  • Program the board with as many different languages possible to do certain task.
  • Optionally,experiment with the other architecture.

Programming Attiny44 With Arduino IDE and Arduino As ISP (Arduino UNO)

Attiny44 can be programmed in various ways and one of them is Useing ARDuin IDE and ARduino UNO

This is the Easiest Way to accompanist the task given basic understanding of what we are trying to do.

UNDERSTANDING ATtiny44

The first assignment in this week was to read a datasheet of a micro-controller and put up the findings from the same.

For this exercise we were given a Datasheet by class website.

 

 

Some Basics Before We move forward.

  • GND means ground which is 0 volt
  • Power or VCC indicates voltage.
  • Current will pass when there is a voltage difference across a node
  • MISO is master in slave out
  • MOSI is master out slave in
  • Digital pins give only 2 outcomes : "on" and "off"
  • Analog related pin can give variation in voltage and not restricted to "on" and "off"
  • SCK is serial clock.

Above is the PINMAP of attiny44/48

Following are the important Information That will help us move  to next step.

 

  • Default Frequency: 1MHZ
  • Attiny44 Run at default speed of 1Mhz using it internal Clock
  • We can make it Run at 8MHz as well but it wont be so accurate.
  • To Make it Run AT 20Mhz we need a External Cristal or Resonator attached to Attiny44.
  • Below Diagram shows how External Cristal will be connected apart form other IO PINS

References

Following are the important References that got me running.

  1. http://42bots.com/tutorials/programming-attiny84-attiny44-with-arduino-uno/
    Above link proved very useful.

  2.  http://highlowtech.org/?p=1695
    This Guys at HighLowTech has done amazing work explaining so many things very clearly.

ARDUINO AS ISP

I have use arduino uno as programmer.

To make Arduino behave as ISP Load the Following code and burn it. as shown in the screnshot below

Examples>>ArduinoISP>>ArduinoISP

 

 

As we are using older version of Arduinos we need to uncomment line 81 to use:

Pin 11 :MOSI

Pin 12 : MOSI

Pin 13: SCK

Pin 10: RESET

 

Note this has to be done before connecting arduino to the Attiny board.

Programming Steps

Lets Get started With Programming The Board.

Following are the Screen-shots of how I dit it.

Setting up the Arduin IDE

 

Arduino IDE can Program boards with ATtiny family controllers but we need to provide the definitions of board for the same to Arduino.

 

To Do so Press Crol+,   (comma)  or go to preferences from File menu.

and the below Dialog box will appear.

In the Additional Boards Manager URLs:  Pase the below link to the json file which has the address for all board definitions.

 

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

 

This Will tell Arduino IDE where to look for board files over the Internet.

 

  • Next go to Tools >> Board: >> Board Manager

  • And search attiny.

  • attiny board family named "attiny by David A mellis" will appear clicking on it will enable installation option

 

 

Go ahead and install the same.

this might take a while.

 

This is a one time process for working with ATtiny boards anytime in future.

 

Now go to Tools >> Board : >> Attiny 24/44/84

 

Next I select clock" as External 20Mhz

( we dont need this but i tried this first to see what it does)

Now we can see the Tttiny board is available under the boards list

 

Select Processor as ATtiny44.

Next I loaded the basic blink program form the examples in Arduino IDe

As we can see below Our LED pin is connected to PA7 or say pin 6 on the ATtiny44

We use pin 7 to referrer form arduino code

So the default Blink code we change 13 to 7

 

Now connect  using jumper wires as follows

Reset   >> pin  10 on ardunino

VCC >> 5v on arduino

GND  >> ON arduino

MOSI  >> PIN 11

MISO >> PIN 12

SCK >>  PIN 13

 

The same is given in the arduino as ISP code if we scroll down.

The Joy of making it work !!

Thats me at my new Work place

 

Its a Maker Space Inside School In

Delhi.

 

LEARNINGS OF THE ASSIGNMENT

  • Learned how to program Attiny based boards using Arduno ISP
  • Learned how to download board files and get support for more controllers for Arduino ide.
  • Finally I have a board working completely made my myself and self programmed. now more confident to make more such boards