Mohammad Al Hamadi

Embedded programming

Assignment


read a microcontroller data sheet program your board to do something, with as many different programming languages and programming environments as possible.

During the week of electronics design, I designed and built an electronic board and used an ATTINEY44 A AVR processor, as well as installing an LED and Switch.

Embedded program


is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. Embedded systems control many devices in common use today.

Microcontroller datasheet


Thedatasheet I read was that of the ATtiny44, which is the microcontroller that I have used in the "Hello-world" PCB.

In the "Pin Configuration" section we see a couple of schematic diagrams of the formats in which 14 and 20 pins are available (although only 14 pins are used in the last one).
Followed by an explanation about the functions of each pin.
Three pins are intended for:
supply voltage (VCC), earth (GND) and reset, the rest are divided into two groups:
ports A and B.
Port A is 8 bits of bidirectional input/output analog, port B has 4 bits of bidirectional input/output, both ports have internal pull-up resistors.
In the "Overview" section, a block diagram of the microcontroller is shown, followed by a summary explanation of the functions of each component.
Conclusion
I use these pins, for input and output, port A
Programming my board


The ATTiny44 driver library was not installed in the Arduino IDE, it must be installed first, so I went to the "File / Preferences" menu "Card Additional URL Manager" Copy this link:
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json


Then I clicked on the menu "Tools / Board / Boards Manager" and in the pop-up window I searched for "ATTiny" and installed it.


From the command file we choose an example, which is arduino Isp

From the menu "Tools / Board ATtiny24 / 44/84". Then in the "Tools / Processor" menu I chose "ATtiny44" The watch "I chose" 20 MHZ.


Because of this crisis that is occurring in the world I lacked some tools and I cannot get to LAP. So I used the Arduino tablet to program the tablet after I adjusted all the settings as it should.

To check that the board is working, I chose blink example to to make sure that the LED in my board which is connected to pin 1

As shown in the video below:


First, I will install the Ubuntu operating system on an external flash or on the computer, then we will update the Ubuntu system after opening it to make sure that all files are complete and so that no errors appear with us.

We'll open Terminal and write the following commands as you did last week:
here are several commands that must be followed to program the board:
First of all, we install the necessary package to program AVR 1 We install the following commands to activate the AVR library on the computer:
sudo apt-get install flex byacc bison gcc libusb-dev avrdude
sudo apt-get install gcc-avr
sudo apt-get install avr-libc
sudo apt-get install libc6-dev
2-We download and install the DNA or the mind of the device using these commands:
First we define the destination, for example the desktop, after that we write a command
(wget http://academy.cba.mit.edu/classes/embedded_programming/firmware.zip)
Then we extract the files where we want them.
3- We install the DNA of the board using these instructions:
sudo make clean: to delete files that are not compatible with ATTINY44
sudo make hex: to create files that match the board Then we add a hashtag "#" note before the written line and add a note after it

Then we use the sudo make fuse command to link the file to be executed
sudo make program: This command collects the board with the file.
This is aTXT file for all of your steps

After completing the previous steps, we will use the Arduino programming language to book these commands after defining the input pin and the output pin

This is the video clip after all the procedures are completed:




I read about embedded programming to be able to program my Attiny44 electronic board, and I used a site FabAcademy-Tutorials for information on how to create a Makefile.

This site is for calculating fuse Engbedded Atmel AVR® Fuse Calculator




I will program the board that I produced in the design week, using the board that I produced in the week of production

In order to program, first I need AVR libraries which I can download as I did before in a week of production, when I programmed the ISP, secondly, I will need a crafting file and making tool, and I will also need C code, after I have made sure that my electronic board is working I will start the programming I will go to a datasheet Attiny44 in order to read some important ones that will help me programming.


Create Make File
A makefile is a file (by default named "Makefile") containing a set of directives used by a make build automation tool to generate a target/goal.

First, after calculating the fuse, I will create a file without a formula called Makefile. I used Neil's Makefile example, then amended it and deleted what was appropriate for the programming process,And I deleted all unnecessary lines (I kept the first 4 lines for configuring Makefile and the two lines for usbtiny and usbtiny fuses), I changed the fuse value that you calculated in the previous step.
	 

            PROJECT=led
            SOURCES=$(PROJECT).c
            MMCU=attiny44
            F_CPU = 20000000
            CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU)     #create set of parameters for the compiler (clock, MCU)
            
            $(PROJECT).hex: $(PROJECT).out
	        avr-objcopy -O ihex $(PROJECT).out $(PROJECT).c.hex;\      #copy and translate object files
	        avr-size --mcu=$(MMCU) --format=avr $(PROJECT).out         #size utility lists the section sizes               
            
            $(PROJECT).out: $(SOURCES)
	        avr-gcc $(CFLAGS) -I./ -o $(PROJECT).out $(SOURCES)        #to compile the file 
            
            program-fabISP: $(PROJECT).hex
	        avrdude -p t44 -P usb -c usbtiny -U flash:w:$(PROJECT).c.hex       #to upload the file
            
            program-fabISP-fuses: $(PROJECT).hex
	        avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x6A:m         #to upload the settings of the fuses  
	 
