Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

Monday, July 23, 2012

How a software interacts with hardware? - Basics of Computer Electronics

In modern computer programming, every software is written using a software programming language. This text program (called high level language) is then converted into runnable (executable - low level language) format by special softwares called compilers(or interpreters). The specialty of this low level language is that it could be understood by a hardware (precisely a microprocessor - a type of electronic component which can perform electronic operation based on software codes). The microprocessor reads the program (low level) and perform the corresponding action.

Now the microprocessor understands a particular code by reading (actually, its sensing electronically) the bits in the particular code. For example if a microprocessor is made in such a way that it will make its 5th pin to +5 voltage level when it reads a bit sequence 0010011, then the processor perform the action whenever it reads a 0010011 in the code. In this way the actions to be performed by a particular microprocessor and the corresponding bit sequence is defined at the time the microprocessor is manufactured. As you know, in a computer system, the microprocessor is the brain, so all the operations are carried out by it.

The computer peripherals (like mouse, keyboard etc) are identified by using configuration files called drivers. These files contain the information that is to be used for interacting with the hardware. The Operating System (windows, linux etc) controls and monitors the peripheral (hardware) control and management.

Tuesday, June 19, 2012

7 TIPS TO PASS ANY EXAM

Here are 7 tips that can help every student to pass exams:

1. No limiting belief please


Remove the limiting belief that you can’t pass. If you believe you can pass or you believe you cannot pass, you are right.

I have seen students under the impression that examiner is their enemy. Please don’t think so. Pass percentage might be low, but students do pass their exams. So, don’t think that you will be in a failure category ever.



2. Understand the structure of paper

First of all, understand the structure of paper – is there any marks allocation for a particular topic? Secondly, if there is marks allocation, is examiner following it? The best thing to do is to review the past five papers.

What is the key topic i.e. examiner’s favorite? Is there any article by examiner in the Students’ Accountant or any other relevant student magazine? Study that topic and prepare for it, even if you don’t like it!


3. Taking notes

Prepare for exams by way of ‘notes’ which you can recall quickly at the time of taking exam. This will help in two manner. First, when you write, you are in better picture of giving your mind instruction through written letters. Secondly, you can revise from your notes instead of opening the book when exam day is near. Here is my strategy for taking notes:

Take a paper and turn it in landscape format. Put three columns in landscape form. Once done, take synopsis of a chapter in smaller fonts and the language which you can easily understand. Write bullet points, important concepts and key ideas which you need to remember.

These notes should be used at the time when paper is on head and you need to revise whole subject in two to three hours.


4. Remembering / memorizing key ideas and formulae

- One of the key ideas to memorize ideas e.g. formulae, is to write them in small charts and hang it in front of your bed.

See those formulae daily before going to bed and rising up. Use different colours and markers.

Believe me, in my statistics paper, I was recalling the formulae in the exact colors which I wrote on charts.


 5. Exam practice

Practice mock exam – be your own examiner. Take any past paper and solve it as a mock exam. Solve past paper in the time allocated in exam. Think you are in exam hall and solve the paper accordingly.

Check your paper and give yourself marks. See how are you performing in mock exam and be sincere to yourself.


6. Time your paper

Here is technique to time your paper: Take total marks and total time. Subtract 10 minutes from the total minutes. Divide the remainder with the marks and you get time per marks

For example: If there are 100 marks for a paper and you have 180 minutes. Subtract 10 minutes. This means you have 170 minutes altogether or 1.7 minutes per mark.

Make sure that you don’t spend more that 1.7 minutes per mark e.g. if a question is of 10 marks, maximum time you should spend should be 17 minutes.

It happens that students try to focus on one particular question and if they are unable to solve it, they get confused. Don’t panic. Start next question. If student has time, he / she can take up that particular question later on.

Try to allocate 10 minutes at the end of exam to review the paper thoroughly.


7. Don’t annoy examiner

See for spelling errors and writing style. Writing needs to be legible and understandable. As a teacher to many students, I have noticed that spelling errors and the way students write, at times, is not understandable. Examiner has very less time to check paper. If your paper is examiner friendly, you are going to attract good marks.

Monday, March 19, 2012

Things you should know before working with Microcontroller Programming

There are a lot of things you need to know before working with your microcontroller project code. I would like to explain some of the important ones. They are:


1.  PROGRAMMING LANGUAGE: A microcontroller program can be written in 3 languages – assembly, c and hex (with the help of a computer). The first two are the practical and most widely used languages. The third method is correct but impractical for large programs.
Each language has its own advantages and disadvantages. In assembly language the program is written using the microcontroller instruction set only. This makes programming in assembly, somewhat complex. The main advantage of using assembly is its fast execution. Because of this reason assembly language is highly preferred in real time systems, for which the time constraint is a serious matter. The ‘c’ language (actually it is micro-c), as its name indicates, is written in the same syntax of the original computer ‘c’ language. The advantage of writing in ‘c’ is the availability of a large number of functions that comes in handy while programming. But the ‘c’ programs are comparatively slower than the assembly programs. In either case you need the simulator software with assembler/compiler. I recommend using the latest version of ‘Keil uVision’ if you are working on 8051 microcontroller, ‘PIC Simulator IDE’ for PIC microcontroller and ‘AVR Studio’ for the AVR microcontroller.


2.  HEX FILE: Though you are initially writing the program code in assembly or ‘c’ language you will have to convert it to hex file before you can put it (program/burn) into a microcontroller flash memory. Usually, the conversion is done by the assembler program associated with the programming (simulator) software. Then the hex file can be loaded into the microcontroller using a suitable microcontroller programmer (hardware).


3.  MICROCONTROLLER PCB CIRCUIT: I recommend that you create a basic microcontroller circuit on a General PCB with the ‘Lock/Eject type’ IC base for the microcontroller. This will help a lot during the microcontroller programming by avoiding the uneasiness and various connection problems while using the breadboard circuit and it also eliminates the need for those costly and bulky development boards.


4.  CHECK YOUR MICROCONTROLLER: Before you test your program code on a microcontroller, you should check whether the microcontroller is functional or not. This can be done by burning a simple program in the microcontroller and checking the result (output). For example, the following test code is written for the said purpose. It is written for 8051 microcontroller in the assembly language:


ORG 00H          ; initialize microcontroller

LOP:

SETB P1.0        ; make p1.0 pin high

MOV R5, #0FH     ; approx. 1s delay

LOP2:

MOV R6, #0FFH

CALL DELAY

DJNZ R5, LOP2

CLR P1.0         ; make p1.0 pin low

MOV R5, #0FH     ; approx. 1s delay

LOP3:

MOV R6, #0FFH

CALL DELAY

DJNZ R5, LOP3

JMP LOP          ; go to ‘lop’ label


;****************************************

;           1s DELAY ROUTINE

;****************************************

DELAY:

DELAYL1: MOV R7, #0FFH

DELAYL2: DJNZ R7, DELAYL2

DJNZ R6, DELAYL1

RET

END


The above code will toggle the 8051 P1.0 pin between high (+5V) and low (0V) with a delay of approximately 1 second. You can see this state switching by means of an LED (with driver-recommended) circuit connected to the P1.0 pin.