Sunday, February 7, 2010

Cross Bar Switching

Hmmm This is my first technical blog. this is neither a different topic nor innovative this is some thing which was done before but i still feel that i have done this putting my 100 per efforts .......... Cool coming to the topic i started doing this project as one of my friend wants to control 20 odd switches with a minimum of pins used so i opted for this cross bar switching......
Technically there are two ways of solving this problem but practically when situations like responding only when the switch is pressed , arises it becomes difficult ......In such cases constant scanning of either rows or columns is desired..
I had this problem solved with a small technique firstly i ll consider all my columns to be initially in high state and then i ll try to trace the switch such that i ll have this infinite loop which makes the row high every time and checks if there is any change in the column because if the key in corresponding row which is made low is pressed then corresponding column gets low Like wise to satisfy the condition of responding only when the key is pressed a while loop is again used ................... Program looks as follows


row1=P3^1;
row2=P3^2;
row3=P3^3;

col1=P1^1;
col2=P1^2;
col3=P1^3;

main()
{
row1=0;
while(row1=0)
{
while(row1==0&&col1==0)
P2=90;
while(row1==0&&col2==0)
P2=91;
while(row1==0&&col3==0)
P2=92;
}

row2=0;
while(row2=0)
{
while(row2==0&&col1==0)
P2=93;
while(row2==0&&col2==0)
P2=94;
while(row2==0&&col3==0)
P2=95;
}
}
This looks pretty easy but it took almost 4 days to get the exact output.
I had almost 3 algorithms but i found this to be easier not just to understand but for the sake of execution too..........



Tilak

}

No comments:

Post a Comment