EMBEDDED PROGRAMMING
  • Read a microcontroller data sheet
  • Program your board to do something, with as many different programming languages and programming environments as possible
  • Optionally, experiment with other architectures
to accomplish this assignment i used hello board i created in week6 (Electronics Design)

Hello-board


Read a microcontroller data sheet

what I have read in data sheet is all about the High Performance, Low Power AVR® 8-bit Microcontroller(), that are convenient for running simple programs. The ATtiny45 and ATtiny85 have eight legs and are almost identical, except that the ATtiny85 has twice the memory of the ATtiny45 and can therefore hold more complex programs. The ATtiny45 and ATtiny85 have 8-legs and more inputs and outputs.
The ATtiny45 or 85 is a great option for running simple Arduino programs: it’s small, cheap and relatively easy to use. It does, however, have some limitations relative to the ATmega328P on an Arduino Uno. There are fewer pins, meaning you can’t connect as many components. There’s less flash memory (4KB or 8KB instead of 32KB), meaning your programs can’t be as big. There’s less RAM (256 or 512 bytes instead of 2KB), meaning you can’t store as much data. And there’s no hardware serial port or I2C port (Wire library), making communication trickier. some data funded on datasheet
Parameter  Value
Flash
4
20
256
256
1-SPI, 1-I2C
5PWM
1
-40 to 85
1.8 to 5.5
8
3

ATtiny45 arduino pin

for programing at the first time i used Arduino IDE 1.6.7 so by default ATtiny we need to add ATtiny board in ardunio board manager, here there is the procedures
  • open File > preference
  • Find the “Additional Boards Manager URLs” field near the bottom of the dialog and copy and paste below link and fill it in the gap as seems on image below

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

  • click okay
  • under option menu go to board Manager
  • Scroll to the bottom of the list; you should see an entry for “ATtiny”
  • click instal
  • close the dialog box
  • under option menu go to board and choose ATtiny 24/44/84 or ATtiny 25/45/85 depending on process you using( on my self am using ATtiny45
  • close the dialog box
  • select the processor, clock size and a programer thenk click burn bootloader if it is the first time
  • now everything is ready it time to code
    Coding

    for programing this hello world i used arduino pin library as we saw in data sheet or Eagle design
    the arduino code i used: mostly for blinking by refering to data sheet and the code witten by Neil Gershenfeld about hello.ftdi.16E5.blink.c where i referd to write this code by reading data sheet it easy acces port register, in easy way instead of using arduino libray to describe the number of pin by writting this code also save the memory of the chip used to store data.

    i used the followiing code for debouncing of button adruino example which created 21 November 2006 by David A. Mellis, modified 30 Aug 2011 by Limor Fried and modified again 28 Dec 2012 by Mike Walters but in this code i have to refer to the above image that shows how the pin are of attiny 45 looks like with relative to arduino pins before using this reference here there are some Arduino commands which are supported by the ATtiny library
    pinMode()
    digitalWrite()
    digitalRead()
    analogRead()
    analogWrite()()
    micros())
    delayMicroseconds()
    millis()
    Delayt()
    pulseIn()
    shiftOut()
    let use some of those arduino command to program our board if this above code seems to be complex dowm here you can the one i write my self both they work same