Life is like a Battery

September 1st, 2010 Jeega No comments

Life is like a battery. It will be in good and active condition when we first buy it. Then the charge keeps drowning below the nominal value slowly, we’ll newer notice this process. Some people are conscious about this and gets to sense the end and take necessary remedy action before it gives trouble. Some just says what the hell happened and throws away even the device to which it supplies power. Newest in our life always drives us to euphoric state, then gradually it will loose its shine.

Fortunately our life is like a rechargeable battery. To recharge, it requires some time. And some conscious foresight into the future as its source of supply.

Definitely one day that battery will reach its end, not-rechargeable-anymore condition. At that time, best thing to do is accept the fact and if possible through it away and buy a new one. But condemning at the end of single cycle and end of life has huge difference. Most people knows the difference for the rechargeable battery and refuses to understand when it comes to life.

Wandering Thoughts – 2

August 5th, 2010 Jeega No comments

I am reading a book now. “How to Stop Worrying and Start Living” by Dale Carnegie. So far the book was very very very good. I have no doubt the rest will also be like that.

At one part, to avoid unwanted worry, he advocates to accept the inevitable before it happens. Be ready to face the worst that could happen to have a clear undisturbed mental activity while working. Wonderful.

And at  other chapter of the same book, to succeed in whatever work you do, he advices to be optimistic and think only about the positive things. He says what u expect is what you get. Got it.

But isn’t there a contradiction  between these two statements??

Maybe completing the book will help clearing the ambiguity

Wandering Thoughts – 1

July 30th, 2010 Jeega 1 comment

There is some greater power which has control over all the living and non-living things in this and all other universes. Totally agreed. Denying ideologies that is far from one’s comprehension is stupid.

I go to temples. I perform all rituals which I mostly don’t understand. I know some poeples who goes to every pilgrimage to search god, to feel god. But sometimes I feel something is weird in it. What about searching it in our home.. in ourself..

What about worshipping parents, who are ready to give whatever you wish for within their capablilites. Is it not better than worshipping where the results are unsure? I personally feel few minutes in absolute silence and just some well-wishers advice will solve any unsolvable problems.

Categories: Uncategorized Tags: , , ,

Git – Source Code Management Tool

July 18th, 2010 Jeega No comments

Two year back I realized this,  software, firmware or any type of codes written even by genius is crap without proper code management. Real headache starts just after the coding phase is over.  There are many, many, many problems involved in maintaining the codes. There is possibility, a bug pops up two years after the development phase is over and you have to go back to the codes to debug that. Even for the person who wrote the code, it takes considerable amount of time to re-familiarize it, let alone others.  So some sort of code management tool is essential for a project even when only one person is involved in coding process. Mostly my projects involves only one programmer and that is me.

I used some version control systems before[SVN, Visual Source Safe, etc]. Most of them are Centralized Version Control Systems. But none is suitable for a programmer like me or I can say I am not suitable for such tools. Recently I started using GIT, then I realized I am looking for Distriubed Version Control System and not  Centralized Version Control System. I was not aware of the difference back then. GIT is one of the best and fastest Source Code Management tool I have ever used. Click here to know more about git. I am now using Git for all my projects, even for the documentation projects.

For a newbie, this video should be the starting point. Have fun with Linus Trovalds.

Raavanan – Review

June 20th, 2010 Jeega 2 comments

Cast :

Raavanan (Veeraiya) – Vikram
Ram (Dev) – Prithviraj
Sita (Ragini) – Aishwarya Rai Bachan
Lakshman (Singarasu) – Prabu
Hanuman (Forest Officer) – Kathick
Surpanagai (Vennila) – Priyamani

This movie should be named as raavanayanam. Although the disclaimer clearly mentions “All the characters and events in this film are fictional, and any resemblance to real people or incidents is purely incidental” I cant resist myself to relate the characters with real ramayana.

-Veera was portrayed as some sort of terrorist who fights for his tribes.

-Dev(Police) comes to veera’s place to destroy veera and his cult.

-Veera was shot on neck by dev at her sisters marriage function. He was taken out of the scene by his own persons for first aid. But her sister was captured and taken to police custody instead.

-Her sister was ill treated by many police officers. I hope everyone understand what ill-treatment means at this situation. She kills herself.

-Veera erupts and his anger is directed to dev and other police officers. His group kills every policeman before their sights and kidnaps sita – oops ragini to get revenge for her sister’s death. Eventually falls in love (kind of) with her.

-Ragini held by Veera in forest for exactly 14 days
. Initially she hates veera. After knowing the truth and why all these things are happening, her heart softens.

-Meantime, dev comes to forest to rescue ragini and determined to kill veera this time.

-The forest officer who helps dev does all kind of “kurangu settai”
and also goes to find sita alone and negotiates truce.

