Friday, 2 May 2014

Debugging the DSO board

Our DSO board arrived. We are using two Atxmegas. One for ADC and USB communication. The other for waveform generation.
Now, for some reason the input at PA1(input to ADC) is giving us problems. The external input is scaled and shifted using opamps and then given to ADC pins. i.e., PORTA. This is so that the pins of the controller are not given voltages outside the absolute voltage specifications (-0.5V to 3.3V).

28 feb -
found out that PA0, 3.3V and ground volt were shorted.
i was "being stupid".
There was no short. Amaldev had to come all the way from his lab to verify that.
One day, he is gonna snap and throw  me in front of a running bus.

Anyways, on burning the final code we had written, the voltages at PA1 and PA2 are getting stuck at 2.1V.
On burning our earlier ADC codes, there is no problem.

Resolved. In a file included by the example project, on which our entire project stands on.

Wednesday, 12 March 2014

IF

I found this poem while reading inspirational comics on zenpencils.
Then searched for this awesome poem by Rudyard Kipling, titled 'If'
Posting it here.

If you can keep your head when all about you   
    Are losing theirs and blaming it on you,   
If you can trust yourself when all men doubt you,
    But make allowance for their doubting too;   
If you can wait and not be tired by waiting,
    Or being lied about, don’t deal in lies,
Or being hated, don’t give way to hating,
    And yet don’t look too good, nor talk too wise:

If you can dream—and not make dreams your master;   
    If you can think—and not make thoughts your aim;   
If you can meet with Triumph and Disaster
    And treat those two impostors just the same;   
If you can bear to hear the truth you’ve spoken
    Twisted by knaves to make a trap for fools,
Or watch the things you gave your life to, broken,
    And stoop and build ’em up with worn-out tools:

If you can make one heap of all your winnings
    And risk it on one turn of pitch-and-toss,
And lose, and start again at your beginnings
    And never breathe a word about your loss;
If you can force your heart and nerve and sinew
    To serve your turn long after they are gone,   
And so hold on when there is nothing in you
    Except the Will which says to them: ‘Hold on!’

If you can talk with crowds and keep your virtue,   
    Or walk with Kings—nor lose the common touch,
If neither foes nor loving friends can hurt you,
    If all men count with you, but none too much;
If you can fill the unforgiving minute
    With sixty seconds’ worth of distance run,   
Yours is the Earth and everything that’s in it,   
    And—which is more—you’ll be a Man, my son!

Wednesday, 12 February 2014

Great blog post I came across.

As I was browsing around I found this post shared on Facebook - https://medium.com/life-learning/2a1841f1335d

Really great one. Got me thinking.
I will just put up the headings. Read the entire post at that link.

7 Reasons why you will never do anything amazing with your life

1 :: Because You Have Not Failed Enough

2 :: Because You Care What Others Think About You

3 :: Because You Think You Are Smarter Than You Are

4 :: Because You Don’t Read

5 :: Because You Lack Curiosity

6 :: Because You Don’t Ask Enough Questions

7 :: Because You Can’t Handle The Truth

Read the entire article here.
The orginal article here.

 

 

 

 

 

 

Wednesday, 5 February 2014

Modelling of systems

Modelling of systems is the first step in doing everything with the system.
If you have modeled a system, then you know exactly how the system is going to behave or not going to behave when it receives specific inputs.
So, if you don't know how the system acts then, there is no way you can use it and make it do whatever you want it to do. Everything system that we can interact with and understand how it is going to react is modeled in our heads. What you do not understand, you cannot model, or can we?!
There are 3 different ways in which systems are modeled.
One is from the laws of nature or white box modelling.
You know the forces acting on the system and you have the laws that these forces follow. Then, you know all you need to know.
Two is, grey box modelling.
Here we know the inner workings of the system partially. Some part we do not know. Its also called Semi-deterministic model.
Three is black box modelling.
Here, we don't know what is inside the system and its inner workings. The system is like a opaque black box which cannot be opened.  You just have places where you can give your inputs and places where you can see the outputs. From this we need to find out the relation between the inputs and outputs. Plus, the systems we usually encounter are dynamic, which means the way its going to act now depends on what input it was given earlier. i.e., we have to find the relation between the current output and current input, earlier input, earlier outputs.

Its clear to me that I myself am not clear with these things, because I cannot seem to be able to write with much confidence.

Monday, 3 February 2014

Signed Binary representation and mathematical representations

Two methods to begin with.
1. Sign/Magnitude representation
2. Ones complement method

Sign/Magnitude method : The leftmost bit is sign bit and remaining bits represent magnitude.
MSb is 0 for negative numbers and MSb is 1 for negative numbers.
Therefore we have +0 and -0. Not efficient.

One's complement method : the negative of a number is its ones complement(I expected something better).
therefore if 0 = 00000000, then 11111111 is -0. 1 = 00000001 and -1 = 11111110

Both these are not good enough, have drawbacks.Hence we have the Twos complement method.
That is negative of a number is its 2s complement(surprisingly simple).

Examples -  +1 is 00000001. to get -1, take ones complement : 11111110, then add 1 : 11111111
                  therefore -1 = 11111111

Same method can be used to convert -ve number to +ve number to find out the magnitude.
for example, the value of 10100011 is found like this -
take ones complement - 01011100
add 1 : 01011101. this has magnitude 93.
therefore 10100011 = -93.

Here too, the MSb points to the sign of the number.

Reference - http://www.swarthmore.edu/NatSci/echeeve1/Ref/BinaryMath/NumSys.html


Wednesday, 22 January 2014

Cause and Effect

Cause and Effect is only of the most dastardly laws. Totally hate it.
Its so plain and straight forward, like simple mathematical axioms, you just can't argue with it. Damn.
I can't get good grades without studying, nor can i build muscles without going to the gym.
That's cause and effect for you, in action.

I wonder, if it would be possible to interchange the causes and the corresponding effects by employing some kind of system in the middle! there should be some kind of controller in between which routes the causes to its effects. If somehow, i can get my hands on this controller, it would be great.

Till then, no choice.
Rise and Grind.
Everyday.

As a man thinketh

Quotes from this age old book which intrigues me.
1. A man only begins to be himself when he ceases to whine and revile, and commences to search for the hidden justice which regulates his life.
2. Law, not confusion, is the dominating principle in the universe.
3. Men imagine that thought can be kept secret, but it cannot.
4. Selfish thoughts of all kinds crystallize into habits of self seeking, which solidify into distressful circumstances.

Finally a poem at end of chapter 1.

You will be what you will to be;
Let failure find its false content
In that poor word, "environment,"
But spirit scorns it, and is free.

It masters time, it conquers space;
It cows that boastful trickster, Chance,
And bids the tyrant Circumstance
Uncrown, and fill a servant's place.

The human Will, that force unseen,
The offspring of deathless soul,
Can hew a way to any goal,
Though walls of graphite intervene.

Be not impatient in delay.
But wait as one who understands;
When spirit rises and commands,
The gods are ready to obey.

Epic lines!!!