Week 8

About Me Assignments Final Project Fab Lab 2017
About Me Assignments Final Project Fab lab 2017
×

EMBDEDED - PROGRAMMING

This week after Neil's lecture, I got a fair idea how to go through this week's task. Which looked fairly easy for me, as it depended fully on the programming side. But I didn't the hidden challenges behind the all electronics designing and the pin structure.

individual assignment

Learning outcomes

As this week heavily focused on Embeded Programming, my first step was naturally to get a little headstart to get the information about the hardware and I started reading the higly boring "Microcontroller Datasheet" to get a general idea abou the Microcontroller and its structure.

After reading the datasheet, I would highly recommend you guys to take a sip and try to read the datasheet, it helps you alot atleast in the understanding of the Microcontroller structure, and the other components like Registers, its Architecture (RISC and SISC) and others.

MC Pin Structure

Microcontroller Pin Structure

Once I understood the basics of the Microcontroller, now it was time to dive deep in the programming side. I have tried multiple platforms and programming langauges to program my board.

The first and the foremost thing was to download the programming environment, so I downloaded the Arduino and installed it on my pc.

Arduino

Downloading Arduino

After the installation of arduino now it was the time to install the ATTiny plug-in in arduino as by default Arduino doesn't support it.

First thing is to open the Boards Manager from tools menu

MM board checking

Opening Boards Manager

And then search for the ATTiny in the search bar

MM board checking

Installing ATTiny

After the installation of ATTiny, now it was the time to check whether my board works or not, so I properly checked the board using Multimeter, I checked all the inputs and outputs pins on the board to confirm everything seems to work, and I found an issue. The resonator attached to the board wasn't working properly so I had to desolder it and re-attach it so that it works, and it really was a challenge but I did a few tries and finally it worked.

MM board checking

Checking the board

MM board checking

Checking the board

After confirming the working of the board, now it was the time to go for the programming, as I already had programmer available, now it was just time to setup the arduino to work with my board.

Setting the environment

Setting the Arduino Environment

Once the environment was ready, all the tools and the settings ready for my "ATTiny Microcontroller", now it was the time to set the programming for the board. I chose a simple Blinking Program to check whether my board is working or not?

Programming ATTiny

Blink Program

Connecting the board to PC

Connecting the board to PC

After connecting the board, now it was time to upload the code to the device, and once the code is uploaded, it was time to check wether the desired output is achieved or not ?

Blinking Program Worked Perfectly

Blinking program worked perfectly

Well after the coding in Arduino, I tried other platform, and I started working towards C# with Visual Studio.

Visual Studio

Visual Sutdio is a great tool from Microsoft. It's available in many versions I used the free version ( Visual Studio Community Edition ), you can download it from here

Visual Studio Installation Guide for Arduino

Downloading VS 2015
Downloading Requirements
Download the ISO file of VS 2015
Install it with c++
Checking the VS 2015, that the arduino project is available or not

Installing Visual Micro

After you've installed Visual Studio with C++, you need to install the FREE plugin which is called Visual Micro. It contains many features such as :

The Visual Micro plugin will ask you about which version of Arduino IDE is installed on your pc and will try to locate it. -make sure the Arduino IDE is installed-

If it doesn't allocate, mostly the Arduino IDE is installed in C:\Program Files (x86)\Arduino

Visual Micro Installation Guide

Install Visual Micro with selecting the as the plug-in for the already installed VS 2015
Installing in progress
Installation Completed

Once the Visual Micro is installed, you can see multiple changes in the Visual Studio

Blinking Program Worked Perfectly

Arduino Project can be created from menu

Blinking Program Worked Perfectly

Arduino Bar is added as well as the VMicro Menu from where you can select multiple settings

Lets create a new Project of Arduino and started coding for Arduino

Blinking Program Worked Perfectly

Creating Arduino Project for Arduino

And now its time to start the coding, well it was much simpler than coding in the Arduino Environment.

Blinking Program Worked Perfectly

Programming Code for the Blinking Project in C# (C - Sharp) for Arduino Uno

Blinking Program Worked Perfectly

Now it was the time to upload the code and check if it works

Blinking Program Worked Perfectly

The Code uploaded successfully.

Blinking Program Worked Perfectly

Blinking Working.

Blinking Program Worked Perfectly

Blinking Working.

I also tried to work with Java Environment, to find the work around for Arduino, well it was really difficult and it only gives the basic wrapper functionality as you still have to program the main functionality in Either AVR Dude or in Arduino.

Files available to download

And thats all for this week.