Dont You Facebook Quiz Me or …

Share

Its been quite a while since Facebook introduced quizzes on its network to make some money. Fair enough. Its been quite a while since I had to tolerate my friends taking all sorts of weird quizzes, like “What kind of a vampire are you ?” (which was quite subtle compared to some others I have seen). Since Facebook was a good tool, I waited. Its been quite a while since they introduced those privacy features wherein I could block those stupid quizzes. Not very nice, considering I had to block each one day every time I logged in, but I did it. I tolerated the results of some of the stupidest,most pointless and the most irritating quizzes my friends took. I laughed at some results, jeered at the others and simply ignored the rest. Life’s cool.

Then today I decided to see how stupid these quizzes could really get.

Facebook quizzes are the worst thing to happen ever.

The quiz I took was seemingly innocent for that matter. It invited me to find out “WHAT TYPE OF AN ENGINEER ARE YOU ?? ” Well, I said, it can’t be that stupid. So I began.

1st Question : My favourite subject. I answered IEEE 101. Fair enough. Expected question.

That’s it. The END. Finis !! Khatam !! Khallas !! That was the end of any relevancy which existed in the quiz as well any patience I had left in me.

2nd Question : What kind of a car do you drive ? Bloody idiot, I don’t drive !! (Not an option !!)

3rd Question : What country would you like to work in ? Losers, what’s that got to do with what kind of an engineer I am !!

4th Question : What are the most important characteristics of an engineer ? Looks,Character,Smarts,Strength ? Duh !! I could never get it right !! I always thought the answer was laziness !!

5th Question : How many languages do you speak ? And the options included 1.5 and 2.5 !! Dumb asses !!

6th Question : Who is your pick of these sports ? Ooooo !! So smart !! You thought I would answer it correctly so that you would find out what type of engineer I am, huh ? GET LOST !!

7th Question : ON A SCALE OF ONE TO FIVE HOW IMPORTANT IS ENGINEERING TO YOU ? Its not important at all to me. I am just doing it because I don’t wanna sit at home all day and help out Mom with daily chores. BRAINLESS VEGETABLE OF A QUIZ MAKER !!

Apart from how frustrating, pointless and irrelevant these questions are, the sad part is that millions of people take these stupid quizzes everyday !! I know people who only play quizzes on Facebook .. Its fun they say… Yeah, its fun alright if you call a dentist poking your eye to see if you need root canal treatment funGet a life, guys !!

Another thing I noticed was that apart from the 1st question, the other 6 questions would have made perfect sense in a market survey of some sort. I am not weaving conspiracy theories here, but it just might be possible that they ARE actually market survey questions that some unscrupulous developer is trying to push in.

These quizzes waste your time asking stupid questions, they waste your friends’ time if you invite them and still waste some more time even if they block them. I am not being harsh, just practical. Not everyone wants to see how many and which stupid quizzes you have taken. If you want to take them, fine…Go ahead…But don’t publish them in your feeds…No one wants to login to his Facebook homepage early in the morning to wake up to read “Find out at what age you will lose your hair“.

And think twice before you invite ME to take a quiz !!

My kindest regards to all of you reading this. Its nothing personal. I just hate these stupid quizzes, that’s all.

Share

Interfacing a PS/2 keyboard to the ATMEGA16

Share

There are a lot of devices which would be great if we could use them to communicate with a micro-controller and a keyboard is one of them. Adding a keyboard interface opens up a whole world of varying your input to the MCU and controlling it.

A lot many tutorials about this are already available on the internet, but I found that patching ready made code to your MCU is most often problematic. Its best to understand the protocol and write code yourself.

THE PS/2 PROTOCOL :



This is how a male PS/2 connector (on the keyboard) looks like :

6-pin Mini-DIN (PS/2) Male Connector:

1 – Data

2 – Not Implemented

3 – Ground

4 – Vcc (+5V)

5 – Clock

6 – Not Implemented

Communication :

Each key press on the keyboard corresponds to a fixed hex code which is communicated by the keyboard controller to the MCU. This code is known as the scan code. This is followed by a “break code”, which indicates that the key was released and consists of two “words”. The first “word” is the same for all keys (generally F0), and the second “word” is generally the scan code repeated again.

