Search The Web

Sunday, September 18, 2011

My experiment with C++

 
E Balaguruswamy mentions in his famous book object oriented programming with c++ "C++ is going to replace the C language in near future". It is an important thing to all embedded C developers. So it is better to learn C++ quickly.



A good c programmer can learn C++ in only one week!. This I can guarantee you all because i achieved it with the same amount of time :)



One main thing in OOP is, it helps to design the program based on the real life entities. We can easily extract the real time features to the design using the concepts such as



1) Polymorphism - one name multiple forms

2) Abstractions - Provide only the necessary information

3) Encapsulation- Wrapping up of Data and function together

4)Data hiding- Hide the unnecessary information based to safeguard the data

5)Inheritance- Deriving the features from already existing one




For example if want to write program based on line. Then we need to create point as it is basic necessity.

So line inherits the properties of the point also. So we can make point as base class and line as derived class.




Please find the appended c++ program which will helps to understand inheritance clearly.




/******************************************************************************************************
;All rights reserved -embeddedhobby.blogspot. com
;
;A C++ program written to understand OOP concepts 18-09-2011
;Author: eguru
; Inheritance
;Constructors
;overloading
;******************************************************************************************************/
#include<iostream.h>

class point
{
  int x;                 // x coordinate
  int y;                 // y coordinate
 public:
  point(int x1, int y1)  // parametrized constructor
  {
   x =x1; 
   y =y1;
  }

  point()                // Non parametrised constructor
  {
   x =0;
   y =0;
  }
  void PutData(void);    // function to display the point
};


class line : public point            // line is class which inherits the properties of the derived class.
{
 point point1,point2;             // point is base class
   public:
     void DisplayLength(void);
     line (int x1,int y1,int x2, int y2) : point1(x1, y1), point2(x2, y2) // constructor list
  {
        cout<< " line initialised";
            
  }
  line():point1(), point2()
  {
   cout << " line is initialised zero";
  }

};
/******************************************************************************************************
;All rights reserved -  embeddedhobby.blogspot.com
;******************************************************************************************************/
void line::DisplayLength(void)
{
   point1.PutData();
   point2.PutData();
}
void point::PutData(void)
{
  cout << "\n origin x="<<x;
 cout << "\n origin y= "<<y;
}
main()
{
 cout  << "WellCome to C++";
 cout<<" Input 1 to display line";
 int x;
 cin >>x;
 line straight;
 switch(x)
 {
  case 1:
       cout<< " Line coordinates are as follows" ;
       straight.DisplayLength();
       break;
    
  case 2:
                cout<< " Add code for your experiment" ;
       break;

  default:
    cout << "  Bye Bye ";
       break;
 }
    point ORG;
 cin >>x;
 return 0;
}


For any further information please feel free to mail at contact_ehobby@gmail.com -eguru

Wednesday, July 20, 2011

Computer vs Embedded systems

Hardly we can find any difference between General purpose computer and Embedded systems when we glance over the capabilities. Basically both are computing systems, both have the combination of software and hardware.  But still why there is a separate field called as  "Embedded systems" other than the General purpose computers/ personal computers?
       But if we get in to the detail based on the different integral parts of the system we can list few important differences.
   
No
Characteristics
Embedded System
General Processing Computing System
1
Product quality/performance
Sophisticated
General
2
Presence in a system
Usually it will be  a small part of a large system
Whole system
3
Time constraint 
Output should be available in the specified of time else it may lead to failure
No such strict rule for most of the task
4
Flexibility
Less flexible for modifications as it is developed for specific purpose
More flexible for up gradation 
5
Input/ Output
Nonstandard input output devices.
Standard input output devices
6
System software's used for development 
Generally cross compilers and cross assemblers, RTOS
compilers, assemblers, OS etc
7
Power
Demands low power consumption to sustain in the market
Less restriction. 
8
Packaging of the product
Will be unique and varies from product to product
Most of the time well defined
9
Examples
Washing machine, Cell phone, set top box
Personal computer, Server etc





For any further information please feel free to mail at contact_ehobby@gmail.com -eguru

Friday, April 1, 2011

News from IAR

Please find the latest big news below. A new state machine design and implimentation tool set
 
Click here to view this message in a browser window.
IAR Systems - The Code To Success
 
Welcome to e-News from IAR Systems
   
 

This month's industry highlight—Embedded World—was a great success. Thank you to all customers who visited us. We hope to see you at the next big eventEmbedded Systems Conference.

The Power Debugging theme continues, here you'll find the third article in the series. Even more power debug material is to come. Enjoy!

Best regards,
Marie Gylldorff
Corporate Marketing Manager
IAR Systems

 
 
 
 
EDN Innovation Awards

IAR Systems is a finalist for EDN Innovation Awards 2010. If you haven't voted yet, now is your last chance. Voting ends March 31.



 
 
Power debug toolbox of the month

Got some time to spare? Take a nap!
Most embedded systems spend a lot of time waiting for something to happen. It could for example be waiting for user input, a peripheral unit, or just for some time to pass. While waiting, the microcontroller will consume power as long as the CPU is executing instructions, even if it is doing nothing. Fortunately, modern low power microcontrollers provide a plethora of low power modes in which the application can take refuge while waiting, saving a little bit of energy.

Click to continue...

 
 
 
IAR visualSTATE 6.4
  State machine


March saw the arrival of the latest release of IAR visualSTATE, the advanced state machine design and implementation toolset. Let us take a brief look at what's new in this release:
  • A new XML-based file format for the design information
  • Addition of IAR Information Center
  • Addition of examples, including one that can play CD music on your PC 
  • IAR visualSTATE is now a true Unicode application
This might not seem like much to brag about, but let us examine each feature in a bit more detail.
 
March 2011
 
Product News


 

Want to try the latest edition of a product? Evaluation editions of all new software products are available from www.iar.com/downloads

IAR Embedded Workbench for MAXQ
Version 2.30 includes new optimizations and improved hardware debug support.
Click to continue...

IAR visualSTATE (see also article)
Version 6.4 adds IAR Information center and support for diff and merge.
Click to continue...

IAR Embedded Workbench for CR16C
Version 3.10 adds IAR Information center, C99 compliance, debugger improvements and support for new devices.
 
Events

 
 
ESC Silicon Valley 2011

ESC brings together the largest community of designers, technologists, business leaders, and suppliers, all in one place. May 2-5, IAR Systems will be at ESC in San José, California, and we will be hosting several seminars. For more information, and to register for our sessions, go to www.iar.com/escsv2011

TI TechDay
Join Texas Instruments for a day packed with technical design seminars, May 3 in San José, California.
Detailed information and registration

Embedded Systems Expo—ESEC

May 11-13, IAR Systems will participate at ESEC in Tokyo, Japan.
 




       

 

 
 
Copyright © 2011 IAR Systems AB
P.O. Box 23051 SE-750 23 Uppsala, Sweden
If you do not wish to receive future newsletters or invitations from us, click here

www.iar.com