- Veera’s other brother (prabhu is his first brother) also insists on truce and travels alone to met Dev for truce negotiations. But Dev kills Veera’s brother.

- Again Veera erupts, destroys the army camp nearby where Dev stays, fights with him on a small rope bridge which I thought as climax. Veera saves Dev instead of killing him even-though he had his chance. Why? yes you guessed it. For ragini. He releases Ragini and evades from the scene.

- Dev doubts ragini after she was rescued from veera while they were on the way to somewhere by train. “What makes you doubt me?” she asks. “Because veera said you are not pure like before” he replies. Ragini gets angry. Stops the train by pulling the brakes chain. And directly goes to Veera to confirm it.

- Veera was happy seeing her again. She finds out that Veera never said the statements  which Dev said he said. But Veera understands the plan behind the drama and calls out Dev who followed ragini to find him.

- Dev comes out of the fog along with hundred’s of army mans. Ragini tries to protect Veera but he shoves her aside. At the same time many bullets hits him and Veera dies with smile in his face, joyfull, she came back to him.

What a good story. sorry if you are irritated by  my narration.  First, the story is not new to us. second, it was pictured in confusing way what they call it as manirathinam’s style. Dialogue is not quite understandable, another agmark seal of manirathinam. Details in every single frame is above than perfect. Music is good.

We can expect some reactions from Hindu activists because Raavanan here is portrayed as a hero at last. Anyway, the movie is total disappointment for me.

Theodore Boone – Review

June 17th, 2010 Jeega 1 comment

Author : John Grisham
Published Year : 2010
Publisher : Hodder
Genre : Law fiction
ISBN : 1444714481

On reading the synopsis on the backside of this book at the bookshop, I gave up the idea of buying “Winner Stands Alone” by paulo coelho which I choose already and choose this book instead. I like to repeat the synopsis here so that i don’t have to explain the story myself.

“A perfect murder

A faceless witness

A lone courtroom champion knows the whole truth . . . and he’s only thirteen years old

Meet Theodore Boone

In the small city of Strattenburg, there are many lawyers, and though he’s only thirteen years old, Theo Boone thinks he’s one of them. Theo knows every judge, policeman, court clerk—and a lot about the law. He dreams of being a great trial lawyer, of a life in the courtroom.

But Theo finds himself in court much sooner than expected. Because he knows so much—maybe too much—he is suddenly dragged into the middle of a sensational murder trial. A cold-blooded killer is about to go free, and only Theo knows the truth.

The stakes are high, but Theo won’t stop until justice is served.

Brimming with the intrigue and suspense that made John Grisham a #1 international bestseller and the undisputed master of the legal thriller, Theodore Boone: Kid Lawyer will keep readers guessing and pages turning.”

Now I feel the synopsis created too much expectation. I expected some dramatic intriguing sharp turns in the plot but couldn’t find it anyhow. “HALF THE MAN, TWICE THE LAWYER” is the caption, I expected theo — the hero boy — to argue in the court like a lawyer twice intelligent than normal lawyers. But he was not even summoned to stand in the witness dias — which is dissapointing.

I’d say author wrote it realistically more than dramatically.  The plot is logically convincing. Author snaps with the answer — “What else do you expect a 13 year old boy can do with law?” — for our expectations. You won’t feel the time pass while reading.

My rating : 7 out of 10

ARM – Embedded Software Development Tools (Part 2)

June 15th, 2010 Jeega No comments

In the last post we’ve seen the purpose of Development Tools. Now we’ll see some of the development tools available for ARM Architecture.

There are wide variety of options available. I have listed only few which I consider worthy.

1. Keil Realview Microcontroller Development Kit
2. IAR Embedded Workbench for ARM
3. GNU Tools for ARM
4. WinARM

One have to consider the following points before choosing a development tool

1. Programming Language – Mostly C is enough, some high-end applications requires C++. It is possible to create a compiler with COBOL, BASIC, FORTRAN. I doubt tools with old programming languages available nowadays. Assembly language is mandatory for application that requires embedded operating system.

2. Level of sophistication – This point is very important for a proprietary development tools. Most expected in proprietary tools and least expected in open source tools. Code navigation,  project management, tool-chain automation and simulation among other things are very important for large projects.

3. Operating System for Development (Host Platform) – Windows or Linux or MacOS. Some tools work in different platforms and some don’t

4. Level of optimization – There are many different ways to compile a code from high level language to machine code. I compilation should result in faster execution speed and smaller memory footprint. In embedded systems where the resources are limited, optimization of code comes into play.

5. Debugging Options – Many debugging methods are available — JTAG, BDM, serial debugging, etc. It is not mandatory. I know some people who don’t use debugging options, i have also seen many broken stuff nearby their workplace. Working without a debugger is definitely pain in the arse.

