Contact Final Project Assignments My Lab About Me

Week 9

Embedded Programming

Assignment 09

Group Assignment:

  • Compare the performance and development workflows for other architectures
  • Following are a few different microcontroller architectures available in the market. They are differentiated on the basis of their operation at the lower level. While 8051, AVR and PIC come in 8-bit, 16-bit and 32-bit, the ARMs generally come in 32-bit and even 64-bit. The 8051, AVR and PIC work closer with the I/O peripherals and can be lower power and faster as a result.

  • RISC and CISC Architectures
  • RISC (Reduced Instruction Set Computer) performs more instructions with lower cycles as compared to CISC architectures. CISC processors include the Intel x86 and 8051, Motorola 68000 and Zilog Z80 families.One of the key advantages to RISC is the load/store architecture which separates memory access and ALU operations (arithmetic logic unit). This improves cost, power consumption and heat dissipation, making them desirable for light, battery operated devices. RISC processors can be found in the ARM, AVR and PIC microcontrollers.

  • AVR
  • AVR is a family of microcontrollers developed by Atmel that use the RISC processors. AVR are most commonly used in the Arduino line of open source board designs. These are available in 8-bit tinyAVR, megaAVR and XMEGA. AVR32 is the 32-bit offering, which was intended to compete with ARM processors. These are not compatible with the original ARM and include additional SIMD and DSP instructions as well as audio and video processing features. One of the nice features of most AVR models is that they can reserve a bootloader region to store re-programming code. The code can then re-program through any interface available.

  • PIC
  • PIC stands for Peripheral Interface Controller. It is a family of microcontrollers developed by Microchip with a wide variety of options available. They are not strictly RISC processors as they differ very slightly in their operation. The product range includes the 8-bit PIC10, PIC12, PIC 16 and PIC18, the 16-bit PIC24 and dsPIC and the 32-bit PIC32MX, PIC32MZ, PIC32MM and PIC32MK. The 8-bit range focuses on lower cost, the dsPIC focuses on digital signal processing. The PIC32 series of microcontrollers uses the MIPS32-M4K core technology, which is a 32-bit RISC architecture. MIPS is a direct competitor to the ARM processors covering all types of applications in home entertainment, embedded and networking products, mobile, wearable and IoT devices.

  • 8051
  • The Intel MCS-51 (also known as 8051) is a CISC architecture. These are available in 8-bit, 16-bit and 32-bit microcontrollers. 8051 silicon IP cores are typically smaller size, lower power compared to ARM Cortex-M and MIPS processors. They are used in everything from USB flash drives to washing machines and complex wireless communications systems-on-chip

    Individual Assignment:

  • Datasheet
  • The purpose of reading the datasheet is to know your Microcontroller. Before starting to work over any device you must know its features, limitations, benefits and many other qualities. The datasheet of ATtiny 44 can be downloaded from Here.

    Initially, you may find it very lengthy and tough task to read the datasheet of any device, but you can avoid it by going to information that is important from your perspective as a programmer. Hence the images below are showing the features and pin configuration of ATtiny44.

    From features, we came to know about many things, few of them are:

    Features of ATtiny44

    Another important thing about a chip while programming it is to know its "Pin Configuration". Without this information you may not be able to know where your I/O devices are connected. Pin configuration can be seen below:

    Pin Configuration of ATtiny

    Programming the board

  • Programming the board using Arduino IDE
  • Inorder to program your board using Arduino IDE, first you have to perform following steps so that the IDE can detect your board:

    Steps for configuration of board using Arduino IDE

    After configuration of my board, I uploaded the blink file from "Examples" available in Arduino IDE. Steps for that are mentioned, shown below and the results as well:

    Steps for uploading blink program to your board using Arduino IDE

    Results of Blink on Hardware

    Inorder to make the Arduino Uno code for button and LED, compatible with ATTiny44 we need to take care of their corresponding pins as well. First we need to see the Pins of ATTiny44 and which Arduino pins they are replicating in the ATTiny circuit. This can be done by having a look at the image given below which I downloaded from HERE.:
    Pinout diagram of ATTiny44

    Now from the board file of Eagle for this circuit, we can check and compare that on which pins of ATTiny the button and LED are connected and what those pins will be for Arduino and replace them in the Arduino code accordingly inorder to make this circuit work properly. This will be clarified by looking at the below given picture:
    Eagle board file showing the connections of Button and LED

    Once the board started working properly, now i uploaded another program to check whether the button connected to circuit is working properly or not. The program uploaded is shown below:

    Code for operating button

    The board can be seen operating using the button in the GIF below:

    Operating the board using button

    The .hex file for this program can be saved from temporary files if needed. I copied it so that i can burn it later using another software.

    Hex file of the code to operate using button

  • Programming the board using avrdude
  • After uploading the program using Arduino IDE, now we will do it using "avrdude". First we will download and install avrdude from Here. Once it is installed, now you need to perform folloiwng steps:
    Steps to setup avrdude

    To check whether avrdude is installed successfully or not, go to "Command Prompt" and then to repective drive and write avrdude. If it is installed properly then you will have the following results in your command window:

    Result of avrdude successful setup

    Now we will upload the .hex file that we copied previously from temporary files to the board using avr dude. For that we will first go to the directory where that hex file is copied using the "cd" and the complete directory address of that location. In my case that address is "G:\BE Electrical\FAB Lab\Week9".

    Since i am using ATtiny and my ISP programmer so i have used this (avrdude -v -pattiny44 -cusbtiny -Uflash:w:Button.ino.hex:i) command to upload the .hex file to the controller. You can also use this command if you are using these components as well.

    After writing the above mentioned commands you will have the results shown below, which means that you have successfully uploaded the code to your board using avrdude.

    Image showing the successful upload of Hex file using avrdude

    The results of uploading hex file using avrdude can be seen in the video mentioned below:

    That's all for week9..
  • All the Files of Week 9 can be downloaded from Here.




  • Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.