Create C-Code Led
	 
            #include  -avr/io.h-
            #include  -util/delay.h-

            #define F_CPU20000UL
            #define LED_PORT PORTA
            #define Button PA0

            int main (void){
  
            DDRA = 0b10000000;//t Pin PA0 of PORT A as input (button) and set pin 1 of PORT A as output (LED)
            while (1){
            if(Button==1){
            LED_PORT = 0b01000000;  //set PA1 high
            }
            else{
            LED_PORT = 0b00000000;  //set PA1 low
            }
            }
            }
 
            
	 
After writing the code in C language and creating a Makefile, I'll start with the next step

I will link fab isp to the electronic board of design week as shown in the picture below


  • SCK(Serial Clock): Programming clock, generated by the In-System Programmer (Master)
  • MOSI(Master Out - Slave In): Communication line from In-System Programmer (Master) to target AVR being programmed (Slave )
  • MISO( Master In - Slave Out ): Communication line from target AVR (Slave) to In- System Programmer (Master)
  • RST(Reset): To enable In-System Programming, the target AVR Reset must be kept active. To simplify this, the In-System Programmer should control the target AVR Reset
  • GND(Ground): Common Ground

  • After that, I will launch Ubuntu (I burned the system to an external flash drive) and then I will boot from this flash, after that I will open the terminal and use the following commands that I used previously.

    sudo apt-get install flex byacc bison gcc libusb-dev avrdude
    sudo apt-get install gcc-avr
    sudo apt-get install avr-libc
    sudo apt-get install libc6-dev
    I have created a folder on my desktop and put the files that I have worked on previously "makefile" and "code".

    Then I'll write make. Then I will write program-fabISP to the terminal
    To make sure that the work is done, we go to the file that you created (which contains the makefile and C-Code). This step should produce two files .hex & .out.

    After completing these steps the board will work




    installing the packages & make and make program commands
    	 
          ubuntu@ubuntu:~$ sudo apt-get install flex byacc bison gcc libusb-dev avrdude
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following package was automatically installed and is no longer required:
      libwayland-egl1-mesa
    Use 'sudo apt autoremove' to remove it.
    The following additional packages will be installed:
      gcc-7 libasan4 libatomic1 libbison-dev libc-dev-bin libc6-dev libcilkrts5
      libfl-dev libfl2 libftdi1 libgcc-7-dev libitm1 liblsan0 libmpx2 libquadmath0
      libsigsegv2 libtsan0 libubsan0 libusb-0.1-4 linux-libc-dev m4 manpages-dev
    Suggested packages:
      avrdude-doc bison-doc build-essential flex-doc gcc-multilib make autoconf
      automake libtool gcc-doc gcc-7-multilib gcc-7-doc gcc-7-locales libgcc1-dbg
      libgomp1-dbg libitm1-dbg libatomic1-dbg libasan4-dbg liblsan0-dbg
      libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg
      glibc-doc m4-doc
    The following NEW packages will be installed:
      avrdude bison byacc flex gcc gcc-7 libasan4 libatomic1 libbison-dev
      libc-dev-bin libc6-dev libcilkrts5 libfl-dev libfl2 libftdi1 libgcc-7-dev
      libitm1 liblsan0 libmpx2 libquadmath0 libsigsegv2 libtsan0 libubsan0
      libusb-0.1-4 libusb-dev linux-libc-dev m4 manpages-dev
    0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded.
    Need to get 15.5 MB/20.4 MB of archives.
    After this operation, 79.9 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 cdrom://Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1) bionic/main amd64 gcc amd64 4:7.4.0-1ubuntu2.3 [5184 B]
    Get:2 cdrom://Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1) bionic/main amd64 libc-dev-bin amd64 2.27-3ubuntu1 [71.8 kB]
    Get:3 cdrom://Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1) bionic/main amd64 libc6-dev amd64 2.27-3ubuntu1 [2587 kB]
    Get:4 http://ftp.belnet.be/ubuntu bionic/main amd64 libsigsegv2 amd64 2.12-1 [14.7 kB]
    Get:5 cdrom://Ubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203.1) bionic/main amd64 manpages-dev all 4.15-1 [2217 kB]
    Get:6 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libitm1 amd64 8.3.0-26ubuntu1~18.04 [27.9 kB]
    Get:7 http://ftp.belnet.be/ubuntu bionic/main amd64 m4 amd64 1.4.18-1 [197 kB] 
    Get:8 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libatomic1 amd64 8.3.0-26ubuntu1~18.04 [9192 B]
    Get:9 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libasan4 amd64 7.5.0-3ubuntu1~18.04 [358 kB]
    Get:10 http://ftp.belnet.be/ubuntu bionic/main amd64 flex amd64 2.6.4-6 [316 kB]
    Get:11 http://security.ubuntu.com/ubuntu bionic-security/main amd64 liblsan0 amd64 8.3.0-26ubuntu1~18.04 [133 kB]
    Get:12 http://ftp.belnet.be/ubuntu bionic/main amd64 libbison-dev amd64 2:3.0.4.dfsg-1build1 [339 kB]
    Get:13 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libtsan0 amd64 8.3.0-26ubuntu1~18.04 [288 kB]
    Get:14 http://ftp.belnet.be/ubuntu bionic/main amd64 bison amd64 2:3.0.4.dfsg-1build1 [266 kB]
    Get:15 http://ftp.belnet.be/ubuntu bionic/main amd64 libfl2 amd64 2.6.4-6 [11.4 kB]
    Get:16 http://ftp.belnet.be/ubuntu bionic/main amd64 libfl-dev amd64 2.6.4-6 [6320 B]
    Get:17 http://ftp.belnet.be/ubuntu bionic/main amd64 libusb-0.1-4 amd64 2:0.1.12-31 [17.1 kB]
    Get:18 http://ftp.belnet.be/ubuntu bionic/universe amd64 libftdi1 amd64 0.20-4build3 [15.0 kB]
    Get:19 http://ftp.belnet.be/ubuntu bionic/main amd64 libusb-dev amd64 2:0.1.12-31 [30.2 kB]
    Get:20 http://ftp.belnet.be/ubuntu bionic/universe amd64 avrdude amd64 6.3-4 [302 kB]
    Get:21 http://ftp.belnet.be/ubuntu bionic/universe amd64 byacc amd64 20140715-1build1 [61.3 kB]
    Get:13 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libtsan0 amd64 8.3.0-26ubuntu1~18.04 [288 kB]
    Get:22 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libubsan0 amd64 7.5.0-3ubuntu1~18.04 [126 kB]
    Get:23 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libcilkrts5 amd64 7.5.0-3ubuntu1~18.04 [42.5 kB]
    Get:24 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libmpx2 amd64 8.3.0-26ubuntu1~18.04 [11.6 kB]
    Get:25 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libquadmath0 amd64 8.3.0-26ubuntu1~18.04 [134 kB]
    Get:26 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgcc-7-dev amd64 7.5.0-3ubuntu1~18.04 [2378 kB]
    Get:27 http://security.ubuntu.com/ubuntu bionic-security/main amd64 gcc-7 amd64 7.5.0-3ubuntu1~18.04 [9381 kB]
    Get:28 http://security.ubuntu.com/ubuntu bionic-security/main amd64 linux-libc-dev amd64 4.15.0-91.92 [1026 kB]
    Fetched 15.3 MB in 5min 16s (48.6 kB/s)                                        
    Selecting previously unselected package libsigsegv2:amd64.
    (Reading database ... 181734 files and directories currently installed.)
    Preparing to unpack .../00-libsigsegv2_2.12-1_amd64.deb ...
    Unpacking libsigsegv2:amd64 (2.12-1) ...
    Selecting previously unselected package m4.
    Preparing to unpack .../01-m4_1.4.18-1_amd64.deb ...
    Unpacking m4 (1.4.18-1) ...
    Selecting previously unselected package flex.
    Preparing to unpack .../02-flex_2.6.4-6_amd64.deb ...
    Unpacking flex (2.6.4-6) ...
    Selecting previously unselected package libbison-dev:amd64.
    Preparing to unpack .../03-libbison-dev_2%3a3.0.4.dfsg-1build1_amd64.deb ...
    Unpacking libbison-dev:amd64 (2:3.0.4.dfsg-1build1) ...
    Selecting previously unselected package bison.
    Preparing to unpack .../04-bison_2%3a3.0.4.dfsg-1build1_amd64.deb ...
    Unpacking bison (2:3.0.4.dfsg-1build1) ...
    Selecting previously unselected package libitm1:amd64.
    Preparing to unpack .../05-libitm1_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking libitm1:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libatomic1:amd64.
    Preparing to unpack .../06-libatomic1_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking libatomic1:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libasan4:amd64.
    Preparing to unpack .../07-libasan4_7.5.0-3ubuntu1~18.04_amd64.deb ...
    Unpacking libasan4:amd64 (7.5.0-3ubuntu1~18.04) ...
    Selecting previously unselected package liblsan0:amd64.
    Preparing to unpack .../08-liblsan0_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking liblsan0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libtsan0:amd64.
    Preparing to unpack .../09-libtsan0_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking libtsan0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libubsan0:amd64.
    Preparing to unpack .../10-libubsan0_7.5.0-3ubuntu1~18.04_amd64.deb ...
    Unpacking libubsan0:amd64 (7.5.0-3ubuntu1~18.04) ...
    Selecting previously unselected package libcilkrts5:amd64.
    Preparing to unpack .../11-libcilkrts5_7.5.0-3ubuntu1~18.04_amd64.deb ...
    Unpacking libcilkrts5:amd64 (7.5.0-3ubuntu1~18.04) ...
    Selecting previously unselected package libmpx2:amd64.
    Preparing to unpack .../12-libmpx2_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking libmpx2:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libquadmath0:amd64.
    Preparing to unpack .../13-libquadmath0_8.3.0-26ubuntu1~18.04_amd64.deb ...
    Unpacking libquadmath0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Selecting previously unselected package libgcc-7-dev:amd64.
    Preparing to unpack .../14-libgcc-7-dev_7.5.0-3ubuntu1~18.04_amd64.deb ...
    Unpacking libgcc-7-dev:amd64 (7.5.0-3ubuntu1~18.04) ...
    Selecting previously unselected package gcc-7.
    Preparing to unpack .../15-gcc-7_7.5.0-3ubuntu1~18.04_amd64.deb ...
    Unpacking gcc-7 (7.5.0-3ubuntu1~18.04) ...
    Selecting previously unselected package gcc.
    Preparing to unpack .../16-gcc_7.4.0-1ubuntu2.3_amd64.deb ...
    Unpacking gcc (4:7.4.0-1ubuntu2.3) ...
    Selecting previously unselected package libc-dev-bin.
    Preparing to unpack .../17-libc-dev-bin_2.27-3ubuntu1_amd64.deb ...
    Unpacking libc-dev-bin (2.27-3ubuntu1) ...
    Selecting previously unselected package linux-libc-dev:amd64.
    Preparing to unpack .../18-linux-libc-dev_4.15.0-91.92_amd64.deb ...
    Unpacking linux-libc-dev:amd64 (4.15.0-91.92) ...
    Selecting previously unselected package libc6-dev:amd64.
    Preparing to unpack .../19-libc6-dev_2.27-3ubuntu1_amd64.deb ...
    Unpacking libc6-dev:amd64 (2.27-3ubuntu1) ...
    Selecting previously unselected package libfl2:amd64.
    Preparing to unpack .../20-libfl2_2.6.4-6_amd64.deb ...
    Unpacking libfl2:amd64 (2.6.4-6) ...
    Selecting previously unselected package libfl-dev:amd64.
    Preparing to unpack .../21-libfl-dev_2.6.4-6_amd64.deb ...
    Unpacking libfl-dev:amd64 (2.6.4-6) ...
    Selecting previously unselected package libusb-0.1-4:amd64.
    Preparing to unpack .../22-libusb-0.1-4_2%3a0.1.12-31_amd64.deb ...
    Unpacking libusb-0.1-4:amd64 (2:0.1.12-31) ...
    Selecting previously unselected package libftdi1:amd64.
    Preparing to unpack .../23-libftdi1_0.20-4build3_amd64.deb ...
    Unpacking libftdi1:amd64 (0.20-4build3) ...
    Selecting previously unselected package libusb-dev.
    Preparing to unpack .../24-libusb-dev_2%3a0.1.12-31_amd64.deb ...
    Unpacking libusb-dev (2:0.1.12-31) ...
    Selecting previously unselected package manpages-dev.
    Preparing to unpack .../25-manpages-dev_4.15-1_all.deb ...
    Unpacking manpages-dev (4.15-1) ...
    Selecting previously unselected package avrdude.
    Preparing to unpack .../26-avrdude_6.3-4_amd64.deb ...
    Unpacking avrdude (6.3-4) ...
    Selecting previously unselected package byacc.
    Preparing to unpack .../27-byacc_20140715-1build1_amd64.deb ...
    Unpacking byacc (20140715-1build1) ...
    Setting up libquadmath0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up libatomic1:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up libasan4:amd64 (7.5.0-3ubuntu1~18.04) ...
    Setting up libsigsegv2:amd64 (2.12-1) ...
    Setting up libcilkrts5:amd64 (7.5.0-3ubuntu1~18.04) ...
    Setting up libubsan0:amd64 (7.5.0-3ubuntu1~18.04) ...
    Setting up libtsan0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up linux-libc-dev:amd64 (4.15.0-91.92) ...
    Setting up m4 (1.4.18-1) ...
    Setting up liblsan0:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up libmpx2:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up byacc (20140715-1build1) ...
    update-alternatives: using /usr/bin/byacc to provide /usr/bin/yacc (yacc) in auto mode
    Setting up libbison-dev:amd64 (2:3.0.4.dfsg-1build1) ...
    Setting up libfl2:amd64 (2.6.4-6) ...
    Setting up libc-dev-bin (2.27-3ubuntu1) ...
    Setting up bison (2:3.0.4.dfsg-1build1) ...
    update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode
    Setting up manpages-dev (4.15-1) ...
    Setting up libc6-dev:amd64 (2.27-3ubuntu1) ...
    Setting up libusb-0.1-4:amd64 (2:0.1.12-31) ...
    Setting up libitm1:amd64 (8.3.0-26ubuntu1~18.04) ...
    Setting up flex (2.6.4-6) ...
    Setting up libftdi1:amd64 (0.20-4build3) ...
    Setting up libgcc-7-dev:amd64 (7.5.0-3ubuntu1~18.04) ...
    Setting up libfl-dev:amd64 (2.6.4-6) ...
    Setting up libusb-dev (2:0.1.12-31) ...
    Setting up avrdude (6.3-4) ...
    Setting up gcc-7 (7.5.0-3ubuntu1~18.04) ...
    Setting up gcc (4:7.4.0-1ubuntu2.3) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    Processing triggers for install-info (6.5.0.dfsg.1-2) ...
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    ubuntu@ubuntu:~$ sudo apt-get install gcc-avr
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following package was automatically installed and is no longer required:
      libwayland-egl1-mesa
    Use 'sudo apt autoremove' to remove it.
    The following additional packages will be installed:
      binutils-avr
    Suggested packages:
      task-c-devel gcc-doc avr-libc
    The following NEW packages will be installed:
      binutils-avr gcc-avr
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 16.6 MB of archives.
    After this operation, 85.3 MB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://ftp.belnet.be/ubuntu bionic/universe amd64 binutils-avr amd64 2.26.20160125+Atmel3.6.0-1 [1475 kB]
    Get:2 http://ftp.belnet.be/ubuntu bionic/universe amd64 gcc-avr amd64 1:5.4.0+Atmel3.6.0-1build1 [15.1 MB]
    62% [2 gcc-avr 9201 kB/15.1 MB 61%]                                             Get:2 http://ftp.belnet.be/ubuntu bionic/universe amd64 gcc-avr amd64 1:5.4.0+Atmel3.6.0-1build1 [15.1 MB]
    Fetched 3679 kB in 3min 0s (20.4 kB/s)                                         
    Selecting previously unselected package binutils-avr.
    (Reading database ... 185918 files and directories currently installed.)
    Preparing to unpack .../binutils-avr_2.26.20160125+Atmel3.6.0-1_amd64.deb ...
    Unpacking binutils-avr (2.26.20160125+Atmel3.6.0-1) ...
    Selecting previously unselected package gcc-avr.
    Preparing to unpack .../gcc-avr_1%3a5.4.0+Atmel3.6.0-1build1_amd64.deb ...
    Unpacking gcc-avr (1:5.4.0+Atmel3.6.0-1build1) ...
    Setting up binutils-avr (2.26.20160125+Atmel3.6.0-1) ...
    Setting up gcc-avr (1:5.4.0+Atmel3.6.0-1build1) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    Processing triggers for libc-bin (2.27-3ubuntu1) ...
    ubuntu@ubuntu:~$ sudo apt-get install avr-libc
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following package was automatically installed and is no longer required:
      libwayland-egl1-mesa
    Use 'sudo apt autoremove' to remove it.
    The following NEW packages will be installed:
      avr-libc
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 4872 kB of archives.
    After this operation, 42.5 MB of additional disk space will be used.
    Get:1 http://ftp.belnet.be/ubuntu bionic/universe amd64 avr-libc all 1:2.0.0+Atmel3.6.0-1 [4872 kB]
    Get:1 http://ftp.belnet.be/ubuntu bionic/universe amd64 avr-libc all 1:2.0.0+Atmel3.6.0-1 [4872 kB]
    Fetched 4144 kB in 2min 17s (30.3 kB/s)                                        
    Selecting previously unselected package avr-libc.
    (Reading database ... 186822 files and directories currently installed.)
    Preparing to unpack .../avr-libc_1%3a2.0.0+Atmel3.6.0-1_all.deb ...
    Unpacking avr-libc (1:2.0.0+Atmel3.6.0-1) ...
    Setting up avr-libc (1:2.0.0+Atmel3.6.0-1) ...
    Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
    ubuntu@ubuntu:~$ sudo apt-get install libc6-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    libc6-dev is already the newest version (2.27-3ubuntu1).
    libc6-dev set to manually installed.
    The following package was automatically installed and is no longer required:
      libwayland-egl1-mesa
    Use 'sudo apt autoremove' to remove it.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    ubuntu@ubuntu:~/Desktop/make$  make 
    make: Warning: File 'led.c' has modification time 6814 s in the future
    avr-gcc -mmcu=attiny44 -Wall -Os -DF_CPU=20000000 -I./ -o led.out led.c
    avr-objcopy -O ihex led.out led.c.hex;\
    avr-size --mcu=attiny44 --format=avr led.out
    AVR Memory Usage
    ----------------
    Device: attiny44
    
    Program:      64 bytes (1.6% Full)
    (.text + .data + .bootloader)
    
    Data:          0 bytes (0.0% Full)
    (.data + .bss + .noinit)
    
    
    make: warning:  Clock skew detected.  Your build may be incomplete.
    ubuntu@ubuntu:~/Desktop/make$  make  program-usbtiny
    make: Warning: File 'led.c' has modification time 6738 s in the future
    avr-gcc -mmcu=attiny44 -Wall -Os -DF_CPU=20000000 -I./ -o led.out led.c
    avr-objcopy -O ihex led.out led.c.hex;\
    avr-size --mcu=attiny44 --format=avr led.out
    AVR Memory Usage
    ----------------
    Device: attiny44
    
    Program:      64 bytes (1.6% Full)
    (.text + .data + .bootloader)
    
    Data:          0 bytes (0.0% Full)
    (.data + .bss + .noinit)
    
    
    avrdude -p t44 -P usb -c usbtiny -U flash:w:led.c.hex
    
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: Device signature = 0x1e9207 (probably t44)
    avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file "led.c.hex"
    avrdude: input file led.c.hex auto detected as Intel Hex
    avrdude: writing flash (64 bytes):
    
    Writing | ################################################## | 100% 0.06s
    
    avrdude: 64 bytes of flash written
    avrdude: verifying flash memory against led.c.hex:
    avrdude: load data flash data from input file led.c.hex:
    avrdude: input file led.c.hex auto detected as Intel Hex
    avrdude: input file led.c.hex contains 64 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.07s
    
    avrdude: verifying ...
    avrdude: 64 bytes of flash verified
    
    avrdude: safemode: Fuses OK (E:FF, H:DF, L:FE)
    
    avrdude done.  Thank you.
    
    ubuntu@ubuntu:~/Desktop/make$
          
                
    	 

    This is the site for group assignments:Press here
    led c-code
    Make FIle
    Results of the steps that I did in terminal




    Choose Colour