6. BUDGET – Proprietary / Open Source. May depend on all the above points.

Keil RealView MDK

I am using Keil development tools for 8051 right from my diploma time. I love to work with keil because i know it better and I don’t know/have any other tools to compare it with — so far. It is obvious Keil is my choice for ARM too. Advantage is this tool is from ARM Company. It is better to use ARM’s own Development Tools. Some of the features are

- Supports 4 different optimization levels
- Supports wide variety of devices from different manufacturers
- Supports C,C++ and Assembly programming language
- Supports simulation
- Can automatically creates startup code for different processors and architectures
- Real-time libraries are available to ease the programmers work.
- Debugging the processor with Keil is cool with uLink2 USB-JTAG Adapter
- Comes with RTX Real-time Kernel (no need to worry about OS)

Some of the disadvantages i noticed are

- Only supports ARM7, ARM9 and Cortex M Architecture. hope they’ll add more in future.

click here
to know more about RealView MDK

IAR ARM Workbench

IAR is also a competent IDE. Equally good compared with Keil.

- Supports ARM10, ARM11, SecureCore and Xscale as well.
- Plugins available from different Embedded OS vendors
- IAR J-Trace and J-link Adapters are available for debugging
- 32KB Kickstart Edition is available for free. Best for DIY aspirants.
- Supports C,C++ and Assembly Programming Language.
- Can automatically generate code from IAR visualSTATE. Very useful for non-programmers.

click here to know more about IAR Embedded Workbench for ARM

Both Keil and IAR tools will work only on windows OS. Can make it work on Linux but drivers for debug adapters are hard to find. Have to spend huge amount of money to buy these softwares. Most of the processes like compiling, linking, assembling will be done with just a press of shortcut key.

GNU Tools for ARM

Here we are at open source part. no money required tools. As I already mentioned using open source tools is little difficult. Open source tools lack sophistication like in Proprietary tools, but more powerful. One have to do little manual work to make the tool work. Compilation with just a shortcut key won’t work in such tools.

GNU Tools for ARM is collection of different tools made to work together.

- Can make it work in Windows, Linux and MacOS. Requires cygwin in windows.

Disadvantages are

- Support for limited devices.
- Have to manually write linker scripts for unsupported devices
- Project management, code navigation is tough for larger projects. Can make it easier with Eclipse IDE for C/C++.

Again we have to spend time configuring Eclipse IDE.

click here
to know more about GNU Tools for ARM

WinARM

WinARM is another open source tool built using GNU Tools for ARM. Doesn’t require cygwin.

- Project Management and Code Navigation through Programmers Notepad – Open source code editor.
- Limited support for devices compared to commercial tools.

click here
to know more about WinARM

GNU tools for ARM and winARM requires little expertise in command line and shell scripting. have to dedicate separate post for each. To start with I prefer Keil Evaluation version or IAR 32KB kickstart edition download-able at their websites

Team Viewer

June 14th, 2010 Jeega 4 comments

Great tool. How come I not heard of this software this long time? I have spent, actually wasted, many hours of my precious time over phone helping peoples to solve software problems.

Team Viewer is remote desktop connectivity software with no hassles involved. Important advantage is you don’t have to install it in the system. We can carry the app in the thumb drive and use it from anywhere to control the PC at home/office. In softwares like this, doubt may arise regarding security. No need to worry, it comes with 256 bits AES encoding.

There are other softwares available for this purpose but most of that requires installation or configuration which is difficult when the partner/user on other side is less skilled.  In case of Team Viewer inform the other person to download the app, run the app, get the temporary session ID and password generated for the system, done. you’ll have the control for other system next moment. As simple as that.

To know more about Team Viewer. Click here

ARM – Embedded Software Development Tools (Part 1)

June 5th, 2010 Jeega 2 comments

We all know, for a developer, a processor is of no use without its development tools. I remember in my college days how we, students, used to program the 8085 microprocessor kit. we have to first write the algorithm, convert the algorithm to mnemonic codes and to its opcode. Then we have to key in the HEX machine codes through keypad. That is like rocket science for most of us. Because we were trained that way. Gone are those days. But that method is still used in colleges to train students. What we learned at that stage is raw assembly language programming. Assembly language is effective for small programs and when the complexity of code increases it is hard to manage the code. But I know some peoples still use the assembly program for huge programs. Its not that it is impossible.

Now much more sophisticated tools are available to help programmers. We are going to see some of the development tools available for ARM processors. Development tools means collection of software programs running on host computer. Now most of the tools available are cross development tools. Cross development means generating codes for a platform in some other platform. For example, we are going to install all our programs in Windows OS. Say Windows OS is running on a Pentium Processor. Pentium processor itself is a platform which has its own instruction set. So we are using Pentium platform to generate codes for our ARM processor. Don’t get confused on the jargon “platform”. Platform here means series of processors which use the same instruction set. Its the development tools job to take care of the complex creation and conversion of output file from one platform to another. Purpose of these programs is to create a programmable binary file for the target processor. Some of the programs are