Now let’s deal with only communication from the keyboard to the MCU.

The data format is as below :

1 start bit

8 data bits, least significant bit first

1 parity bit (odd parity)

1 stop bit (always 1)

One word therefore consists of 11 bits, and three words make a package. One package corresponds to one key press.

Timing :

The data and clock lines are open-collector. They are always high in the idle state. The keyboard pulls the clock line low and generates a clock signal to begin sending data on the data line, when a key is pressed. Note that the keyboard won’t send any data if the clock line has been held low by the micro-controller, even if a key is pressed.

The timing diagram for communication is on the left.

The clock line which is normally high is pulled low by the keyboard to begin transmission.

One clock pulse consists of a high level for half a clock cycle followed by a low level for the remaining half. Data is loaded when the clock line is high and therefore must be read when the clock line changes from high to low i.e. on the falling edge of the clock.

Timing is absolutely critical and wrong timing will lead to totally wrong or even no data.

The SCK line (used if communicating via SPI) should have a frequency of about 10 -16.7 kHz. Since we shall be using the interrupt method, we need not bother with the clock frequencies.

The Interface : Data acquisition

Data acquisition can be done in different ways, including SPI , or by continuously polling the data and clock lines to see when they go low etc. However, shall be using the interrupt method here.

The clock signal generated by the keyboard is fed to the INT2 line of the ATMEGA16. The reason for selecting INT2 is that it is an edge triggered interrupt and can be used to detect a rising and falling edge asynchronously i.e. independent of the MCU clock. The data line is sampled at every interrupt trigger and the needed bits are stored and shifted to obtain the scan code.Since we already know the data packet format, we can safely afford to neglect the remaining bits. Here, we shall not be reading the break codes. However, they may be used if special functionality is needed.

Code :

Keyboard Code
This code is very basic and will help you obtain the key scan codes. You can further add the look-up tables for these scan codes to identify the keys pressed. You could also try out key combinations and implement extra functions, password features etc.

Issues :

Reliability issue : The above code works just fine. One scan code can be detected additionally as well. However, if code to read the two scan codes that follow is added, all the data i.e. all three words get messed up. Reason yet to be detected and fixed.

References and additional reading :

1. Science Prog website

2. ComputerEngineering.org

3. Interrupt based Code

Images courtesy computerengineering.org

P.S : Code will be improved and added soon. Keep visiting !! 😀

Share

For You

Share

Here are a couple of poems I wrote :

Eyes dark as the black of the night
With a hidden glint like a thundering streak of light
A graciously beautiful guileless face
With hair curling over like tickly waves

A nimble spirit that cannot be bound
With feet firmly rooted to ground
Intricately crafted yet amazingly simple
Like the torrentous tempest within the gentle ripple

Innocent mischief runs deep in your voice
Your talk a carnival of colourful exuberant noise
Sweet,unpredictable,inexplicable,unexplaining
Like the time it first starts raining

A gentle soul,a golden heart
Of the world, but a world apart
I don’t know what life has in store beyond the bend
But I am truly glad to have you as a friend.

The innocent waves curling at the shore
Bring to mind that sprightly hair
Aphrodite’s beauty proclaimed by all folklore
Is but an allusion to your visage,so fair
Your cheeks rosy like an apple
Who wouldn’t want to bite,
Your smile divine,your grace so simple
Would make a blind man see broad daylight
A voice so melodious,one can never have enough
A heart that infatuates the toughest of the tough
A gem of a person
A geniune friend
Straight from heaven
You are godsend

But so much time has passed,
Beauty,since I saw you last
All too often rises an urge above all the noise
An urge to hear your sweet,heart-warming voice
A desire to hear you talk
And a wish for you to never stop
I pray to God
I pray to see you soon
And make it so that I have you always,
Just like I have the moon

Share

My Leh Trip : To Heaven and Back

Share

Awesome ! Amazing ! Superb ! Brilliant ! Pristine ! Beautiful !

These are definitely needed before I even begin to describe the places in the Ladakh region of Kashmir. All of it is beautiful, and I mean not only the places but also the roads and rivers and valleys and snow covered mountains and everything in and around them.

They are ideal for a getaway from the rat-race that is city life. Not only are they unique in their beauty, you will be gasping with awe every time you see a mountain or a river, no matter how many times you have already seen them.

