tag:blogger.com,1999:blog-51733983490664817942024-03-13T09:28:08.772+05:30Jalarekhakalranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-5173398349066481794.post-31556645725787266612009-05-26T08:36:00.006+05:302009-08-09T11:00:51.130+05:30RECOVER EXT3 - Bootstraping the miniprojectHi,<br />And now its time for our miniproject. We have decided to have the mini-project with the team , me,midhun,and vijin and vyshakh as usual. As for ever it was really difficult to make decision over what should be the project. Somehow we got the idea of a file recovery tool, and we saw that there is not so much such tools for the ext3 filesystem. Thus another story begins here 'The mini project days'.<br /><br />We googled for the available documentations over the file recovery in ext3. There were not so docs in bulk, but the available once where capable of keeping the idea alive. We went through the <a href="http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html">documents of 'ext3grep'</a> and some other saying 'file system forensic' neither of the documents said its easy to recover the lost files but they did say there is chances that the files can be recovered using the details in journal.<br /><br />As we gone through a number of different documents, almost al of them were discribing the recovery method in some what similar way. All of them were using the tools TSK, foremost etc. Although there is no point in discribing the procedure in those articles here, they do come in the scope of the post. Lets have a higher level look over the structure of the inode of a file and how these articles recover the lost data.<br />The inode in the ext3 file-system<br />An image of the disk is created ( from where the file was deleted..).<br />The inode corresponding to the deleted file has been found.(The tool debugfs can be used for this)<br />The block group of the inode is obtained from 'imap' in debugfs.<br />The journal of the file is searched to get the entries for the particular inode in the blockgroup.<br />The journalled inode data is fetched and if it is of some size near our deleted file, the file is recovered using the tools like 'foremost'.<br /><br />Here the major threat we faced is that using these tools recovery of a file which has its data present in the single, double and triple indirect pointers is not so easy. There is another problem that it can recover the files with extensions which are defined in the foremost only. Enhancing the foremost for the unavailable extensions is also didn't sound so good to us. As of now we had been on our way to find some simple but robust method that can better recover the file irrespective of the file size.<br /><br />Then we thought if there was an option to undo the permanent deletion till its not over written then it would have been fine. That means if we are able to make the OS believe that file had not yet been deleted then it would have been easy to tackle this undeletion. Yeah here comes our idea behind the miniproject wich is robust and sound. Re-establishing the previous contents of the inode to itself will do the undeletion till the data is not overwritten. There is tools which will help to get the journal details to recover the datas in an inode at a previous time also to edit the inode, and these tools can be used to start the project and later these can be replaced with our own dedicated code.<br />And thus here is a turning point.......<br /></ahref="http:>ranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.com6tag:blogger.com,1999:blog-5173398349066481794.post-37083032172463882842009-01-20T22:16:00.005+05:302009-07-19T14:04:24.964+05:30EMBEDED TETRIS REVISITED<div style="text-align: center;"><br /></div><div style="text-align: center;"><br /></div><div style="text-align: left;">Even the tetris failed to be exhibited due to the low brightness of the LED's, it was a great experience.It was a week ahead of our department program Insignia, and my class mates and me were searching every where for an idea of project. The lack of time kept us away from start projects from scratch. The team behind the റെതൃസ് decided to gave it a new birth, but this time there was another newbie team ready to take the challenge. Jaslina, Merlin and Abitha were ready to re-implement the idea with a new code and slight change in the circuit ( the changes ie the structure of the new project is described below) .</div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Ny03FyxZxmYbYDDMtMGsiNqBAQ_54-AFKnT91IWNv5Txy6obMDP8SsYW_TGpl80W2qI-4WIIZNsPdh0dkM0VaLiuw1ZY7jmToNrlW7Tjr1jeD7XKWAWKVkRbuZSyBc4oTbeCWbHeANrg/s400/ckt_tetri_pdf+copy2.JPG" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 156px;" alt="" id="BLOGGER_PHOTO_ID_5295548501560056146" border="0" /><div><div style="text-align: left;"> This time we decided to go with an etched circuit. Regarding the code, Abitha, Jaslina and Merlin could re-write the complete code where the job for me and Vyshakh was just helping them. After the effort of a few days the three colleagues of us could write a new code which was robust than the previous one, where the core ideas remained the same.</div><br /><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJqvHMCjKPpt4qi9wRljCb8cy-01SCuk_snG8-vix35MlnvGs7p_F19hZi_3-aBvseBWaPRhgkbYKVHiBfo5haiVaehWR46gXEWKrqR6wN7uc5CIcVbjs6q1OS5hdjQjmdwA_giMTp5Lbd/s400/Image0232.jpg" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 157px;" alt="" id="BLOGGER_PHOTO_ID_5295548006515658914" border="0" />The soldering left in the etched board was done by the three itself..( another piece of perfect work from another newbies..)<br /><br />Although it was for the first time these ത്രീ working with embedded programming there was nothing left in the code to be edited after the code was etched. The code ran in the first burning itself. It was really the greatest experience to see the tetrades falling one by one and changing there position and rotating with the keys...</div><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikvdFRKfNm2bSyevgmGbuJBweiuXr5syQZ9DDM7oU1-SlfxbWUUTnI7MwhkERa6vJuJAwyhyphenhyphena9C0uxAwKHgFifpjRfu-c4IKgI213oNGQ5vb1l-Ldey1vjpvng9xYLGe82ynqIz4eMVWLw/s400/Image036.jpg" style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 306px; height: 400px;" alt="" id="BLOGGER_PHOTO_ID_5295552658999163778" border="0" /><div><em><ul><b>The circuit:</b></ul><ul><li>The tetris board is the same led dot matrix in which the negative legs of the 14 leds in each row are shorted positive legs of the 28 leds in each column are shorted.<br /></li><li>The 14 column are controlled directly from the micro controller through ports B and C.<br /></li><li>The 28 rows are controlled by decoded outputs through portA ie one row can be selected at a time.<br /></li><li>The score is shown in 7segment display whose ic is controlled by 4 inputs ( 3 from port A and 1 from port C)<br /></li><li>A 8 Mhz crystal is connected to the micro controller because the internal frequency of the mc which 4 Mhz will not be sufficient for the back ground programm of tetris to work.</li></ul><ul><b><br /></b></ul><ul><b><a href="http://www.box.net/shared/ucsms5eza0">Background program:</a></b><br /><li><ul><b> Data structure used</b><br /><li> The teris board is a single dimension integer array of length 28.<br /></li><li>The shapes(tetrades) are single dimension array of integers terminated by negative values. Binary equivalent of the positive numbers in the shape array corresponds to the shape and the terminating negative number denote the maximum breadth of the shape.<br /></li><li>Another variable for shifting the shape is used in the code which is just an integer whose default value is 6 and a left key press will increase the value of the variable and right key press will decrease it by 1.<br /></li></ul><br /></li><li><ul><b>Operation</b><br /><li>Check for fall- to check whether a shape can fall a row down we have to look whether the 1 of the shape(tetrade) will overlap with any one in the board if all rows of the shape is pushed one row downwards, and if there is no such overlapping the shape can fall a row down.<br />This checking is down based on the nature of binary numbers that a+b(addition) and a(+)b (bitwise X-oring ) will be the same if no two 1s are X-ored together. That means if the result of addition and X-or are the same the tetrade can fall.<br /></li></ul><br /></li><li><ol><b>Algorithm for The Back ground Program</b><br /><li><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbXJm2nCqv6bhmolCdZ4om9R0h04VjBd22fShwfk-qbQ8cfwVk9QKq2sCkUwy62m1IY_Pjo99_jKCo0rymyqKgHp7xYfDlLkaW4kQT6eSYyMqXu65efSenToiOBpGPUbNmg9p-oMMvqe6k/s400/front.jpg" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 291px; height: 400px;" alt="" id="BLOGGER_PHOTO_ID_5295555879197390002" border="0" />The back-ground program will randomly select shapes from the array of shapes.<br /></li><li>The board is displayed such that ith row and value in ith row are selcted for all i<28></li><li>The game is over is the shape left shifted withe a value (say l) cannot be inserted to the board.<br /></li><li>The keys are read and the value of 'l' is updated for a left or right key and the shape is changed to the next change in the sequence of the present one, for a key press for rotation. nb: the updation of shape or l will take place only if the shape can exist in the board with the updated index of shape or vale of 'l'.<br /></li><li>The shape is made to fall a row down if it can fall down. and the algorithm is repeated from step2. And if the shape cannot fall down the Algorithm is repeated from step1.<br /></li></ol><br /></li></ul></em><br /><b><a href="http://www.box.net/shared/syk7hl8e49">Here is the micro controller code</a></b></div>ranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.com0tag:blogger.com,1999:blog-5173398349066481794.post-65902518842342724162009-01-20T20:13:00.003+05:302009-01-27T21:13:49.544+05:30THE EMBEDDED TETRIS<div style="text-align: center;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><span class="Apple-style-span" style="font-size:medium;"><br /><br /><br /></span><span><span class="Apple-style-span" style="font-size:medium;">Making the 'embeded tetris' was the greatest ever experience of mi</span><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiStSKtMkUs898-JUAlvu7lahYMYhhIrQORSPJ89w-parfbkgcSPJsa9LI5rVLpz-E_3Z3cBqWDR5b83CFjhxROGalbRARK6Eg-HpvTRhXDI7QbHHbitikfaxwq0iCtWZ_H0loQYK4wNqWm/s320/led_dot_matrix.jpg" style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 183px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5295504548239893714" /><span class="Apple-style-span" style="font-size:medium;">ne. 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.<br /></span><em><span class="Apple-style-span" style="font-size:medium;"><br /></span></em></span><div><span><em><span class="Apple-style-span" style="font-size:medium;">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</span></em></span></div><div><span><em><span class="Apple-style-span" style="font-size:medium;">ve in our minds.</span></em><span class="Apple-style-span" style="font-size:medium;"><br /><br /></span></span><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCxdZCjNorfaOMj_OOPcntw8PbAnj3vAMqtG32VJ5E4twbrq5k071agNeMxIflw3cjMw07XfVkGriq1-tFsGyMoT3xkXxM8sszSENXTI_AeSsQNu4t7b03fzYHpeP722Z5C53D8sdN2AjC/s320/ckt_part.jpg" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 231px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5295505031699372130" /><div><span><span class="Apple-style-span" style="font-size:medium;">Actually at first t</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">h</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">e 'walk' did really took its litera<br />l meaning. we a</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">h</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">d decided to go along with a 14*28 led board for tetris. And t</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">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</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;"> 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.<br /></span><div style="text-align: center;"><span class="Apple-style-span" style="font-size:medium;"><br /></span></div></span></div><div><span class="Apple-style-span" style="font-size:medium;"><br /></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">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</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">cbs at the same time by 4 of us and joining them without much overlapping.</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">The 400+ soldered Led's just looked professional.<br /></span><em><span class="Apple-style-span" style="font-size:medium;"><br />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</span></em></span></div><div><span><em><span class="Apple-style-span" style="font-size:medium;">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.<br /></span></em><span class="Apple-style-span" style="font-size:medium;"><br />But the tetris was not over with the circuit alone.<br /><br />It is still interesting to remember the discussion in our team which started with a word tetris and ended up in making a frame</span></span></div><div><span><span class="Apple-style-span" style="font-size:medium;">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 </span><em><span class="Apple-style-span" style="font-size:medium;">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</span></em><span class="Apple-style-span" style="font-size:medium;">, we were still to believe that they are the most efficient data structures for tetriss. So was the case for the decision over the </span><em><span class="Apple-style-span" style="font-size:medium;">operation behind the movement of the shape in the board, which was the comparison between X-OR ing and addition</span><span class="Apple-style-span" style="font-size:medium;">.</span></em></span><em></em></div><div><span style="font-size:130%;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjztejmSy9IS1l_sCQGprSNi2wAVstREiEEfQayIsUM-hoIQ6pjOzyVKTNyfCUF_aZeUIDVaJ1sbmN-i13un9WfhWNRGlUujmdLQtZ3-p_UsSOJt-oNOGJsaH_Sp_yO4dLrcqi9wL4ryGxj/s320/cktweb2.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 234px; height: 320px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5295505703195539202" /><span class="Apple-style-span" style="font-size:medium;"><br />The story was not yet over...<br /><br />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....<br /><br />But quest to see the circuit designed by us working gave the <a href="http://www.blogger.com/post-edit.g?blogID=5173398349066481794&postID=6590251884234272416">tetriss a new birth...........</a></span><br /></span></div></div>ranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.com1tag:blogger.com,1999:blog-5173398349066481794.post-354286419641179452008-02-17T14:57:00.006+05:302009-07-19T14:07:25.511+05:30RUNNING DISPLAY WITH 224 LEDs- A review..<p class="MsoNormal" style="text-align: center;" align="center"><b style=""><u><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_0">RUNN</span></span></u></b><b style=""><u><span style="">I</span></u></b><b style=""><u><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_1">NG</span></span></u></b><b style=""><u><span style=""> DISPLAY<o:p></o:p></span></u></b></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style="">Little projects with <span class="blsp-spelling-error" id="SPELLING_ERROR_2">LEDs</span> are always interesting. The most interesting thing about these is that the core idea behind all of these is the same, whether the work be a chaser or <span class="blsp-spelling-corrected" id="SPELLING_ERROR_3">displa</span></span><span style="">y and it’s the very principle</span><span style=""> which was explored by the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_4">inventors</span> of movies. That means when we are about to do something like this chasers or a</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_5">ny</span> kind of displays what we have to do is mere exploring</span><span style=""> of the simple principle behind the chaser pro</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_6">perly</span> ti</span><span style="">ll it can give us a frame sufficient enough to have our </span><span style="">work done. A</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_7">nd</span> the principle is nothing but switching a set of <span class="blsp-spelling-error" id="SPELLING_ERROR_8">LEDs</span> one by one ON in a sequence and <span class="blsp-spelling-error" id="SPELLING_ERROR_9">of course</span> in a timely manner. As an example lets consider the parallel port of a <span class="blsp-spelling-error" id="SPELLING_ERROR_10">pc</span> which has 8 output pins in a port (port no: 0x378) which can be controlled independently now lets assume these to be 8 switches which we can control and each is being in series with an LED. If we can operate these switches one by one faster enough, we can have a chaser with 8 <span class="blsp-spelling-error" id="SPELLING_ERROR_11">LEDs</span> controlled by our hand, which can be very easily done in a computer, having speed in range of GHz.</span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style="">When it comes to control <span class="blsp-spelling-error" id="SPELLING_ERROR_12">mor</span></span><span style="">e and more objects (s</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_13">ay</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_14">LEDs</span>) the easiest way for someone <span class="blsp-spelling-error" id="SPELLING_ERROR_15">wh</span></span><span style="">o is fresh to the digital electronics field is using decoders which <span class="blsp-spelling-error" id="SPELLING_ERROR_16">ena</span></span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_17">bles</span> us to control up to 2^n objects with n inputs. B</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_18">ut</span> the decoder is having a great barrier for us on our </span><span style="">way from experiments to experiments that the decoder are capable of selecting only one output at a time. It is sure that the way towards success may not be so easy ever, it will be having walls of <span class="blsp-spelling-corrected" id="SPELLING_ERROR_19">different</span> heights, but the mind which is thirsty of success will never stop. On this behavior of the decoder we have the great speed of a computer or micro-controller which can mask </span><span style="">the inability of selecting multiple outputs at a time. Th</span><span style="">at is if we want to select some </span><span style="">n outputs simultaneously through a decoder (or to light up some n number of <span class="blsp-spelling-error" id="SPELLING_ERROR_20">LEDs</span> at a time) let us select these one by one in short span of time </span><span style="">in between (say in micro seconds, its possible to be even faster )<span style=""> </span>and continue selecting them one by one for some time. In this case the viewers even the very ones who know w</span><span style="">hat is being done actually can not measure or see the time gap between these outputs</span><span style=""> (the human e</span><span style="">ye can see two things separately if there is a time gap of at least 1/16<sup><span class="blsp-spelling-error" id="SPELLING_ERROR_21">th</span></sup> of a <span class="blsp-spelling-error" id="SPELLING_ERROR_22">secon</span></span><span style="">d which can not be even compared with the speed of computers ). This is the very idea (principle) which is being exploited in our run</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_23">ning</span> display. Let us see in detail how the idea is being explored at some points of our journey tow</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_24">ards</span> the </span><span style="">success of the running display.<o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style="">The first thing to be done for the work o</span><span style="">f display was to decide the dimensions of the LED matrix that can represent all the letters numbers a</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_25">nd</span> special characters in the ASCII character set. An array of 7*5 came sufficient for this case. It’s not convenient to have each word and sentence get coded for our display or in other words we should have a general table which is having the display representations for each and every character, which we can define by our own. That is here we are going to define a </span><span style="">special behavior for e</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_26">ach</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_27">characte</span></span><span style="">r in a new standard table parallel to the ASCII character set.<o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="line-height: 150%;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhafouZ5NyV2GoFFzzMlWoUuHNut77MvGIt2mrv7u1qsp4932yEmBYbhms3YP9pFeS_Mwn1YaWTkfATXcbl1poin5CvRudVcgA2Tt_pPYyDDOJwW4S_7B8Nb4LhTXQbraYIyBbbEtxO1uEC/s1600-h/h.bmp"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhafouZ5NyV2GoFFzzMlWoUuHNut77MvGIt2mrv7u1qsp4932yEmBYbhms3YP9pFeS_Mwn1YaWTkfATXcbl1poin5CvRudVcgA2Tt_pPYyDDOJwW4S_7B8Nb4LhTXQbraYIyBbbEtxO1uEC/s200/h.bmp" alt="" id="BLOGGER_PHOTO_ID_5167883508147998530" border="0" /></a><span style="">T</span><span style="">h</span><span style="">e given picture in the 7*5 array of <span class="blsp-spelling-error" id="SPELLING_ERROR_28">LEDs</span> represents the letter H. To save such picture for </span><span style="">each </span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_29">cha</span></span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_30">racter</span> is not so </span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_31">simpl</span></span><span style="">e, converting these pictures to l</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_32">ows</span> and highs in <span class="blsp-spelling-corrected" id="SPELLING_ERROR_33">the output</span> pins also raise questions towards easiness. The easiest </span><span style="">way that can be adopted here is to consider each columns as 7 bit binary and let us code to be an <span class="blsp-spelling-error" id="SPELLING_ERROR_34">ar</span><span style="">ray of such values <span class="blsp-spelling-corrected" id="SPELLING_ERROR_35">succeeded</span> by a zero indicating the end of the character ( this will help us to generate the length of the m</span></span><span style=""><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_36">eassages</span> dynamically and ease our job later on).</span></span><span style=""><span style=""> <o:p></o:p></span></span></p> <p class="MsoNormal" style="line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="text-indent: 3.8in; line-height: 150%;"><span style=""> <span class="blsp-spelling-error" id="SPELLING_ERROR_37">Ie</span> let us consider the H as,<span style=""> </span></span><span style="">here</span><span style=""> as per o</span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnLoAPSfPM1owUgmex0IP-8vqhNokv1KPjrN22xvYHJYowmvqQfsdkMmTKpfkJ1LwyWKYn4peJYZVL2F10PCw8V9XpGaWcA-Xiwrq0i_Gmf0SQ9slmqw-PRW7M9SD0eaHPM2BfiPKp5i9-/s1600-h/H2.jpg"><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnLoAPSfPM1owUgmex0IP-8vqhNokv1KPjrN22xvYHJYowmvqQfsdkMmTKpfkJ1LwyWKYn4peJYZVL2F10PCw8V9XpGaWcA-Xiwrq0i_Gmf0SQ9slmqw-PRW7M9SD0eaHPM2BfiPKp5i9-/s200/H2.jpg" alt="" id="BLOGGER_PHOTO_ID_5167889405138096002" border="0" /></a><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_38">ur</span></span><span style=""> method of coding each <span class="blsp-spelling-corrected" id="SPELLING_ERROR_39">vertical</span> column is considered as a 7 bit binary and this can be <span class="blsp-spelling-error" id="SPELLING_ERROR_40">consi</span></span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_41">de</span></span><span style="">red as an array-{127,8,8,8,127,0} where the last 0 represent the end of the character and e</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_42">ach</span> other numbers represent the respective <span class="blsp-spelling-corrected" id="SPELLING_ERROR_43">vertical</span> column <span class="blsp-spelling-corrected" id="SPELLING_ERROR_44">converted</span> to decimal. As it is H </span><span style="">t</span><span style="">he place of <span class="blsp-spelling-error" id="SPELLING_ERROR_45">LSB</span> or <span class="blsp-spelling-error" id="SPELLING_ERROR_46">MSB</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_47">doesn</span>’t make any</span><span style=""> change but in general the bottom bit is take</span><span style="">n as the <span class="blsp-spelling-error" id="SPELLING_ERROR_48">LSB</span>. Thus the entire ASCII set can be coded to this coding method. With this new character set of numbers instead of characters we can simply make any message into</span><span style=""> its corresponding integer array which will be a long array of integer where each character is replaced by its code and as each character is ending with zero there will be a single line in between e</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_49">ach</span> character (<span class="blsp-spelling-error" id="SPELLING_ERROR_50">ie</span> if the message is HELLO the corresponding display array is-{127,8,8,8,127,0,127,73,73,73,73,0,127,1,1,1,0,127,….}). <o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p><br /><p class="MsoNormal" style="line-height: 150%;"><span style="">Now what all needed is a circuit that can display our <span class="blsp-spelling-error" id="SPELLING_ERROR_51">messag</span></span><span style="">es.</span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilLLdHtTxWqDFeYs6p1lsPntBTxGJm8fOJ-27oFh0AI8bx3xY4QgmYcmYcVcBdYyWO9HVdpgrH6kOivhTf1ROFfqw3THW7kdDKGRulZpygSEMs9pJO5vK_6fzqvVlriWe8FwKYypMRtYuu/s1600-h/board2.2.1.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilLLdHtTxWqDFeYs6p1lsPntBTxGJm8fOJ-27oFh0AI8bx3xY4QgmYcmYcVcBdYyWO9HVdpgrH6kOivhTf1ROFfqw3THW7kdDKGRulZpygSEMs9pJO5vK_6fzqvVlriWe8FwKYypMRtYuu/s400/board2.2.1.JPG" alt="" id="BLOGGER_PHOTO_ID_5167888752303066994" border="0" /></a></p><p class="MsoNormal" style="line-height: 150%;"><span style=""> Here <span class="blsp-spelling-error" id="SPELLING_ERROR_52">one thing</span> is sure that how ever we may <span class="blsp-spelling-error" id="SPELLING_ERROR_53">desig</span></span><span style="">n the display, it should have <span class="blsp-spelling-corrected" id="SPELLING_ERROR_54">height</span> of <span class="blsp-spelling-error" id="SPELLING_ERROR_55">atleast</span> 7 LED. The length is taken as 32 as the vertical lines can be controlled by 5 bits through a decoder. Now w</span><span style="">e have a display board of 7</span><span style="">*32 in size, which is controlled by vertical and <span class="blsp-spelling-error" id="SPELLING_ERROR_56">hirizontal</span> lines. The parallel port of a computer can provide a total of 12 outputs through two ports (8 from port-0x378 and 7 <span class="blsp-spelling-corrected" id="SPELLING_ERROR_57">control</span> outputs from port-0x37a ) <span class="blsp-spelling-corrected" id="SPELLING_ERROR_58">exploiting</span> this we can take 7 these outputs to <span class="blsp-spelling-corrected" id="SPELLING_ERROR_59">control</span> our 7 horizontal lines of the display board, the rest 5 pins can be used to controlled the vertical line as we have said earl</span><span style=""><span class="blsp-spelling-error" id="SPELLING_ERROR_60">ier</span>.</span><span style=""> <o:p></o:p></span></p> <p class="MsoNormal" style="line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisg4XL0CzzUBJXXwFSPOmMEizlu-dFQPVrCCLnGO6ZfzqW39CYl1qQsyBxkckxzk3Xe-atVW_0WvGF4DeKJIhlyRPlJ6VwoCTge91mnQPJuXIDxxBUPQMIJQZ6Y2SPS8zvpbP2TfOHDIXN/s1600-h/BOARD3.2.1.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisg4XL0CzzUBJXXwFSPOmMEizlu-dFQPVrCCLnGO6ZfzqW39CYl1qQsyBxkckxzk3Xe-atVW_0WvGF4DeKJIhlyRPlJ6VwoCTge91mnQPJuXIDxxBUPQMIJQZ6Y2SPS8zvpbP2TfOHDIXN/s400/BOARD3.2.1.JPG" alt="" id="BLOGGER_PHOTO_ID_5167888103763005282" border="0" /></a><p class="MsoNormal" style="line-height: 150%;"><span style="">Consider the two simple for loops given below ,</span><span style=""> <o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">for(i=0;i<32+</span><span style="font-size:85%;">lengt</span><span style="font-size:85%;">h;i++)</span><span style="font-size:85%;"><o:p></o:p></span></p> <p class="MsoNormal" style="margin-left: 0.6in; text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">for(l=0,j=i;j>=0;j--,l++)</span><span style="font-size:85%;"><o:p></o:p></span></p> <p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1in; text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">if(j<32)</span></p> <p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1.5in; text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">if(l</span></p> <p class="MsoNormal" style="margin: 0in 0in 0.0001pt 2.1in; text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">board[j]=message[l];<o:p></o:p></span></p> <p class="MsoNormal" style="margin: 0in 0in 0.0001pt 1.5in; text-indent: 0.9in;font-family:arial;"><span style="font-size:85%;">else</span></p> <p class="MsoNormal" style="margin: 0in 0in 0.0001pt 2.1in; text-indent: 0.9in;"><span style=""><span style="font-size:85%;"><span style="font-family:arial;">board[j]=0;</span></span><o:p></o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt; text-indent: 0.9in; line-height: 150%;"><span style=""><span style=""> </span>in which <span class="blsp-spelling-error" id="SPELLING_ERROR_61">meassage</span> [] is the array that contains the coded <span class="blsp-spelling-error" id="SPELLING_ERROR_62">meassage</span>(say the message is HELLO then<span style=""> </span><span class="blsp-spelling-error" id="SPELLING_ERROR_63">meassge</span>[]={127,8,8,8,127,0,127,1,1,1,0,127,1,1,1,0,…..}), length be the length of the array- message[], and board be an array of size 32 which is initialised to all zeros. In this loop the array board gets changed and it changes as,</span></p> <p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: 150%;"><span style="line-height: 150%;"><o:p> </o:p></span></p> <p class="MsoNormal" style="line-height: 150%;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYH6Gf4SV5yheMY3TRzaqjoUhMiKPqPEVZCSDNOhqB08Htn8AD6fvWaGElPFLr_AlsW08h-roN9ABdirgS1KVfQhyphenhyphen53l-q_ggwU0gtDCYm9zvNlOyc08uZYhKK-nK97rnEXP50NLE9Cscf/s1600-h/ARRAY2.JPG"><img style="cursor: pointer;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYH6Gf4SV5yheMY3TRzaqjoUhMiKPqPEVZCSDNOhqB08Htn8AD6fvWaGElPFLr_AlsW08h-roN9ABdirgS1KVfQhyphenhyphen53l-q_ggwU0gtDCYm9zvNlOyc08uZYhKK-nK97rnEXP50NLE9Cscf/s400/ARRAY2.JPG" alt="" id="BLOGGER_PHOTO_ID_5167911884996923298" border="0" /></a><br /><span style="">and so on…<o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style="">Let us call each of these boards as <span class="blsp-spelling-corrected" id="SPELLING_ERROR_64">different</span> clips now what we have to do is to show these clips at rate not slower than 16 clips per second.<o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style="">Here its very easy to display the first clip, only one vertical line has to be selected so it is enough to pass a value = 0 to the 5 pins, controlling the vertical lines and a value = 127 to the 7 pins, controlling the horizontal line thus the 0<sup><span class="blsp-spelling-error" id="SPELLING_ERROR_65">th</span></sup> vertical line is selected and it will show 127 (binary for 127 is 1111111 <span class="blsp-spelling-error" id="SPELLING_ERROR_66">ie</span> all the 7 <span class="blsp-spelling-error" id="SPELLING_ERROR_67">LEDs</span> are lighted up ) . Now second clip should be shown, but it is not as simple as the first clip at the first sight as here we have to show two vertical lines simultaneously, one with value 127 and another with 8. And in the 3<sup>rd</sup> clip there are 3 vertical lines to be activated and so the number of lines to be activated simultaneously increases with the value of I in the above loop also in some message for some value of this I there may be some state that all the 32 lines should activated simultaneously with a decoder controlling the vertical lines !!!. Here comes the need for the principle of showing the individual lines one by one in short time and repeating it to a certain time (through which we have gone at the top). That is values 0 to 31 is passed to the 5 pins one after the other repeatedly for some time and each time if the value ‘n’ is passed to the 5 pins then the value corresponding to the column ( board[n]) is passed to the 7 pins that controls the rows. Thus it will appear that all the 32 lines are activated with their values simultaneously. Now the matter is only to change the clips just in a time equal to the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_68">persistent</span> of vision so that the clips will appear to have a flow. This can be done by adjusting the time to show each clip.<o:p></o:p></span></p> <p class="MsoNormal" style="line-height: 150%;"><b style=""><u><span style="">INTER FACING THE PARALLEL PORT<o:p></o:p></span></u></b></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><span class="blsp-spelling-corrected" id="SPELLING_ERROR_69">Interfacing</span> of parallel port in the circuit is very simple as all the pins are going to <span class="blsp-spelling-corrected" id="SPELLING_ERROR_70">different</span> points in the circuit and none of the pin is multiplexed. But there is one thing which is to be considered with a little care that here in the display board we are using 12 output pins in which 4 are the control outputs in which the 3<sup>rd</sup> pin alone is active high and the rest 3 are active low. This can be cleared by just adjusting our code, passing ‘n^11’ instead of n to the 5 vertical controlling pins will fix this issue.<o:p></o:p></span></p> <p class="MsoNormal" style="text-indent: 0.9in; line-height: 150%;"><span style=""><o:p> </o:p></span></p> <p class="MsoNormal" style="line-height: 150%;"><b style=""><u><span style="">INTER FACE WITH MICRO CONTROLLER<o:p></o:p></span></u></b></p> <p class="MsoNormal"><span style="">Adding a micro controller <span class="blsp-spelling-corrected" id="SPELLING_ERROR_71">interface</span> to the circuit made it more compact and convenient. The <span class="blsp-spelling-error" id="SPELLING_ERROR_72">ATMega</span>16 <span class="blsp-spelling-corrected" id="SPELLING_ERROR_73">micro controller</span> which have 4 i/o ports is used here in which port A controls the rows, port C controls the vertical columns through the decoder. We have added something more to the circuit here we have included a decimal to binary priority encoder to the circuit whose inputs are controlled by 9 switches in the board and its outputs are passed to the port D of the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_74">micro controller</span>. The addition of input to the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_75">micro controller</span> opened the door way to save 10 messages in it at a time and each of which can be selected using the switches which are connected to the inputs of the encoder whose output controls the <span class="blsp-spelling-corrected" id="SPELLING_ERROR_76">micro controllers</span> input.</span></p><p class="MsoNormal"><b><a href="http://www.box.net/shared/gj8xjqrylz"> Here is the sorce code</a></b><br /></p><p class="MsoNormal"><br /></p><p class="MsoNormal"><span style=""><span></span><span></span><span></span><br /></span></p>ranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.com3tag:blogger.com,1999:blog-5173398349066481794.post-39466809756964180632007-08-18T00:56:00.000+05:302007-08-18T00:57:19.384+05:30Hi friendsyes here starts a another one ...............................ranju.http://www.blogger.com/profile/02142974533652379932noreply@blogger.com2