Tuesday, January 20, 2009


Making the 'embeded tetris' was the greatest ever experience of mine. The story of the emebeded tetris is a little bit old by now, and was scratched by Sailesh, my room mate after the running display. As the summer vacation has just started we the team of five ( Me, Vijin, Vyshakh, Tony and Sailesh ) thought to have a walk through the idea of Sailesh.

The extract of the discussion over the components and the abstract of the project get concluded to use an ATmega16 microcontroller to run the background code for the tetriss and to control the 14*28 led board along with the score and 4*4 leds showing the next shape. The most interesting factor was that we decided to go with our circuit drawn nowhere other than the idea we ha
ve in our minds.

Actually at first t
e 'walk' did really took its litera
l meaning. we a
d decided to go along with a 14*28 led board for tetris. And t
he ernakulam trip to buy the LED's and other components stole a whole long day from our life in wandering through the city of ernakulam to find the apt shop to buy
the components. But later it was nice to see the day crypted in the unforgattable letters and the the silly mistakes, painted in colours of comedy.

Though we were just newbies in soldering circuit of the tetriss was completed in a jiffy, thanks to the great effort from our team. What made us still proud about the soldering was nothing other than we could make the circuit without much ovelapping of wires without the help of a circuit. We had the circuit diagram only in our idea and it never seemed difficult to solder the four pieces of p
cbs at the same time by 4 of us and joining them without much overlapping.
The 400+ soldered Led's just looked professional.

The circuit was designed to control the 14 coloumns and 28 rows through decoders, ie one each from the coloumns and rows can be selected at a time. The 16 led's for showing next was also designed to control through decoders. a complete port of the micro controller was left dedicated to sho
w the score. The 28 rows controllers also used a port by its own. The next and the coloumn controlls were multiplexed to one port. And the fourth port was configured as input to connect the keyboard.

But the tetris was not over with the circuit alone.

It is still interesting to remember the discussion in our team which started with a word tetris and ended up in making a frame
work of the tetris' background program, perhaps the most robust frame for such a game. Decissions over the data structure for the tetris board and the shapes were great milestones in the discussion. When it was first decided to have the data structure of the tetris board, as a single dimension stack, and the shapes, to be single dimension array of integers terminated with -ve numbers indicating the size of the shape, we were still to believe that they are the most efficient data structures for tetriss. So was the case for the decision over the operation behind the movement of the shape in the board, which was the comparison between X-OR ing and addition.

The story was not yet over...

As an exhibition in our college was at the door Tetriss was needed to be finished in a fly. But all others other than Tony and Vyshakh got engaged in some other works in the late hours. Then it was the real challenge as the circuit was never drawn any where nor it was simulated before. The case for the code was not much different as the code was going to be tested for the first time. It took a whole long day to solve the little mistakes by the newbies both in the code and circuit. Atlast the tetrads began to fall in the tetriss and they moved with the keys, but the ultimate victory was not anywhere near in the sight, the light from the led's was too low that the we couldn't exhibit the tetriss. Again the mistakes from the newbies.. the wires and interconnections was not so efficient to switch the voltages at the frequency of the microcontroller....

But quest to see the circuit designed by us working gave the tetriss a new birth...........

1 comment:

おっぱい said...