Here are some of the places I visited :

Srinagar : A bustling city, the gardens are a must watch. They are really beautiful and very well maintained. Staying in the house boats is a novel experience, even if they are half moored on land and don’t move about in the lake.

Sonmarg : A truly beautiful place. Lots of greenery,snow. Good place for adventure sports. The Thajwas glacier is quite nearby from here. A nice tricky place to climb up a snow mountain without much equipment 😉 If you are going somewhere and are passing through Sonmarg, it is best to pass Sonmarg before noon, as the heavy motor vehicles are let out at noon and they therefore hog the road.

The route from Sonmarg to Kargil has awesome sights, and nothing less than pictures can do full justice to it. On this road, the journey is literally more beautiful than the destination.


Drass : A town en route to Kargil. Reportedly the coldest inhabited place in the world. Non-vegetarian food is the major diet here.

Kargil : A small town which gained popularity after the 1999 Kargil war, there isn’t much to watch here except a museum which has war relics as well as a 5 Lakh note (currency, I don’t know :S ). It gets pretty cold here during the night. There is a memorial dedicated to Operation Vijay, which won us the Kargil War, some distance before Kargil.Almost all the mountains on which battles were fought can be seen from here.

On the Kargil – Alchi route comes the famous Maitreya Buddha statue, that of the Buddha to come.


Also on the way is the famous Llamayuru monastery.

The way from Kargil to Alchi is mainly rocky and barren mountains, but those mountains emanate a strange kind of beauty. They are beautiful in a special way,more beautiful than any kind of other moutains you will see.

Uley : Uley is a small village some way before Alchi,and is actually just a resort in the lap of nature. It is truly natural, with cottages surrounded by apricot and apple trees and overlooking the river. Its very peaceful and serene over there, away from everything. A perfect getaway. My previous poetry perfectly describes Uley. Oh, and those of you wanting to tweet from there about how great it is, there is no mobile network coverage there 😉

Alchi monastery is another famous monastery.


On the way from Alchi to Leh are quite a few interesting sights :

1. Magnetic hill : Keep you car on the white paint on the road, and the hill automatically pulls the car toward itself. Unbelivable, eh ? Try it, it works.

2. Pathar Sahib : This is the place where a demon threw a large rock on a meditating Guru Gobind Singh. The stone failed to do any harm on the Guru and a partial impression of Guru Gobind Singh can be found on that rock.

3. Hall of Fame Museum : All of the Indian army’s exploits in the mountainous north can be found here, including the adventures in Siachen and the Ladakh ranges. Commendable work and impressive show.


Leh : Leh is quite a big town, with a large part of the population there engaged in the booming tourism industry there. Agriculture is another important occupation here.The Ladakhi song and dance is truly light and beautiful.Don’t miss it.


Leh is the center for most tourist activities, and people generally visit the Pangong Lake, Nubra Valley, Tsomoriri and Tsokar from here. Things worth seeing in Leh are the Leh Palace and the Shanti Stupa. Leh is a popular destination for cycling, motor-cycling,rafting and para-gliding. Likir and Thiksey are the famous monasteries en route Hemis.

Likir Monastery

Hemis : Hemis is a village a little ahead of Leh. It is famous for its monastery. It is the only monastery which holds its annual festival in the spring, when there is no snow, unlike all others which conduct them in winter, and therefore cannot be witnessed by most tourists. This festival is immensely colorful and attracts a lot of foreign tourists as well as locals. This festival consists of a complete village fair along with cultural and religious programs in the monastery. This festival generally happens for 2 days in a year in the beginning of July. I was lucky to catch it on the 2nd and 3rd of July.

Lake Pangong : A 5 hour drive from Leh, this lake is the highest inland lake in the world, and is shared with China. This is a real gorgeous work of art by God and shines with all the shades of blue and green when the sun shines on it. Truly worth watching.


On the way to Pangong lake is Chang-La Pass, the 2nd highest pass in the world (17586 Ft). It is generally snow covered and windy. A cool place to be 😉 It is difficult to stay there for more than 20 minutes due to breathing problems caused by the lack of oxygen at such a high altitude.


Nubra Valley : It is a beautiful valley at a 5 hour drive from Leh. On the way is Khardung-La, the highest motorable road in the world (18380 Ft).