- IDE
- Libraries
- Compiler
- Linker
- Assembler, etc.

One have to clearly understand the purpose of all these programs — to effectively use it.

IDE (Integrated Development Environment)

IDE has the graphical user interface where user enters their code. It is IDE’s task, while building, to pass the source code to compiler/assembler which generates object files, pass the object files to linker which generates programmable binary files. We’ll see the list of IDE’s available for ARM later.
To know more about what IDE in general. click here

Assembler

Every family of processor has its own instruction set. Each instruction is called as mnemonic.   It is the assembler program’s job to do the conversion from mnemonics to machine-code. Because of these variation in instruction sets between different processor, the assembly codes are not portable. Whereas, codes programmed in High level language like C or C++ is portable.

To know more about assemblers. click here

Compiler

Compiler is a program which converts code from one computer language to another computer language. Since writing a complex program in assembly language is hectic, we need to go for higher level languages like C or C++. Say we choose to write codes in C language for our program. It is compilers job to convert the codes from C language to Assembly language.

Lets see an example. consider the following expression

a = 0×10;

This is a simple expression in C which assigns the value 10 to variable ‘a’. I hope the reader knows what ‘a’ is – An integer pointer to a memory location. consider it is initialized with register keyword. ‘register’ keyword makes the pointer to point at any one of the processor register (say R1). We are passing value 10 to that R1 register in processor. Equivalent code in assembly language for ARM processor is

MOV R1, #0×10

Compilers job is not just limited to code conversion. Some compiler directly produce the machine code reducing the requirement of assembler in between. It also gives notification if the code contains syntax and semantic errors. Another main job is code optimization. We’ll see further about compiler later.

To know more about compilers. click here

Libraries

Libraries are codes written by others to reduce the programmers job. Header files are the interfaces to access the libraries. “stdio.h” is a header file for the standard input output library provided by the compiler provider. If you look into the “stdio.h” you will just see the declaration for the functions like “printf(…)” and “scanf(…)”. Mostly source code for libraries are not accessible, it comes in the form of object files which don’t require compilation. It is already compiled and ready to use.

To know more about libraries. click here

Linker

Obviously question will arise  ”Why Linker? Isn’t sufficient to use just Compiler and Assembler to generate code?” Yes, it is possible if you are the sole programmer of your project and if you resolved not to use other peoples help in your program. At some point of time, for projects, programming without the help of others code is not possible.  Often the programmers tend to use his own codes from previous projects. For that, modularization of the codes is very essential. We all know modularization means dividing a task into smaller reusable tasks. Instead of typing all the required codes in single ‘main.c’ file, we can identify the reusable codes and move it to into different files like ‘timer.c’, ‘spi.c’, ‘uart.c’, ‘adc.c’, etc.

As we mentioned before compiler and assembler generates the machine-code from source code. But in the situation where many modules interact, the compiler and assembler generates the object file suitable for the linker. compiler will generate ‘main.obj’, ‘timer.obj’ and  ’spi.obj’ files for ‘main.c’, ‘timer.c’ and ‘spi.c’ respectively which is suitable for linker.  Then the linker generates the output file that can be programmed to the processor. One main take of the linker is address resolution. We’ll see in-depth details of the linker later.

To know more about linker. click here

I hope you understood the purpose of the tools at-least through the links provided, if not by my description. I like to refer the book “An Embedded Software Primer” by David E Simon. Good book to understand the embedded software concepts. Here is an image from that book specific to our topic.

I think the above contents are long enough for a single post. Remaining i’ll write in the next post.

Ready to lay hands on ARM

June 1st, 2010 Jeega No comments

Technically can’t do that because most of the Integrated circuits are static sensitive. :)

Its always hard for me to choose which processor to use in next project.

First choice is NXP 89V51RD2BN. It has 64kB Flash, 1kB data RAM. 64kB code memory is ok but 1kB of RAM is not enough. My project involves data acquisition, the acquired data’s needs to be transfered to PC. 89V51 got only one serial port, and serial ports are nearly extinct in commercial PC’s. So, processor with USB peripheral is required.

Next choice is Freescale MCF52223. 32 bit, 256kB Flash, 32kB RAM, USB On-the-Go with Coldfire Architecture. This is suitable but target ports for this processor is not readily available from many RTOS’s.

Finally I settled to NXP LPC2148 which is 32 bit, 500kB Flash, 40kB RAM, USB device (not host) with ARM7TDMI-S Architecture. Advantages of using ARM Processor is virtually all RTOS’s readily provide ports. Many ready-to-use libraries are also freely available. You can know about ARM Architecture in Wikipedia.