TASK TO DO:

  • Read a micro-controller data sheet.
  • Program your board to do something, with as many different programming languages and programming environments as possible.
  • Optionally, experiment with other architectures.
  • Group assignment:

  • Compare the performance and development workflows for other architectures.
  • WHAT I HAVE DONE:

  • I learned from reading a micro-controller datasheet.
  • I Programmed my board.
  • I Described the programming processes.

  • The goal of this assignment is to read the micro-controller data sheet and program the board to do something, with as many different programming languages as possible.

    What is Datasheet?

    Datasheet is the document that summarizes the performance and other technical characteristics of the component. It's a basically a "manual for micro-controller" which describes the function of particular IC and its components.



    Reading the datasheet it's a tough thing to do, as it's plenty of information and it has more than 280 pages. Although I wanted to read of all it, it seems like impossible. Instead you should be looking at it generally and then go through it specifically, on the points that really matter to your project or what you want to do.

    Attiny44A Datasheet:-

    I started reading the "Micro-controller Datasheet" to get a general idea about the Micro-controller and its structure. I used attiny44 for my hello-world board. The attiny 44A is an IC with 14 pins.
    1. The datasheet gives us pin configuration which helps me while soldering as well as programming. We can find out our mistakes while programming the board by using this pin configuration.


    2. The IC has few fixed or dedicated pins like MISO, SCK, MOSI and RESET.



    VCC and GND are common pins.
    VCC - This pin where voltage supplied.
    GND - Ground pin
    Port B(PB3...PB0)is a 4-bit bi-directional I/O port with internal pull-up resistors.
    RESET - The reset pin can also be used as a (weak) I/O pin.
    Port A (PA7..PA0) is a 8-bit bi-directional I/O port with internal pull-up resistors. Port A has alternate functions as analog inputs for the ADC, analog comparator, timer/counter, SPI.

    The next part is block diagram as below:



    ATtiny24A/44A are low-power CMOS 8-bit micro-controllers based on the AVR enhanced RISC architecture.
    Attiny44A has 12 general purpose I/O lines, 32 general purpose working registers. The main function of the CPU core is to ensure correct program execution. The CPU must therefore be able to access memories, perform calculations, control peripherals, and handle interrupts.
    Then the Architectural view is as shown below:



    The AVR uses a Harvard architecture with separate memories and buses for program and data.

    Programming Hello-World Board-

    We have to program the hello-world board with different programming languages.
    This is my hello-world board. To know how I milled my hello board, you can visit this page Week 7.



    I further started programming my Hello board with the help of ARDUINO, arduino first because I'm really new to programming.

    What is arduino?

    Arduino is an open-source electronics platform based on easy-to-use hardware and software.



    Arduino boards are able to read inputs - light on a sensor, a finger on a button and turn it into an output - activating a motor, turning on an LED.[From Google]

    By default we don't have Attiny 44 as in the boards list in arduino IDE, we need to add it.
    Open Arduino IDE. Go to Sketch > Include libraries > Manage Libraries, we will be uploading our code on attiny 44 IC on the hello board, so we need to have libraries for the same, you can install for any board or IC like this.



    Open the preferences dialog in the Arduino software.



    Find the "Additional Boards Manager URLs" field near the bottom of the dialog. Paste the following URL(Attiny44) into the field -
    https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
    Click the OK button to save your updated preferences.


    After installation, we need to declare arduino as an ISP, for this we have to select the board and port and run the program of Arduino as ISP from the examples.



    After this, I connected my board to the arduino, using the following configuration show in the program of arduino as ISP.


    I have to select the port where my hello-world attached. Make the changes in Arduino IDE as follows:


    Here I have used the code from examples to blink the LED. By referring the datasheet and knowing the pin which connected to the LED of the board. Pin 7 declared as a output pin.


    Check the connections. If the Arduino is working and connections are ok then LED starts blinking.


    Now I wanted to try running by using my FABISP. My machine does not have drivers for USBtiny installed, thus I installed it from Here.


    In arduino IDE I repeated the same procedure and selected USBtiny as my programmer and uploaded the blink program.


    I had done lot of programming with arduino, So I decided to try avrdude in Ubuntu and try the same using make files.
    Then I download the source code C and Make file and compile the code. Set the fuses and program the board.
    The c and make file are in my root directory and then I complied the code:
    make -f hello.ftdi.44.echo.c.make

    For setting the clock to 20MHz using the external crystal, set the fuses.
    make -f hello.ftdi.44.echo.c.make program-usbtiny-fuses

    Then I programmed the micro-controller.
    make -f hello.ftdi.44.echo.c.make program-usbtiny

    Embedded C

    I just lookout embedded C in atmel studio and try to write code for my hello board.
    I write this for blinking the LED and my LED on the board connected to PA7 i.e pin 6.
    Attiny 44 has two set of the port A and B. The DDRA (data direction resister) command we use for this.
    DDRA=0b11111111
    Here "0b" represent the binary value and "1" represent the output value.

    Open the Atmel studio and select the new project.


    Then select the language i.e C/C++....




    To set any port as high we write
    PORTA |= (1<<7) or PORTA |= (0b10000000)
    To set any port as low we write
    PORTA |= PORTA &= ~(1<<7) or PORTA &= ~(0b10000000)


    After writing I made connections and for this I used my FAB ISP to program my hello-world board.
    Successfully run the program....




    You can see the connections....

    Group Work-

    For this week we have to understand the Architecture of the board. We had decided to explore the architecture, configuration and coding it through python.



    Specification:

  • CHIP- Broadcom BCM2835 SoC
  • Core Architecture- ARM11
  • CPU- 700 MHz Low Power ARM1176JZFS
  • GPU- Dual Core VideoCore IVĀ® Multimedia Co-Processor
  • Memory- 512MB SDRAM
  • Operating system- Boots from Micro SD card, running a version of the Linux operating system
  • Dimension- 85 x 56 x 17mm
  • Power- Micro USB socket 5V, 2A



  • Coding for LED blinking program:-

    For this we had connected the raspberry pi b+ with keyboards and powered it up, to boot through it. The OS that we had installed was Raspbian , having a pretty simple user interface.


    We wrote a test program for blinking the LED in local text editor in Raspbian. The code is as shown below:


    We connected our LED to GPIO pin of the board on the bread board. The connection are as follows:

    Then check the pin in a code which we connected on the board and write the correct pin number in a code...


    Then we run the program and get the output (see below:)

    Learning Outcomes-

    This week is really hard for me. My instructor and friends help me to understand about programming. I started with arduino and then we are going for raspberry pi in group assignment. I read the datasheet and while writing the code I realized its importance. In arduino, selection of clock and baud rate is important. C language is liitle-bit easy.