The Hundur and Deskit villages are rest spots in Nubra valley, with camel safaris close by. The strange thing about this is that there are silver sand dunes right next to the river ! Apparently the J & K Tourism Department thinks that this has good potential 😉 The only lodgings here are tents. If you can find a camp by a river, you will get a real good chance of experiencing nature at its very best.

Sarchu : Sarchu is a beautiful place almost midway between Leh and Manali. Baralacha, Tanglangla and Nakeela are the lofty passes on the way. Also on the way are the Chandra Taal and Deepak Tal,lakes from where the Chandra and Bagha rivers originate. Sarchu is surrounded on all sides by mountains. There are camps on the flat land between the mountains which truly make you feel small 😀 The wind whispering in your ears all evening is an added joy. At night temperatures go down to 2-3 degrees so be prepared to face the cold.All said and done, Sarchu is a place worth visiting.

Its a pity Sarchu lies where it does.The route from Leh to Manali is the worst I have ever seen in my life. There are no pucca roads.In certain stretches visibility is a serious problem due to the dust the vehicles kick up. There is a 5 minute flat stretch for which the road literally disappears..All one sees is tyre tracks going everywhere and no kuccha or pucca road !! God help the inexperienced driver ! Also, there is no mobile network coverage once you leave Leh uptil Keylong. So if you are stuck, may other drivers help you !

All said and done, all of it makes you feel like you have come to a different world altogether. So if you get a chance, TAKE IT !! The beauty there is Leh-gendary !!

Share

My Leh Trip : To Heaven and Back

Share

Awesome ! Amazing ! Superb ! Brilliant ! Pristine ! Beautiful !

These are definitely needed before I even begin to describe the places in the Ladakh region of Kashmir. All of it is beautiful, and I mean not only the places but also the roads and rivers and valleys and snow covered mountains and everything in and around them.

They are ideal for a getaway from the rat-race that is city life. Not only are they unique in their beauty, you will be gasping with awe every time you see a mountain or a river, no matter how many times you have already seen them.

Here are some of the places I visited :

Srinagar : A bustling city, the gardens are a must watch. They are really beautiful and very well maintained. Staying in the house boats is a novel experience, even if they are half moored on land and don’t move about in the lake.

Sonmarg : A truly beautiful place. Lots of greenery,snow. Good place for adventure sports. The Thajwas glacier is quite nearby from here. A nice tricky place to climb up a snow mountain without much equipment 😉 If you are going somewhere and are passing through Sonmarg, it is best to pass Sonmarg before noon, as the heavy motor vehicles are let out at noon and they therefore hog the road.

The route from Sonmarg to Kargil has awesome sights, and nothing less than pictures can do full justice to it. On this road, the journey is literally more beautiful than the destination.


Drass : A town en route to Kargil. Reportedly the coldest inhabited place in the world. Non-vegetarian food is the major diet here.

Kargil : A small town which gained popularity after the 1999 Kargil war, there isn’t much to watch here except a museum which has war relics as well as a 5 Lakh note (currency, I don’t know :S ). It gets pretty cold here during the night. There is a memorial dedicated to Operation Vijay, which won us the Kargil War, some distance before Kargil.Almost all the mountains on which battles were fought can be seen from here.

On the Kargil – Alchi route comes the famous Maitreya Buddha statue, that of the Buddha to come.


Also on the way is the famous Llamayuru monastery.

The way from Kargil to Alchi is mainly rocky and barren mountains, but those mountains emanate a strange kind of beauty. They are beautiful in a special way,more beautiful than any kind of other moutains you will see.

Uley : Uley is a small village some way before Alchi,and is actually just a resort in the lap of nature. It is truly natural, with cottages surrounded by apricot and apple trees and overlooking the river. Its very peaceful and serene over there, away from everything. A perfect getaway. My previous poetry perfectly describes Uley. Oh, and those of you wanting to tweet from there about how great it is, there is no mobile network coverage there 😉

Alchi monastery is another famous monastery.


On the way from Alchi to Leh are quite a few interesting sights :

1. Magnetic hill : Keep you car on the white paint on the road, and the hill automatically pulls the car toward itself. Unbelivable, eh ? Try it, it works.

