Saturday, 30 July 2016

Sharing PC Internet to Beaglebone over LAN

Want to access internet on your Beaglebone via LAN, but don't have LAN port nearby?

Well you have a LAN port near by and that is your PC's Ethernet port (of course If it is free , meaning you are accessing internet on your PC via WiFi)

Microsoft has a functionality called Internet Connection Sharing (ICS) that is made just for this purpose.
We will be using Windows 7, but earlier versions are similar.  Be sure your Windows 7 computer is already connected to the Internet via wireless before you start.

Click the Windows icon and type "view network connections", hit "Enter" on your keyboard

Right-click on the icon that represents your wireless connection to the internet, then click on "Properties" 

Go to the "Sharing" tab and check the top box, then choose "Local Area Connection" from the drop down below. Don't check the second box. 

Press Settings and select all services required on your Beaglebone and press OK

When everything is ready to go you will see the word "Shared" under your wireless connection to the Internet. Its sharing with your computers Ethernet port. 

Now Restart your Beaglebone and it will dynamically get an IP address and access to internet via Ethernet.  

Now how would you know the IP address of beaglebone's Ethernet port?

That's just simple: As you already connected to the Beaglebone through USB (if not please connect), Open terminal on your Linux PC, and type 

sudo ssh is the IP address of beagle bone black and is hard coded so its same for all BBB.

Now the terminal will ask you for the password, Please enter your password. This makes you enter into the BBB's terminal. Now type 


This will give you Ethernet address of your BBB Ethernet port, which is written against eth0 

Saturday, 14 November 2015

Object Oriented implementation of Singly Linked List in C

Hi folks, 

How are you doing, Have you got a chance to see my last blog. Please have a look and do comment.
Yet again i have implemented one more data structure in c++ style. This time it is singly linked list. There are three files LinkedList.h, LinkedList.c and main.c. I tested it on my system many times and seems to have no issue, Nevertheless your valuable inputs are welcome, please do comment. I will modify the code accordingly. Feel free to use the code for educational purpose. 

/*Rev 0: First implementation*/


typedef struct LinkedListClass
    void *Head;
    unsigned int DataCount;
    unsigned int DataSize;
    void* (*CreateNewNode)();
    char (*AddNode)(void *Object, void* Data);
    char (*RemoveNode)(void*Object);
    char (*InsertNode)(void*Object, void* Data, unsigned int Position);
    char (*DeleteNode)(void*Object, unsigned int Position);
    void* (*ReadNode)(void*Object, unsigned int Position);
    char (*ModifyNode)(void*Object, void* Data, unsigned int Position);
    char (*DeleteLinkedList)(struct LinkedListClass** Object);
    unsigned int (*LinkedListSize)(void*);

Object Oriented Implementation of Queue using arrays is C

Hi Friends..Following is a simple code for Queue using arrays. The difference is that it is implemented in C++ style. I have checked it on my system and is working perfectly. You can use this code freely for educational purpose. Please leave comments and let me know if you see any scope for improvement. I will modify this here and increment revision number
/*Rev 0: First implementation*/

#include <stdlib.h>
#include <stdio.h>

#define MAX_SIZE 10

typedef struct QueueClass
    char q[MAX_SIZE];
    unsigned int DataCount;
    unsigned int Head;
    unsigned int Tail;
    char (*Enque)(void*,char);
    char (*Deque)(void*);
    unsigned int (*Size)(void*);
    char (*GetData)(void*);

Saturday, 9 November 2013

Embedded engineers sometime get confused thinking that whether the code they are writing is embedded software or firmware. This gives birth to the question that whether they are embedded software engineer or firmware engineer or both

Having years of experience in embedded system and after studying a lot I finally concluded following, please correct me if I am wrong somewhere

First of all embedded software/firmware resides on a small amount of memory such a flash, NVRAM or RAM compared to the software which resides on a PC hard disk.

I would like to explain through examples.

Consider a scenario:
Suppose a company wants to make a software for a washing machine 

One possibility is that only one engineer is writing code for initialization of all  peripherals and implement all the functionalities needed by the washing machine, thus in this case the whole code is called firmware and the engineer will be called firmware engineer.

Another possibility is there are two engineers involved in writing the code for the machine. Engineer1 writes a boot-loader, the basic function of which is to initialize the peripherals according to the user configuration (default if user configuration is not present) and waits for the embedded code over any communication medium such as Ethernet. As soon as the boot-loader receives that embedded code, it checks for its genuineness and flashes the code in the flash memory of washing machine. After flashing the boot-loader gives control to the embedded code so that the washing machine can run. Now here the boot-loader code is the firmware and Enginner1 writing the boot-loader code will be called firmware engineer.

Now here the Engineer2 is responsible for providing the configuration parameters of the peripherals such as baud-rate and writing embedded code according to the end-user needs such as for how long the motor revolves in one direction. Here the embedded code is called embedded software and the Engineer2 will be called embedded software engineer.

Firmware may be permanently stored in the device ROM or may be loaded by the PC at the time of initializing the device.

Thus  the firmware is a software which is needed for a device, whether its an IC such as any Programmable logic, any embedded device such as router or machine such as big printing machine to perform its basic function.