2. Pathar Sahib : This is the place where a demon threw a large rock on a meditating Guru Gobind Singh. The stone failed to do any harm on the Guru and a partial impression of Guru Gobind Singh can be found on that rock.

3. Hall of Fame Museum : All of the Indian army’s exploits in the mountainous north can be found here, including the adventures in Siachen and the Ladakh ranges. Commendable work and impressive show.


Leh : Leh is quite a big town, with a large part of the population there engaged in the booming tourism industry there. Agriculture is another important occupation here.The Ladakhi song and dance is truly light and beautiful.Don’t miss it.


Leh is the center for most tourist activities, and people generally visit the Pangong Lake, Nubra Valley, Tsomoriri and Tsokar from here. Things worth seeing in Leh are the Leh Palace and the Shanti Stupa. Leh is a popular destination for cycling, motor-cycling,rafting and para-gliding. Likir and Thiksey are the famous monasteries en route Hemis.

Likir Monastery

Hemis : Hemis is a village a little ahead of Leh. It is famous for its monastery. It is the only monastery which holds its annual festival in the spring, when there is no snow, unlike all others which conduct them in winter, and therefore cannot be witnessed by most tourists. This festival is immensely colorful and attracts a lot of foreign tourists as well as locals. This festival consists of a complete village fair along with cultural and religious programs in the monastery. This festival generally happens for 2 days in a year in the beginning of July. I was lucky to catch it on the 2nd and 3rd of July.

Lake Pangong : A 5 hour drive from Leh, this lake is the highest inland lake in the world, and is shared with China. This is a real gorgeous work of art by God and shines with all the shades of blue and green when the sun shines on it. Truly worth watching.


On the way to Pangong lake is Chang-La Pass, the 2nd highest pass in the world (17586 Ft). It is generally snow covered and windy. A cool place to be 😉 It is difficult to stay there for more than 20 minutes due to breathing problems caused by the lack of oxygen at such a high altitude.


Nubra Valley : It is a beautiful valley at a 5 hour drive from Leh. On the way is Khardung-La, the highest motorable road in the world (18380 Ft).


The Hundur and Deskit villages are rest spots in Nubra valley, with camel safaris close by. The strange thing about this is that there are silver sand dunes right next to the river ! Apparently the J & K Tourism Department thinks that this has good potential 😉 The only lodgings here are tents. If you can find a camp by a river, you will get a real good chance of experiencing nature at its very best.

Sarchu : Sarchu is a beautiful place almost midway between Leh and Manali. Baralacha, Tanglangla and Nakeela are the lofty passes on the way. Also on the way are the Chandra Taal and Deepak Tal,lakes from where the Chandra and Bagha rivers originate. Sarchu is surrounded on all sides by mountains. There are camps on the flat land between the mountains which truly make you feel small 😀 The wind whispering in your ears all evening is an added joy. At night temperatures go down to 2-3 degrees so be prepared to face the cold.All said and done, Sarchu is a place worth visiting.

Its a pity Sarchu lies where it does.The route from Leh to Manali is the worst I have ever seen in my life. There are no pucca roads.In certain stretches visibility is a serious problem due to the dust the vehicles kick up. There is a 5 minute flat stretch for which the road literally disappears..All one sees is tyre tracks going everywhere and no kuccha or pucca road !! God help the inexperienced driver ! Also, there is no mobile network coverage once you leave Leh uptil Keylong. So if you are stuck, may other drivers help you !

All said and done, all of it makes you feel like you have come to a different world altogether. So if you get a chance, TAKE IT !! The beauty there is Leh-gendary !!

Share

The Getaway

Share

I know of a getaway, away from it all
Far away from the noise, where few footsteps fall
Resting blissfully in nature’s loving arms
Where we can give in to the life’s simple charms

Where rises the sun early and bright
And the weather is always just about right
With early morning rain to wash its face
And clouds to line the sky like pearly white lace

With tress laden with apples,raw and sweet
And farms all around gleefully waving its golden wheat
With a gentle river to maintain the peace,
Overwhelm the troubled mind and bring it to ease

This place, it would break your heart to leave
This haven, where a year would seem but an eve
This getaway of mine, is no childish fancy
This portal to heaven, is beyond what you could ever fancy

Share