tag:blogger.com,1999:blog-76429807723662925232024-03-05T20:06:57.213+05:30GTU E.C. Eng. Study MaterialsCHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-7642980772366292523.post-77721010637126189942013-12-29T23:43:00.002+05:302013-12-29T23:43:44.131+05:30<div dir="ltr" style="text-align: left;" trbidi="on">
<b style="background-color: white;"><span style="color: red;">Coming Soon again.......<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3IdSfyAdCYv9xplKNpWceYCU7uMfeSpCEcUA4RdPd_JMV3wrPB_gcHsgf0ZA3d0M1_aCwIAq_n9N1I6ZzxnBTrc3EOMQXEPsTrPO8Q8AJiXg9e2OIAUm44jwJ52eFiHfQMOsNTpVcILM5/s1600/2014-14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3IdSfyAdCYv9xplKNpWceYCU7uMfeSpCEcUA4RdPd_JMV3wrPB_gcHsgf0ZA3d0M1_aCwIAq_n9N1I6ZzxnBTrc3EOMQXEPsTrPO8Q8AJiXg9e2OIAUm44jwJ52eFiHfQMOsNTpVcILM5/s640/2014-14.jpg" width="640" /></a></div>
</span></b></div>
CHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.com1tag:blogger.com,1999:blog-7642980772366292523.post-19080163309520048512012-02-20T23:54:00.000+05:302012-02-20T23:54:36.037+05:30Computer Networks syllabus SEMESTER- VI<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXcyV5EeomFyzeiQqSpRAQvehsXFieo7zYPo2j7Pebv7wRQMoMmO_C_PpEETkMvP8_lw-4b5cVEfSkuTH2xGyfvnEnT-fGyCxva9lH52zgVxvpb8JQwRXgxZr5KLExcbCuaCKj_4viwgYP/s1600/CN.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXcyV5EeomFyzeiQqSpRAQvehsXFieo7zYPo2j7Pebv7wRQMoMmO_C_PpEETkMvP8_lw-4b5cVEfSkuTH2xGyfvnEnT-fGyCxva9lH52zgVxvpb8JQwRXgxZr5KLExcbCuaCKj_4viwgYP/s640/CN.JPG" width="300" /></a></div><br />
</div>CHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-45499868522880239202012-02-20T23:49:00.000+05:302012-02-20T23:49:01.254+05:30VLSI syllabus SEMESTER- VI<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigB3HcPIsmB6L64x0Si_5Wq9Y4tF6gRmBtcI7RZMlADuEFagmyXVXUZDkkesitySAXFCWMumwxKc591wgkfGbNVJ6eABNL_-_Q_wK8G6PTpKXtU-RvBr3uwFAux1rTmUaiMb648VW4wjM-/s1600/VLSI.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigB3HcPIsmB6L64x0Si_5Wq9Y4tF6gRmBtcI7RZMlADuEFagmyXVXUZDkkesitySAXFCWMumwxKc591wgkfGbNVJ6eABNL_-_Q_wK8G6PTpKXtU-RvBr3uwFAux1rTmUaiMb648VW4wjM-/s640/VLSI.JPG" width="427" /></a></div><br />
</div>CHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-62404755680910173722012-02-20T23:31:00.000+05:302012-02-20T23:44:38.972+05:30Mobile Communication syllabus SEMESTER- VI<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaQNN80eVCfpzoJDu7bc1RYRFDg65td1qPQ5IhWzLbMaPeW6s2iWYXUFtJqTkkkcrKUfqkNJBxymCCVIykT1SGtekidy1qak9igqlKZa1zjseSkTtW_4H1jc1QwXz7AVaiqCCezo7U-maI/s1600/sym.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaQNN80eVCfpzoJDu7bc1RYRFDg65td1qPQ5IhWzLbMaPeW6s2iWYXUFtJqTkkkcrKUfqkNJBxymCCVIykT1SGtekidy1qak9igqlKZa1zjseSkTtW_4H1jc1QwXz7AVaiqCCezo7U-maI/s640/sym.JPG" width="296" /></a></div><br />
<span style="color: #3d85c6; font-size: large;"><b><u><br />
</u></b></span><br />
</div>CHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-29120260749912010022012-02-20T23:19:00.000+05:302012-02-20T23:20:26.916+05:30TEACHING SCHEME SEMESTER- VI revised Feb’ 2012<div dir="ltr" style="text-align: left;" trbidi="on"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE4olxePaKjRCkVO3OJXf-_PbzrQcFsfgLphbyVwaZEsZk0G6q3FqfEkK2qO49ulsjZXTm_KDc9_GjChNvGgHZfmRsD8iGuUxIAQAZI3T-RSHziz_wS9VcjQEWunJx2paD8JuEupvS7IuF/s1600/sch1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiE4olxePaKjRCkVO3OJXf-_PbzrQcFsfgLphbyVwaZEsZk0G6q3FqfEkK2qO49ulsjZXTm_KDc9_GjChNvGgHZfmRsD8iGuUxIAQAZI3T-RSHziz_wS9VcjQEWunJx2paD8JuEupvS7IuF/s400/sch1.JPG" width="400" /></a></div><br />
</div>CHAUDHARI MANORANJAN Shttp://www.blogger.com/profile/08532760242449389188noreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-14648557221126933082011-02-10T17:04:00.001+05:302011-04-23T08:08:04.789+05:30COMPUTER NETWORK<div dir="ltr" style="text-align: left;" trbidi="on"><div class="mobile-photo"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj09YG5r-s0BXHIVf_lFboEksOxbCmXe88h_CQGnzPiZqV8DaoxdttrtVkVaQQbqsuV7T7Dbh5pmGhwi4GN8tQwh-F4aZc8CXYcE7beewxuy0QJgZ1YWK_3C683e2E4LWlYsrYRdM6XMzs/s1600/00182d15_medium-792953.jpeg" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5572022964966820946" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj09YG5r-s0BXHIVf_lFboEksOxbCmXe88h_CQGnzPiZqV8DaoxdttrtVkVaQQbqsuV7T7Dbh5pmGhwi4GN8tQwh-F4aZc8CXYcE7beewxuy0QJgZ1YWK_3C683e2E4LWlYsrYRdM6XMzs/s320/00182d15_medium-792953.jpeg" /></a></div></div><div style="text-align: center;"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"></span><br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"></span><br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"></span><br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"></span><br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"></span><br />
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px;"><div style="text-align: center;"><span style="font-size: large;"><span style="color: #336666;">Dow</span><span style="color: #336666;">nload</span><span style="color: #339999;"> </span><span style="color: #6633ff;">E</span><span style="color: #339999;">-</span><span style="color: #cc0000;">b</span><span style="color: #cc9933;">o</span><span style="color: #ffcc33;">o</span><span style="color: #3366ff;">k</span><span style="color: #339999;"> here: (Copy link and download)</span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="color: #339999;"><span class="Apple-style-span" style="font-size: large;"><br />
</span></span></div><div><span class="Apple-style-span" style="color: #339999;"><span class="Apple-style-span" style="font-size: large;"><span class="Apple-style-span" style="color: #000066;">Computer networks</span>, <span class="Apple-style-span" style="color: #330000;">-A. S. Tanenbaum</span>, <span class="Apple-style-span" style="color: #003300;">-PHI</span></span></span><br />
<span class="Apple-style-span" style="color: #003300;"><span class="Apple-style-span" style="font-size: large;">----------------------------------------------------------------------</span></span></div><div><span class="Apple-style-span" style="color: #003300;"><span class="Apple-style-span" style="font-size: large;">copy this link:http://megaupload.com/?d=HW7B2N31</span></span> <br />
<span class="Apple-style-span" style="color: #003300;"><span class="Apple-style-span" style="font-size: large;">-----------------------------------------------------------------------</span></span></div></span></div></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-32604680805664263462011-01-30T23:45:00.001+05:302011-04-23T08:08:36.599+05:30VLSI TECHNOLOGY<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: center;"><span class="Apple-style-span" style="font-size: large;"><span class="Apple-style-span" style="color: #336666;">Dow</span><span class="Apple-style-span" style="color: #336666;">nload</span><span class="Apple-style-span" style="color: #339999;"> </span><span class="Apple-style-span" style="color: #6633ff;">E</span><span class="Apple-style-span" style="color: #339999;">-</span><span class="Apple-style-span" style="color: #cc0000;">b</span><span class="Apple-style-span" style="color: #cc9933;">o</span><span class="Apple-style-span" style="color: #ffcc33;">o</span><span class="Apple-style-span" style="color: #3366ff;">k</span><span class="Apple-style-span" style="color: #339999;"> here: (copy link and download)</span></span></div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHrUF7xDZs7k-gtGB5PGAhI6vzLJG_6GJIrgSu9904NRtxfwUiGY7aajJxeji17qWkTX5n6o2h466bro3fDVBh70kqnuke4UWn2uHfo0z3Tp1YUKRc7StS0OWdiQTG2cectFI2Vpd3OM/s1600/0018c482_medium-795765.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTHrUF7xDZs7k-gtGB5PGAhI6vzLJG_6GJIrgSu9904NRtxfwUiGY7aajJxeji17qWkTX5n6o2h466bro3fDVBh70kqnuke4UWn2uHfo0z3Tp1YUKRc7StS0OWdiQTG2cectFI2Vpd3OM/s1600/0018c482_medium-795765.jpeg" /></a></div><span class="Apple-style-span" style="color: #339999;"><span class="Apple-style-span" style="font-size: large;"><br />
</span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">CMOS DIGITAL INTEGRATED CIRCUITS -</span><span class="Apple-style-span" style="color: #330099;">Sung Mo Kang</span><span class="Apple-style-span" style="color: #330033;"> -TMH</span></div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">(copy and past this link in new tab/window) </span><br />
<span class="Apple-style-span" style="color: #330033;"></span><br />
<span class="Apple-style-span" style="color: #330033;">------------------------------------------------------------------------<br />
http://uploading.com/files/1f9b2b88/0072460539CMOS.rar/<br />
<br />
http://depositfiles.com/files/b2qs5cri7<br />
<br />
http://www.filesonic.com/file/43279429/0072460539CMOS.rar<br />
-------------------------------------------------------------------------<br />
</span><br />
<span class="Apple-style-span" style="color: #330033;"><div><br />
</div></span></div><div style="text-align: center;"><span class="Apple-style-span" style="color: #339999;"><br />
</span></div><div style="text-align: center;"><br />
</div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9uh9Z11Jxs0HnZbCMNaCRmMrU-tozNlKwnbRxSGhs1nWLQlydZ2EJ7D72m2PTxfIHPdWrQnSCPY4DHAzP7zsQK3bgBy0xwr8_Cy8zo1RZy6gTD7x9iZQFF0oC3RYnZzCWei4euo0ukXY/s1600/00133115_medium-705667.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9uh9Z11Jxs0HnZbCMNaCRmMrU-tozNlKwnbRxSGhs1nWLQlydZ2EJ7D72m2PTxfIHPdWrQnSCPY4DHAzP7zsQK3bgBy0xwr8_Cy8zo1RZy6gTD7x9iZQFF0oC3RYnZzCWei4euo0ukXY/s1600/00133115_medium-705667.jpeg" /></a></div><br />
</div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">CMOS VLSI Design</span> - <span class="Apple-style-span" style="color: #000099;">Weste, Harris, Banerjee</span> - Pearson</div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">(copy and past this link in new tab/window)</span><br />
<span class="Apple-style-span" style="color: #330033;"></span><br />
<span class="Apple-style-span" style="color: #330033;">----------------------------------------------------------------------------------<br />
http://depositfiles.com/files/ec9nfxbbp<br />
<br />
http://uploading.com/files/fc227926/0321269772%252B%252BCMOSdesign.rar/<br />
<br />
http://www.megaupload.com/?d=FBFPX8ZX</span></div><div style="text-align: center;">-----------------------------------------------------------------------------------</div><div style="text-align: center;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwSrDWT5Y_FHyU5ywI19dqThyphenhyphentE3KxULxLUaPpb1iYpByshE3KvKgSmgRvYdp6mWvUu489CGZjhm0CUH8M1FH1dE5XgEOWVGy1FPe72yXpQt27HVy56y-iurXG-H4WVcvEd_pefz_6k4k/s1600/00162def_medium-700075.jpeg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwSrDWT5Y_FHyU5ywI19dqThyphenhyphentE3KxULxLUaPpb1iYpByshE3KvKgSmgRvYdp6mWvUu489CGZjhm0CUH8M1FH1dE5XgEOWVGy1FPe72yXpQt27HVy56y-iurXG-H4WVcvEd_pefz_6k4k/s1600/00162def_medium-700075.jpeg" /></a></div><br />
</div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">Circuit design with VHDL</span> – <span class="Apple-style-span" style="color: #333399;">Volnei A Pedroni</span> - PHI</div><div style="text-align: center;"><span class="Apple-style-span" style="color: #330033;">(copy and past this link in new tab/window)</span><br />
<span class="Apple-style-span" style="color: #330033;">----------------------------------------------------------------------------------</span></div><div style="text-align: center;">http://depositfiles.com/files/4ggkoeqwz<br />
<br />
http://www.filesonic.com/file/16302119/Circuit%20Design%20with%20VHDL.rar<br />
-----------------------------------------------------------------------------------</div></div>Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-7642980772366292523.post-10929083749401788652011-01-30T23:17:00.001+05:302011-05-09T14:46:19.695+05:30MOBILE COMMUNICATION<div dir="ltr" style="text-align: left;" trbidi="on"><div style="text-align: center;"><span class="Apple-style-span" style="font-size: large;"><span class="Apple-style-span" style="color: #336666;">Dow</span><span class="Apple-style-span" style="color: #336666;">nload</span><span class="Apple-style-span" style="color: #339999;"> </span><span class="Apple-style-span" style="color: #6633ff;">E</span><span class="Apple-style-span" style="color: #339999;">-</span><span class="Apple-style-span" style="color: #cc0000;">b</span><span class="Apple-style-span" style="color: #cc9933;">o</span><span class="Apple-style-span" style="color: #ffcc33;">o</span><span class="Apple-style-span" style="color: #3366ff;">k</span><span class="Apple-style-span" style="color: #339999;"> here: (click on link and download)</span></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEuhJxqs6MGqaxyH3x1EA01G_m3tFVPSJR3f5wfT24mJuhoHyefyhGczpsAg0PLNOb4mmqIZ94BSMb9oen7QNcaXpio4ykM3X_uYBhXi0QRVRGR3rVRMEFDXQ8IOqbqnFpGWuRvCpEwM8/s1600/0014e3e0_medium-789626.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEuhJxqs6MGqaxyH3x1EA01G_m3tFVPSJR3f5wfT24mJuhoHyefyhGczpsAg0PLNOb4mmqIZ94BSMb9oen7QNcaXpio4ykM3X_uYBhXi0QRVRGR3rVRMEFDXQ8IOqbqnFpGWuRvCpEwM8/s1600/0014e3e0_medium-789626.jpg" /></a></div><span class="Apple-style-span" style="color: #339999;"><span class="Apple-style-span" style="font-size: large;">Download link</span></span><br />
<span class="Apple-style-span" style="font-size: large;">----------------------------------</span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; white-space: pre;">http://depositfiles.com/files/a84r2rjy9</span><br />
<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px; white-space: pre;">--------------------------------------------------------------------</span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family: Arial; font-size: 13px; white-space: pre;">http://www.megaupload.com/?d=YSFQNS29</span></div></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-46126905166566872992011-01-18T12:56:00.001+05:302011-08-01T11:06:57.902+05:30SUBJECT FOR DIPLOMA 6th SEM E.C<div style="text-align: center;"><b><span class="Apple-style-span" style="font-size:large;">GUJARAT TECHNOGICAL UNIVERSITY</span></b></div><div style="text-align: center;"><b><span class="Apple-style-span" style="font-size:large;">DIPLOMA IN ELECTRONICS & COMMNICATION</span></b></div> <div style="text-align: center;"><b><span class="Apple-style-span" style="font-size:large;">ENGINEERING</span></b></div><div style="text-align: center;"><b>PROPOSED TEACHING SCHEME</b></div><div style="text-align: center;"> <b><span class="Apple-style-span" style="font-size:large;">SEMESTER- VI</span></b></div><div style="text-align: center;"><span class="Apple-style-span" style="font-size:large;"><b><br /></b></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-size:large;"><span class="Apple-style-span" style=" ;font-size:small;"><b>SR NO.<span class="Apple-tab-span" style="white-space:pre"> </span> SUBJECT<span class="Apple-tab-span" style="white-space:pre"> </span>THEORY<span class="Apple-tab-span" style="white-space:pre"> </span>PRACTICAL<span class="Apple-tab-span" style="white-space:pre"> </span>CREDITS</b></span></span></div> <div style="text-align: center;"><span class="Apple-style-span" style="font-size:large;"><b><div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;">1 <span class="Apple-tab-span" style="white-space:pre"> </span>Mobile Communication 4 <span class="Apple-tab-span" style="white-space:pre"> </span>2<span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span> 6</span></span></div> <div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;">2 <span class="Apple-tab-span" style="white-space:pre"> </span>VLSI Technology<span class="Apple-tab-span" style="white-space:pre"> </span>4 <span class="Apple-tab-span" style="white-space:pre"> </span>4<span class="Apple-tab-span" style="white-space:pre"> </span> 8</span></span></div> <div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;">3 <span class="Apple-tab-span" style="white-space:pre"> </span>Computer Networks<span class="Apple-tab-span" style="white-space:pre"> </span>3<span class="Apple-tab-span" style="white-space:pre"> </span>2<span class="Apple-tab-span" style="white-space:pre"> </span> 5</span></span></div> <div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;">4 <span class="Apple-tab-span" style="white-space:pre"> </span>Elective Subject <span class="Apple-tab-span" style="white-space:pre"> </span>3<span class="Apple-tab-span" style="white-space:pre"> </span>2<span class="Apple-tab-span" style="white-space:pre"> </span> 5</span></span></div> <div style="text-align: left;"><span class="Apple-style-span" style=" font-weight: normal;font-size:small;"><span class="Apple-tab-span" style="white-space:pre"> </span>[Medical Electronics]</span></div><div style="text-align: left;"><span class="Apple-style-span" style=" font-weight: normal;font-size:small;"><span class="Apple-tab-span" style="white-space:pre"> </span>[Object Oriented Programming]</span></div> <div style="text-align: left;"><span class="Apple-style-span" style=" font-weight: normal;font-size:small;"><span class="Apple-tab-span" style="white-space:pre"> </span>[Mechatronics]</span></div><div style="text-align: left;"><span class="Apple-style-span" style=" font-weight: normal;font-size:small;"><span class="Apple-tab-span" style="white-space:pre"> </span>[Consumer Electronics]</span></div> <div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;">5 <span class="Apple-tab-span" style="white-space:pre"> </span>Project<span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span> 0 <span class="Apple-tab-span" style="white-space:pre"> </span> 6 <span class="Apple-tab-span" style="white-space:pre"> </span> 6</span></span></div> <div style="text-align: left;"><span class="Apple-style-span" style="font-weight: normal;"><span class="Apple-style-span" style="font-size:small;"> TOTAL <span class="Apple-tab-span" style="white-space:pre"> </span>14<span class="Apple-tab-span" style="white-space:pre"> </span> 16<span class="Apple-tab-span" style="white-space:pre"> </span> 30</span></span></div> </b></span></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-54066088347611636312010-11-09T13:17:00.000+05:302010-11-09T13:17:22.075+05:30ALU,Program counter,Instruction decoder<span class="Apple-style-span" style="font-size: x-large;">ALU (arithmetic/logic unit)</span><br />
Performs arithmetic functions such as add,<br />
subtract, multiply, and divide, and logic<br />
functions such as AND, OR, and NOT<br />
<span class="Apple-style-span" style="font-size: x-large;"> Program counter</span><br />
Points to the address of the next<br />
instruction to be executed<br />
As each instruction is executed, the program<br />
counter is incremented to point to the address<br />
of the next instruction to be executed<br />
<span class="Apple-style-span" style="font-size: x-large;"> Instruction decoder</span><br />
Interprets the instruction fetched into the<br />
CPU<br />
A CPU capable of understanding more<br />
instructions requires more transistors to designAnonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-11836838657963479542010-11-09T10:02:00.000+05:302010-11-09T13:10:15.580+05:30Registers<span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial; white-space: pre;"><span class="Apple-style-span" style="font-size: x-large;"><span class="Apple-style-span" style="text-decoration: underline;">Registers</span></span></span><br />
<b>The CPU uses registers to store</b><br />
<b>information temporarily</b><br />
Values to be processed<br />
Address of value to be fetched from memory<br />
In general, the more and bigger the<br />
registers, the better the CPU<br />
Registers can be 8-, 16-, 32-, or 64-bit<br />
The disadvantage of more and bigger registers<br />
is the increased cost of such a CPU<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4w7GEEoxWdPYe1x9h2JKeDNye91MFXkQQT-v0o4JjgP68jSK9dv2po5M4zvtVp60ZZ9W0YqN9AjTZvQhZL-nbwNE-oEkpORa7VRJpluicuQEqrKEteRaE-xdrRwRGhxIBTE-nyyqgKco/s1600/reg.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="352" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4w7GEEoxWdPYe1x9h2JKeDNye91MFXkQQT-v0o4JjgP68jSK9dv2po5M4zvtVp60ZZ9W0YqN9AjTZvQhZL-nbwNE-oEkpORa7VRJpluicuQEqrKEteRaE-xdrRwRGhxIBTE-nyyqgKco/s400/reg.JPG" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-35403990749367256722010-11-09T09:54:00.000+05:302010-11-09T09:54:42.373+05:30INSIDE THE COMPUTER<b><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span"><span class="Apple-style-span" style="font-size: x-large;">Important Terminology</span></span></span></b><br />
<span class="Apple-style-span" style="font-size: x-large;"><b></b></span><br />
<div class="separator" style="clear: both; text-align: center;"></div><b> The unit of data size<br />
<span class="Apple-style-span" style="font-weight: normal;"> Bit : a binary digit that can have the value</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;">0 or 1</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Byte : 8 bits</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Nibble : half of a bye, or 4 bits</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Word : two bytes, or 16 bits</span><br />
The terms used to describe amounts of<br />
memory in IBM PCs and compatibles<br />
<span class="Apple-style-span" style="font-weight: normal;"> Kilobyte (K): 210 bytes</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Megabyte (M) : 220 bytes, over 1 million</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Gigabyte (G) : 230 bytes, over 1 billion</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-weight: normal;"> Terabyte (T) : 240 bytes, over 1 trillion</span><span class="Apple-style-span" style="font-weight: normal;"><br />
</span> <span class="Apple-style-span" style="font-size: medium; font-weight: normal;"></span><br />
<b><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span"><span class="Apple-style-span" style="font-size: x-large;">Internal </span></span><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none;"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span"><span class="Apple-style-span" style="font-size: x-large;">Organization of </span></span><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none;"><span class="Apple-style-span" style="text-decoration: underline;"><span class="Apple-style-span"><span class="Apple-style-span" style="font-size: x-large;">Computers</span></span></span></span></span></span></span></b><span class="Apple-style-span" style="font-size: x-large;"><br />
</span> <br />
<span class="Apple-style-span" style="font-size: medium;"></span> CPU (Central Processing Unit)<br />
<span class="Apple-style-span" style="font-weight: normal;"> Execute information stored in memory</span><br />
<b> I/O (Input/output) devices</b><br />
<span class="Apple-style-span" style="font-weight: normal;"> Provide a means of communicating with<br />
CPU</span><br />
<b> Memory</b><br />
<span class="Apple-style-span" style="font-weight: normal;"> RAM (Random Access Memory) –<br />
temporary storage of programs that<br />
computer is running<br />
The data is lost when computer is off<br />
ROM (Read Only Memory) – contains<br />
programs and information essential to<br />
operation of the computer<br />
The information cannot be changed by use,<br />
and is not lost when power is off<br />
– It is called nonvolatile memory</span></b><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPych8y6Tk1WH6olQqDO_JU5WkwuEWPZC4l7l-rT89DSykpYhFP9XeZnLhjCSIW770B6gs64jIkOfaz2g2D7DV5Bp6GLuTs8_g7YlZlZFz3haaC1y7GFz78FU1BQ1BrcT9gRt5fSL7nnc/s1600/abc.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPych8y6Tk1WH6olQqDO_JU5WkwuEWPZC4l7l-rT89DSykpYhFP9XeZnLhjCSIW770B6gs64jIkOfaz2g2D7DV5Bp6GLuTs8_g7YlZlZFz3haaC1y7GFz78FU1BQ1BrcT9gRt5fSL7nnc/s400/abc.JPG" width="400" /></a></div><br />
<br />
<b><span class="Apple-style-span"></span><span class="Apple-style-span" style="font-weight: normal;"></span></b><br />
<b><b>The CPU is connected to memory and</b><br />
<b>I/O through strips of wire called a bus</b><br />
<span class="Apple-style-span" style="font-weight: normal;"> Carries information from place to place<br />
Address bus<br />
Data bus<br />
Control bus</span></b><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1moMiXPz4fgBtCj2n_iNBdVQajtdbTzEgMRudoTdpJQMUBwJpfKvPbjKsK4NUgkN01jYktqXCRgt2PxqbwlyTCLiO8Inr42FH5hyphenhyphenWXMcY4KYKHz1xBZbFXrKyUAS46f2VrQ7dOdIaE5Y/s1600/cpu-2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1moMiXPz4fgBtCj2n_iNBdVQajtdbTzEgMRudoTdpJQMUBwJpfKvPbjKsK4NUgkN01jYktqXCRgt2PxqbwlyTCLiO8Inr42FH5hyphenhyphenWXMcY4KYKHz1xBZbFXrKyUAS46f2VrQ7dOdIaE5Y/s400/cpu-2.PNG" width="400" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: left;"><b> Address bus</b></div><div class="separator" style="clear: both; text-align: left;"> For a device (memory or I/O) to be</div><div class="separator" style="clear: both; text-align: left;">recognized by the CPU, it must be</div><div class="separator" style="clear: both; text-align: left;">assigned an address</div><div class="separator" style="clear: both; text-align: left;"> The address assigned to a given device must</div><div class="separator" style="clear: both; text-align: left;">be unique</div><div class="separator" style="clear: both; text-align: left;"> The CPU puts the address on the address bus,</div><div class="separator" style="clear: both; text-align: left;">and the decoding circuitry finds the device</div><div class="separator" style="clear: both; text-align: left;"><b> Data bus</b></div><div class="separator" style="clear: both; text-align: left;"> The CPU either gets data from the device</div><div class="separator" style="clear: both; text-align: left;">or sends data to it</div><div class="separator" style="clear: both; text-align: left;"><b> Control bus</b></div><div class="separator" style="clear: both; text-align: left;"> Provides read or write signals to the</div><div class="separator" style="clear: both; text-align: left;">device to indicate if the CPU is asking for</div><div class="separator" style="clear: both; text-align: left;">information or sending it information</div><br />
<div class="separator" style="clear: both; text-align: left;"><b> The more data buses available, the</b></div><b><span class="Apple-style-span" style="font-weight: normal;"></span></b><br />
<b><b>better the CPU</b><br />
Think of data buses as highway lanes<br />
<b> More data buses mean a more</b><br />
<b>expensive CPU and computer</b><br />
The average size of data buses in CPUs<br />
varies between 8 and 64<br />
<b> Data buses are bidirectional</b><br />
To receive or send data<br />
<b> The processing power of a computer is</b><br />
<b>related to the size of its buses</b><br />
<b></b><br />
<b>The more address buses available, the<br />
larger the number of devices that can<br />
be addressed<br />
The number of locations with which a<br />
CPU can communicate is always equal<br />
to 2x, where x is the address lines,<br />
regardless of the size of the data bus<br />
<span class="Apple-style-span" style="font-weight: normal;"> ex. a CPU with 24 address lines and 16</span><br />
<span class="Apple-style-span" style="font-weight: normal;">data lines can provide a total of 224 or 16M</span><br />
<span class="Apple-style-span" style="font-weight: normal;">bytes of addressable memory</span><br />
<span class="Apple-style-span" style="font-weight: normal;"> Each location can have a maximum of 1</span><br />
<span class="Apple-style-span" style="font-weight: normal;">byte of data, since all general-purpose</span><br />
<span class="Apple-style-span" style="font-weight: normal;">CPUs are byte addressable</span><br />
The address bus is unidirectional<br />
<br />
<span class="Apple-style-span" style="font-size: x-large;"><span class="Apple-style-span" style="text-decoration: underline;">CPU’s Relation to RAM and ROM</span></span><br />
<span class="Apple-style-span" style="font-size: x-large;"></span><br />
<span class="Apple-style-span" style="font-size: medium;"> For the CPU to process information,</span><br />
<span class="Apple-style-span" style="font-size: medium;">the data must be stored in RAM or</span><br />
<span class="Apple-style-span" style="font-size: medium;">ROM, which are referred to as primary</span><br />
<span class="Apple-style-span" style="font-size: medium;">memory</span><br />
<span class="Apple-style-span" style="font-size: medium;"> ROM provides information that is fixed</span><br />
<span class="Apple-style-span" style="font-size: medium;">and permanent</span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;"> Tables or initialization program</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"> RAM stores information that is not</span><br />
<span class="Apple-style-span" style="font-size: medium;">permanent and can change with time</span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;"> Various versions of OS and application</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;">packages</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;"> CPU gets information to be processed</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;"> first form RAM (or ROM)</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;"> if it is not there, then seeks it from a mass</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;">storage device, called secondary memory, and</span></span><br />
<span class="Apple-style-span" style="font-size: medium;"><span class="Apple-style-span" style="font-weight: normal;">transfers the information to RAM</span></span><br />
<br />
</b><br />
<br />
<br />
</b>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-77065402752799406702010-09-25T20:44:00.000+05:302010-09-25T20:44:11.519+05:30Arithmetic Operations-instruction set 8051<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieG0hfiFeVpoNHckRna4Vhwkl-zq8ClLHI3LnBsMnzVIhIkfoaYc69jgQlM-Q6m6y_J5vgPHy4K3jC6a7jKsPYVBJNoXeW77rrbx9NlhzgouB2Ym5ujNZTSv8JReqGKXVuWi6sLoL_1y8/s1600/arithmetic.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieG0hfiFeVpoNHckRna4Vhwkl-zq8ClLHI3LnBsMnzVIhIkfoaYc69jgQlM-Q6m6y_J5vgPHy4K3jC6a7jKsPYVBJNoXeW77rrbx9NlhzgouB2Ym5ujNZTSv8JReqGKXVuWi6sLoL_1y8/s1600/arithmetic.PNG" /></a></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-30625928924558497142010-09-25T20:42:00.001+05:302010-09-25T20:45:04.281+05:30Logic Operations-instruction set 8051<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKN5p_Xei2VKJD5zOQw44_C2tAXjn_OG89R0KeCa0ZZaNxBs6dlyDp2yHFZuLT3N2ZyDDxqpVTGF4nmqQyaJjQwUdyplOCwdCuDEznuq0q97Kp5lwZ1-uo8n99abiPKHBlzBFp7toX6e0/s1600/logical.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKN5p_Xei2VKJD5zOQw44_C2tAXjn_OG89R0KeCa0ZZaNxBs6dlyDp2yHFZuLT3N2ZyDDxqpVTGF4nmqQyaJjQwUdyplOCwdCuDEznuq0q97Kp5lwZ1-uo8n99abiPKHBlzBFp7toX6e0/s1600/logical.PNG" /></a></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-59100293981420183952010-09-25T20:41:00.000+05:302010-09-25T20:41:18.175+05:30Data Transfer-instruction set 8051<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHsxlbYi_ZVkjr8d7xiOOcHjWri2hCtfxWgjzEXLpB0V0jfGgQ7tJv00azoQKbNyPckK0rucYWdS5Hcr3sMAWhOo-jz4z-InoE9np9ddlEYAP2KqYeP0C5JWwhj-AhUi2g0yk2RPAquyc/s1600/datatransfer.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHsxlbYi_ZVkjr8d7xiOOcHjWri2hCtfxWgjzEXLpB0V0jfGgQ7tJv00azoQKbNyPckK0rucYWdS5Hcr3sMAWhOo-jz4z-InoE9np9ddlEYAP2KqYeP0C5JWwhj-AhUi2g0yk2RPAquyc/s1600/datatransfer.PNG" /></a></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-4024521940427564072010-09-25T20:38:00.001+05:302010-09-25T20:47:59.269+05:30Boolean Variable Manipulation-instruction set 8051<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0KRM9hts3ymJEib5DTqfuHje1G3LgaASASE8vrOTrnY_fXDi6pk8GMVKBubJEzzGKeMGXZkL_zOA_-MkGlaOTGPGz9i-kz1UOGHk66f24p7NA663h8JEcwECk2FSUgpJ_I6GxfDjPZWM/s1600/boolian.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0KRM9hts3ymJEib5DTqfuHje1G3LgaASASE8vrOTrnY_fXDi6pk8GMVKBubJEzzGKeMGXZkL_zOA_-MkGlaOTGPGz9i-kz1UOGHk66f24p7NA663h8JEcwECk2FSUgpJ_I6GxfDjPZWM/s1600/boolian.PNG" /></a></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-22317703203030352812010-09-25T20:21:00.000+05:302010-09-25T20:47:47.210+05:30Program and Machine Control-instruction set 8051<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm0PEkK1Peu8AZJibNFp7nxGbvwdV80idvBpTMBclHXvDh4zh1021lbSp6p36ZBcTEovVlwqgW7ifS4gGEAbKZZUutwS34MmH21G0EXn6emWS-o1fEHa2drL5hwDL8M0ojmrXEYwnToQQ/s1600/program.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgm0PEkK1Peu8AZJibNFp7nxGbvwdV80idvBpTMBclHXvDh4zh1021lbSp6p36ZBcTEovVlwqgW7ifS4gGEAbKZZUutwS34MmH21G0EXn6emWS-o1fEHa2drL5hwDL8M0ojmrXEYwnToQQ/s1600/program.PNG" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-13772458965776682712010-08-25T14:09:00.000+05:302010-08-25T14:09:51.632+05:30Interfacing Relay to 8051<div style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">Relays are devices which allow low power circuits to switch a relatively high Current/Voltage ON/OFF. For a relay to operate a suitable <span class="MsoIntenseEmphasis"><strong><em><span style="color: #4f81bd;">pull-in & holding current</span></em></strong></span>should be passed through its coil. Generally relay coils are designed to operate from a particular voltage often its 5V or 12V.</span></div><div style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"><span class="MsoIntenseEmphasis"><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;">The function of relay driver circuit is to provide the necessary current (typically 25 to 70ma) to energize the relay coil.</span></span></span></em></strong></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMtYhu5QhQvb53hD4R8DiG47u4I9BwXOqqcOaJQOWtSpdAF-PxGth0efw2GRsX1YxPk8dJCBTZ55VG0cRJVE9_rumx8vRyBPr8oLw12IrfEABGhxPitmq9yq9XEYy9giUtZeOsRqookA/s1600/Relay+Driver+Circuit+using+single+transistor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqMtYhu5QhQvb53hD4R8DiG47u4I9BwXOqqcOaJQOWtSpdAF-PxGth0efw2GRsX1YxPk8dJCBTZ55VG0cRJVE9_rumx8vRyBPr8oLw12IrfEABGhxPitmq9yq9XEYy9giUtZeOsRqookA/s400/Relay+Driver+Circuit+using+single+transistor.jpg" width="400" /></a></div><div style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; text-align: center;"><span class="MsoIntenseEmphasis"><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;"><br />
</span></span></span></em></strong></span></div><div style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="color: black; font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; font-style: normal; font-weight: normal;"></span></span></span></span></em></strong></div><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;"><div style="display: inline !important;"><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">Figure 1<em><span style="font-family: Calibri, sans-serif;"> </span></em>shows the basic relay driver circuit. As you can see an <span class="MsoIntenseEmphasis"><strong><em><span style="color: #4f81bd;">NPN transistor BC547</span></em></strong></span> is being used to control the relay. The transistor is driven into saturation (turned ON) when a LOGIC 1 is written on the PORT PIN thus turning ON the relay. The relay is turned OFF by writing LOGIC 0 on the port pin. </span><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">A diode (1N4007/1N4148) is connected across the relay coil; this is done so as to protect the transistor from damage due to the <span class="MsoIntenseEmphasis"><strong><em><span style="color: #4f81bd;">BACK EMF</span></em></strong></span> generated in the relay's inductive coil when the transistor is turned OFF. When the transistor is switched OFF the energy stored in the inductor is dissipated through the diode & the internal resistance of the relay coil. Normally 1N4148 can be used as it is fast switching diode with a maximum forward current of 300ma. This diode is also called as </span><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">free-wheeling diode.</span></div></span></span></span></em></strong><br />
<div style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"><span class="MsoIntenseEmphasis"><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="color: black; font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; font-style: normal; font-weight: normal;"></span></span></span></span></em></strong></span></div><strong><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Calibri;"><div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">The LED is used to indicate that the RELAY has been turned ON. The resistor R1 defines the current flowing through the LED thereby defining the LED’s intensity.</span></div><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">Resistor R2 is used as a Series Base Resistor to set the base current. When working with 8051 controllers I have noted that it’s not compulsory to use this resistor as the controller has internal 10k resistor which acts as a base resistor.</span><br />
<span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;">Microcontrollers have internal pull up resistors hence when a port pin is HIGH the output current flows through this internal pull up resistor. </span><span class="MsoIntenseEmphasis"><span style="font-size: 11pt; line-height: 17px;"><strong><em><span style="color: #4f81bd; font-family: 'Times New Roman';">8051 microcontrollers</span></em></strong></span></span><span style="font-family: Calibri, sans-serif; font-size: 11pt; line-height: 17px;"> have an internal pull up of 10KΩ. Hence the maximum output current will be 5v/10k = 0.5ma. </span><span style="font-size: small;"><span style="font-family: Calibri;">This current is not sufficient to drive the transistor into saturation and turn ON the relay. Hence an external pull up resistor R3 is used. Let us now calculate the value of R3. Normally a relay requires a pull in current of 70ma to be turned ON. So our BC547 transistor will require enough base current to make sure it remains saturated and provide the necessary collector current i.e. 70ma. The gain (h<sub>fe</sub>) of BC547 is 100 so we need to provide at least<span> 70ma/100 = 0.7ma</span></span></span><span style="font-size: small;"><span style="font-family: Calibri;"><span> </span>of base current. In practice you require roughly double the value of this current so we will calculate for 1.4ma</span></span><span style="font-size: small;"><span style="font-family: Calibri;"><span> </span>of base current.</span></span><br />
<div align="center"><span style="font-family: Calibri; font-size: small;">Base Current(1.4ma) =o/p current of controller (0.5ma) + 5v/R3</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYOTU235lmSiUQ9emXr2A2SGLE3tykK7jlcAmDxvDw0L2Jc3dYJ946zYx00mwZHN_A63YNdud2lUtOang0JZYnI2_J8TZW3Y3WPdiA7wOGmp5RUUThcBapvOqURTq_7_WmoqpMNmVRsOY/s1600/Relay+Driver+Circuit+using+two+transistor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYOTU235lmSiUQ9emXr2A2SGLE3tykK7jlcAmDxvDw0L2Jc3dYJ946zYx00mwZHN_A63YNdud2lUtOang0JZYnI2_J8TZW3Y3WPdiA7wOGmp5RUUThcBapvOqURTq_7_WmoqpMNmVRsOY/s400/Relay+Driver+Circuit+using+two+transistor.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"></div><div align="center"><span style="font-family: Calibri;"><span style="font-size: small;">From the above equation the value of R3 comes out to be 5.55K<span>Ω. Typically I use 4.7KΩ resistor.</span></span></span></div><span style="font-family: Calibri; font-size: small;">Whenever 8051 microcontroller is turned ON initially the controller is in reset state and all the controller pins are HIGH<strong> </strong>which would result in TURNING ON the relay every time power is turned ON or if there is a power fluctuation. This may also damage the device connected to relay so as to avoid this problem another transistor Q2 has been added between the controller & the previous transistor. This transistor acts as an inverter.Figure 2 shows the upated Relay Driver Circuit. So now when a High is applied from the controller the TRANSISTOR Q2 turns ON so the base of transistor Q1 gets 0 so the transistor Q1 turns OFF so the relay turns OFF. And when a LOW is applied from the controller the TRANSISTOR Q2 turns OFF so the base of transistor Q1 gets high voltage through the resistor R2 so the transistor Q1 turns ON which turns ON the relay.</span><br />
<div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">So basically Q2 & R2 acts as an inverter.</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyVZc0dOnGySYohTZPCN3K_kymsPhHLA8GwBhQhNsXthaeWRDFZeyC11TBpzfceC8hugEXOolH4ZQte_jbG29qxeeWo4DCVdUyC7JR7gl4AcTqopcIyUeYJrtUdb0sI0oIKD1neofwfv0/s1600/Relay+Driver+Circuit+using+ULN2003.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyVZc0dOnGySYohTZPCN3K_kymsPhHLA8GwBhQhNsXthaeWRDFZeyC11TBpzfceC8hugEXOolH4ZQte_jbG29qxeeWo4DCVdUyC7JR7gl4AcTqopcIyUeYJrtUdb0sI0oIKD1neofwfv0/s400/Relay+Driver+Circuit+using+ULN2003.jpg" width="400" /></a></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-family: Calibri; font-size: medium;">If you want to connect more relays to microcontroller then you can use ULN 2003 for connecting seven relays or ULN 2803 for connecting eight relays. Figure 3 shows how to connect a relay to microcontroller using ULN 2003/ULN 2803.<span> </span>These IC’s are high voltage, high current Darlington transistor arrays with open collector outputs and free-wheeling clamping diodes hence there is no need of a diode across the relay. Also there is no need of the series base resistor as the IC has an internal resistor of 2.7KΩ</span></div><div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;"><br />
</span></div><br />
<div align="center"><span style="font-family: Calibri; font-size: small;"><br />
</span></div></span></span></span></em></strong>Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-7642980772366292523.post-65384730541674243382010-08-25T14:01:00.000+05:302010-08-25T14:04:20.216+05:30Interfacing LCD to 8051<span class="Apple-style-span" style="font-family: Calibri; line-height: 20px;">Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. The most common type of LCD controller is HITACHI 44780 which provides a simple interface between the controller & an LCD. These LCD's are very simple to interface with the controller as well as are cost effective.</span><br />
<span class="Apple-style-span" style="font-family: Calibri; line-height: 20px;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif;"><span style="font-family: Calibri;">The most commonly used </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">ALPHANUMERIC</span></em></span></span><span style="font-family: Calibri;"><strong></strong>displays are </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">1x16 </span></em></span></span><span style="font-family: Calibri;">(Single Line & 16 characters), </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">2x16 </span></em></span></span><span style="font-family: Calibri;">(Double Line & 16 character per line) & </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">4x20</span></em></span></span><span style="font-family: Calibri;"><strong> </strong>(four lines & Twenty characters per line). </span></span></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE6KAMhCHHFwVraDf4mjhxVg0MXykuzr3KJy9qniPO0UnJzGEemOQ31fC-RnZC4xwIvyD1YcmfZnrUD2eYiHxQn2qmb7yycUPMVw3inhXNOm1wA9z3NbDj6u0xHJrs93Kc1YCWMdDhIcw/s1600/lcd162.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE6KAMhCHHFwVraDf4mjhxVg0MXykuzr3KJy9qniPO0UnJzGEemOQ31fC-RnZC4xwIvyD1YcmfZnrUD2eYiHxQn2qmb7yycUPMVw3inhXNOm1wA9z3NbDj6u0xHJrs93Kc1YCWMdDhIcw/s320/lcd162.jpg" /></a></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"></span></div><span style="font-size: small;"><span style="font-family: Calibri;">The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode.</span></span><br />
<div align="center"><table border="1" cellpadding="0" class="MsoNormalTable" style="border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; width: 260px;"><tbody>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Pin</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Symbol</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;">Function</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 1</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Vss</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Ground</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 2</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Vdd</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Supply Voltage</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 3</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Vo</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Contrast Setting</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 4</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> RS</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Register Select</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 5</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> R/W</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Read/Write Select</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 6</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> En</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Chip Enable Signal</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 7-14</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> DB0-DB7</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Data Lines</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 15</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> A/Vee</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Gnd for the backlight</span></td></tr>
<tr><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> 16</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> K</span></td><td style="background-attachment: initial; background-clip: initial; background-color: #cccccc; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(187, 187, 187); border-bottom-style: dashed; border-bottom-width: 1pt; border-left-color: rgb(187, 187, 187); border-left-style: dashed; border-left-width: 1pt; border-right-color: rgb(187, 187, 187); border-right-style: dashed; border-right-width: 1pt; border-top-color: rgb(187, 187, 187); border-top-style: dashed; border-top-width: 1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt;"><span style="font-family: Verdana, sans-serif; font-size: 7.5pt;"> Vcc for backlight</span></td></tr>
</tbody></table></div><br />
<span style="font-size: small;"><span style="font-family: Calibri;">When </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">RS</span></em></span></span><span style="font-family: Calibri;"> is low (0), the data is to be treated as a command. When RS is high (1), the data being sent is considered as text data which should be displayed on the screen.</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">When </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">R/W</span></em></span></span><span style="font-family: Calibri;"> is low (0), the information on the data bus is being written to the LCD. When RW is high (1), the program is effectively reading from the LCD. Most of the times there is no need to read from the LCD so this line can directly be connected to Gnd thus saving one controller line.</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">The </span><span class="SubtitleChar"><span style="font-size: 12pt; line-height: 18px;"><em><span style="color: #4f81bd; font-family: Cambria;">ENABLE</span></em></span></span><span style="font-family: Calibri;"> pin is used to latch the data present on the data pins. A HIGH - LOW signal is required to latch the data. The LCD interprets and executes our command at the instant the EN line is brought low. If you never bring EN low, your instruction will never be executed.</span></span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNM8A-G8QhTxZjUYqxOkvk1knPx-4ltpYLPR8XNX5vbsIBt1Mhw3Qqf68_j3YSNB5ojr1tqJNcAX8w-wBA0C3bj26WfzclKB0_N85cRo8ARiEHmFOIFp8VCD4CCeIDmtyMY0m-S3kC_yY/s1600/lcddia.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNM8A-G8QhTxZjUYqxOkvk1knPx-4ltpYLPR8XNX5vbsIBt1Mhw3Qqf68_j3YSNB5ojr1tqJNcAX8w-wBA0C3bj26WfzclKB0_N85cRo8ARiEHmFOIFp8VCD4CCeIDmtyMY0m-S3kC_yY/s320/lcddia.JPG" /></a></div><div class="separator" style="clear: both; text-align: left;"></div><span style="font-size: small;"><span style="font-family: Calibri;">For Contrast setting a 10K pot should be used as shown in the figure.</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">Display Data Ram (DDRAM) stores the display data. So when we have to display a character on LCD we basically write it into DDRAM. For a 2x16 LCD the DDRAM address for first line is from 80h to 8fh & for second line is 0c0h to 0cfh. So if we want to display 'H' on the 7<sup>th</sup> postion of the first line then we will write it at location 87h.</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">Now as you have noticed two types of data is given to the LCD data to be displayed, command or special instruction.</span></span><span style="font-size: small;"><span style="font-family: Calibri;">So now let us write a subroutine for both the type of data</span></span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Data to be Displayed</span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">lcd_datadisplay:</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">SETB RS //Telling the LCD that the data which is being send is to be displayed</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV P1,A //Character to be displayed is in Acc</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">SETB EN</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CLR EN //High to Low pulse on EN to latch the data</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL DELAY //Delay so that LCD finishes its internal operations</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ret</span></span><span style="font-family: 'Lucida Sans', sans-serif; font-size: 10pt;"> </span></blockquote></blockquote><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Command or Special Instruction.</span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">lcd_command:</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CLR RS //Telling the LCD that the data which is being send is a command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV P1,A //Character to be displayed is in Acc</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">SETB EN</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CLR EN //High to Low pulse on EN to latch the data</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL DELAY //Delay so that LCD finishes its internal operations</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ret</span></span><span style="font-family: 'Lucida Sans', sans-serif; font-size: 10pt; line-height: 14px;"> </span></blockquote></blockquote><span style="font-family: 'Lucida Sans', sans-serif; font-size: 10pt; line-height: 14px;">Here I have used delay at the end of both the subroutines this is done to wait until the instruction is completely executed by the LCD. This will assure that our program gives the LCD the time it needs to execute instructions and also makes our program compatible with any LCD, regardless of how fast or slow it is. </span><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZnrOBwpEHR9x0Ll2TWtwXOgc5v0s4rTN8ttStpMfhZu6AKQkv_MZtdXfmKzj0r0d0zGH1-wBrqyESdOJ5BYOOUu2-qfkMwxHxMEQJNYzAcWwjTr5xOwdR9Ur4WIFWfopGpkp0F1i6MDo/s1600/commandset.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZnrOBwpEHR9x0Ll2TWtwXOgc5v0s4rTN8ttStpMfhZu6AKQkv_MZtdXfmKzj0r0d0zGH1-wBrqyESdOJ5BYOOUu2-qfkMwxHxMEQJNYzAcWwjTr5xOwdR9Ur4WIFWfopGpkp0F1i6MDo/s640/commandset.JPG" width="640" /></a></div><div class="separator" style="clear: both; text-align: left;"></div><h6><em><span style="font-size: small;"><span style="color: #243f60;"><span style="font-family: Cambria;">"*" - Not Used/Ignored. This bit can be either "1" or "0" </span></span></span></em></h6><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Set Cursor Move Direction:</span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">ID - Increment the Cursor After Each Byte Written to Display if Set</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">S - Shift Display when Byte Written to Display Enable Display/Cursor</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">D - Turn Display On(1)/Off(0) </span></span><span style="font-size: small;"><span style="font-family: Calibri;">C - Turn Cursor On(1)/Off(0)</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">B - Cursor Blink On(1)/Off(0) </span></span></blockquote></blockquote><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Move Cursor/Shift Display</span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">SC - Display Shift On(1)/Off(0) </span></span><span style="font-size: small;"><span style="font-family: Calibri;">RL - Direction of Shift Right(1)/Left(0) </span></span></blockquote></blockquote><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Set Interface Length</span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">DL - Set Data Interface Length 8(1)/4(0)</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">N - Number of Display Lines 1(0)/2(1)</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">F - Character Font 5x10(1)/5x7(0) </span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">Poll the "Busy Flag" BF - This bit is set while the LCD is processing </span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">Move Cursor to CGRAM/Display</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">A - Address </span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">Read/Write ASCII to the Display</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">D - Data </span></span><span style="color: #999999; font-family: Verdana, sans-serif; font-size: 8.5pt; line-height: 12px;"> </span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">The above Table shows the different commands for the LCD. I wont go into its details.</span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;">Before starting to display on LCD we need to Initialize it. Firstly we must tell the LCD whether we'll be using 8-bit or 4-bit mode. Also we will be telling the LCD that we need 5x8 character font. Both these options are selected using a single command i.e. 38h. So to activate both these options we must execute following instructions:</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#38h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><span style="color: #999999; font-family: Verdana, sans-serif; font-size: 8.5pt; line-height: 12px;"> </span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">Now that we have to Turn On the display & set the cursor option i.e. cursor ON/OFF & Cursor blinking ON/OFF for that we will use the command 0Eh i.e. Display On , Cursor ON but Cursor blinking OFF.</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#0Eh</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><span style="color: #999999; font-family: Verdana, sans-serif; font-size: 8.5pt; line-height: 12px;"> </span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">And the last command we require is to configure the LCD in such a way that everytime we send a character to it the cursor position automatically increments by one & moves to right i.e. 06h.</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#06h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><span style="color: #999999; font-family: Verdana, sans-serif; font-size: 8.5pt; line-height: 12px;"> </span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">So the lcd_initialize contains the following instructions</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">lcd_initialize:</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#38h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#38h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#38h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ret </span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">Similarly another important instruction that we require is Clearing the LCD i.e. </span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">lcd_clr:</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#01h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ret</span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;">Now we know all the commands to display on LCD. Let us write a program that will display 'DNA TECHNOLOGY' on LCD.</span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ORG 0000h</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_initialize</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_clr</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#80h //Location from where Data is to be displayed</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_command</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'D'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'N'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'A'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#20h //Hex value for blank space to be displayed</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'T'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'E</span></span><span style="font-size: small;"><span style="font-family: Calibri;">'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'C'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'H'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'N'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'O'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'L'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'O'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'G'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">MOV A,#'Y'</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">CALL lcd_datadisplay</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">stop:</span></span><br />
<span style="font-family: Symbol;"><span style="font-size: small;">·</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span><span style="font-size: small;"><span style="font-family: Calibri;">ajmp stop</span></span><span style="color: #999999; font-family: Verdana, sans-serif; font-size: 8.5pt; line-height: 12px;"> </span></blockquote></blockquote><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Debugging Procedure </span></span></span></h2><span style="font-size: small;"><span style="font-family: Calibri;">If the above program does not work then follow these steps:-</span></span><br />
<div dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">1) Check if the supply is correct.</span></span></div><div dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">2)<strong> </strong>If all connections are correct.</span></span></div><div dir="ltr" style="margin-right: 0px;"><span style="font-size: small;"><span style="font-family: Calibri;">3) Increase the delay time.</span></span></div><br />
<div style="text-align: center;"><span style="font-family: 'Lucida Sans', sans-serif; font-size: 10pt; line-height: 14px;"><br />
</span></div><br />
<div style="text-align: center;"><span style="font-size: small;"><span style="font-family: Calibri;"><br />
</span></span></div><span style="font-size: small;"><span style="font-family: Calibri;"></span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;"></span></span><span style="font-size: small;"><span style="font-family: Calibri;"></span></span><span style="font-size: small;"><span style="font-family: Calibri;"></span></span><br />
<div style="text-align: center;"><span class="Apple-style-span" style="font-family: Calibri; line-height: 20px;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif;"><span style="font-family: Calibri;"><br />
</span></span></span></div><span class="Apple-style-span" style="font-family: Calibri; line-height: 20px;"><br />
</span>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-53065143547742018822010-08-25T13:49:00.000+05:302010-08-25T13:50:49.187+05:30Interfacing Matrix Keypad to 8051<div class="MsoNormal" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">Before learning “Interfacing Matrix Keypad to Microcontroller” you should know how to interface a switch to microcontroller for which please click </span><u><span style="color: blue; font-family: Calibri; font-size: small;"><a href="http://gtuecmaterial.blogspot.com/2010/08/interfacing-switch-to-microcontroller.html">here</a></span></u><span style="font-family: Calibri; font-size: small;">.</span></div><div class="MsoNormal" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">As you have seen in the article for </span><u><span style="color: blue; font-family: Calibri; font-size: small;">interfacing switches to microcontroller</span></u><span style="font-family: Calibri; font-size: small;"> normally the port pin is high but when a switch is pressed the controller pin gets a Low signal and we come to know that a switch has been pressed. One end of switch is connected to the port pin whereas the other end is connected to the Ground.</span></div><div class="MsoNormal" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">In case of matrix Keypad both the ends of switches are connected to the port Pin. Over here we have considered a 4x3 matrix keypad i.e. four rows and three columns. So in all twelve switches have been interfaced using just seven lines. The adjoining figure shows the diagram of a matrix keypad and how it is interfaced with the controller.</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH_Crl7j2ZaHE4yeQYkrIO0-iGzFzHhiVOJO8MruubOEpsaI9C7VSFKFzUEocyQNGkOXRm24NvAp3cAlNukWg9cIOIpeVAFdeDp1B_QouYcuqkOKfH72RmJz5VQcoR9SS5tOoLnprSAPI/s1600/keypad1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH_Crl7j2ZaHE4yeQYkrIO0-iGzFzHhiVOJO8MruubOEpsaI9C7VSFKFzUEocyQNGkOXRm24NvAp3cAlNukWg9cIOIpeVAFdeDp1B_QouYcuqkOKfH72RmJz5VQcoR9SS5tOoLnprSAPI/s320/keypad1.jpg" /></a></div><div class="separator" style="clear: both; text-align: left;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"></span></div><div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">As you can see no pin is connected to ground, over here the controller pin itself provides the ground. We pull one of the Column Pins low & check the row pins if any of the Pin is low then we come to know which switch is pressed.</span></div><div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">Suppose we make column 1 pin low and while checking the rows we get Row 3 is low then we come to know switch 7 has been pressed.</span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGQoo61UFqbPLtnpJfS6Ybbu2O2KRRkPpNXmhLUSci28s1ncDogNpM1bqx-e2V63Xgf6c49itYfxTdsXvZbjG7F7gb-9FUJkuWiBn6jPn04eV7njGrtc9gsyGVkeplibiJHzNjBHsLw0k/s1600/matrix_keypad1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGQoo61UFqbPLtnpJfS6Ybbu2O2KRRkPpNXmhLUSci28s1ncDogNpM1bqx-e2V63Xgf6c49itYfxTdsXvZbjG7F7gb-9FUJkuWiBn6jPn04eV7njGrtc9gsyGVkeplibiJHzNjBHsLw0k/s320/matrix_keypad1.jpg" width="320" /></a></div><div class="separator" style="clear: both; text-align: center;"><br />
</div><div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px;"></span></span></div><span style="font-family: Calibri; font-size: small;"></span><br />
<span style="font-family: Calibri; font-size: small;"><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span style="color: #4f81bd; font-family: Cambria; font-size: medium;">ALGORITHM</span></h2><div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Start.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Make All Pins High.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Make Column 1 pin low.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 1 is low, if yes then Switch 1 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 2 is low, if yes then Switch 4 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 3 is low if yes then Switch 7 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 4 is low if yes then Switch 10 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">8.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Make Column 1 Pin high & Column 2 Pin Low.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">9.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 1 is low, if yes then Switch 2 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">10.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 2 is low, if yes then Switch 5 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">11.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 3 is low if yes then Switch 8 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">12.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 4 is low if yes then Switch 11 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">13.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Make Column 2 Pin high & Column 3 Pin Low.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">14.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 1 is low, if yes then Switch 3 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">15.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if Row 2 is low, if yes then Switch 6 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">16.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 3 is low if yes then Switch 9 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">17.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Check if row 4 is low if yes then Switch 12 has been pressed.</span></div><div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">18.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Make column 3 pin high</span></div><div class="MsoListParagraphCxSpLast" style="margin-bottom: 10pt; margin-left: 0.5in; margin-right: 0in; margin-top: 0in; text-indent: -0.25in;"><span style="font-family: Calibri; font-size: small;">19.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span><span style="font-family: Calibri; font-size: small;">Stop</span></div><br />
<div class="MsoNormal" style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;">Please make sure at any time only one column Pin should remain Low.</span></div></span><br />
<br />
<div class="MsoNormal" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"><span style="font-family: Calibri; font-size: small;"><br />
</span></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-37672925996264940442010-08-25T13:10:00.000+05:302010-08-25T13:27:45.450+05:30Interfacing Switch to Microcontroller & Switch Debouncing<span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;">In 8051 </span></span><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">PORT 1, PORT 2 & PORT 3 have internal 10k Pull-up</span></em></span></span></span><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"> resistors whereas this Pull-up resistor is </span></span><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">absent in PORT 0</span></em></span></span></span><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;">. Hence PORT 1, 2 & 3 can be directly used to interface a switch whereas we have to use an external 10k pull-up resistor for PORT 0 to be used for switch interfacing or for any other input.<em>Figure 1</em> shows switch interfacing for PORT 1, 2 & 3. <em>Figure 2</em> shows switch interfacing to PORT 0.</span></span><br />
<br />
<div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><img alt="Image" src="http://www.dnatechindia.com/images/stories/Tutorial/8051/switch%20interfacing/switchinterface.JPG" /></span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><img alt="Image" src="http://www.dnatechindia.com/images/stories/Tutorial/8051/switch%20interfacing/switchinterface_P0.JPG" /></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"></span></span></span></div><span style="font-family: Calibri;"><em><span style="font-size: small;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">For any pin to be used as an INPUT PIN a HIGH (1) should be written to the pin if you don’t do this the pin will always be read as LOW.</span></span></span></em><span style="font-size: small;"><span style="font-family: Calibri;">In the above figure when the switch is not pressed the 10k resistor provides the current needed for LOGIC 1 closure of switch provides LOGIC 0 to the controller PIN.</span></span><span style="font-size: small;"><span style="font-family: Calibri;">Let's write a small program where whenever a switch is pressed a LED is turned ON. Consider that switch is connected to P2.0 & an LED connected to P2.1.</span></span><strong><span style="font-family: Calibri; font-size: small;"> </span></strong><br />
</span><br />
<span style="font-family: Calibri;"><h5 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt; text-align: justify;"><span style="font-size: small;"><span style="color: #243f60;"><span style="font-family: Cambria;">PROGRAM 1 </span></span></span></h5><br />
<div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">ORG 0000h</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.0</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">loop1:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JB P2.0,loop1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> clr P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">loop2:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JNB P2.0,loop2</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> AJMP loop1</span></span></div><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">First we initialize the Port Pins that we are using. Since we are using <strong>P2.0 as an Input</strong>Pin we write logic 1 to it (SETB P2.0). We are using <strong>PIN P2.1 for LED</strong>. Initially LED is turned OFF this is done by pulling the PIN HIGH (<em>check <u><span style="color: purple;">LED interfacing Section</span></u></em>). </span></span><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">Now we check if the Switch is pressed or not. So we wait till switch is pressed (loop1: JB P2.0,loop1) as soon as switch is pressed the LED is TURNED ON ( CLR P2.1 ) . Then we wait till the switch to be released (loop2: JNB P2.0, loop2 ) & then we TURN OFF the LED (SETB P2.1).</span></span><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">You must have noticed in the above program that the status of the input pin is same as that of Output Pin i.e. if the switch is not PRESSED (HIGH) the Output pin is also HIGH (LED OFF) & when the switch is PRESSED (LOW) the Output pin is also LOW (LED ON) using this logic we can write in another way.</span></span><strong><span style="font-family: Calibri; font-size: small;"> </span></strong><br />
<h5 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt; text-align: justify;"><span style="font-size: small;"><span style="color: #243f60;"><span style="font-family: Cambria;">PROGRAM 2 </span></span></span></h5><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">ORG 0000h</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.0</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">loop:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> MOV C,P2.0</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> MOV P2.1,C</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> AJMP loop</span></span></div></span><span style="font-family: Calibri;"><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">The Output of both the programs will be the same.</span></span><span style="font-size: small;"><span style="font-family: Calibri;">Now you know the basic concept of switch interfacing. There is a problem in practically interfacing these switches to the controller. In the above case you have considered the switches to be an </span><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">IDEAL SWITCH</span></em></span></span><span style="font-family: Calibri;">where when the switch is pressed the controller directly gets LOGIC 0. But practically when a switch is closed the contacts open & close rapidly for about 30ms. This is called as </span><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">SWITCH BOUNCING.</span></em></span></span><span style="font-family: Calibri;"> <em>Figure 3</em> shows its waveform.</span></span></span><br />
<div style="text-align: center;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"><span style="font-size: small;"><span style="font-family: Calibri;"><img alt="Image" src="http://www.dnatechindia.com/images/stories/Tutorial/8051/switch%20interfacing/switch_debounce.JPG" /></span></span></span></span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"><span style="font-size: small;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"><span style="font-size: small;"><span style="font-family: Calibri;">As you can see the switch release is clean without any bouncing. When a switch is pressed the contacts open & close for about 20ms. In the above programs the LED will flicker initially when the switch is pressed because of the </span><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">SWITCH BOUNCING </span></em></span></span><span style="font-family: Calibri;">but since the flickering will be very fast & will not be detected by human eye.</span></span><span style="font-size: small;"><span style="font-family: Calibri;">Even though 20ms is very short time in human terms for a microcontroller it is a very long time. Without</span><span class="SubtitleChar"><span style="font-size: 12pt;"><em><span style="color: #4f81bd; font-family: Cambria;">SWITCH DEBOUNCING</span></em></span></span><span style="font-family: Calibri;"> the controller will think that the switch was pressed many times.</span></span><span style="font-size: small;"><span style="font-family: Calibri;">Let us modify PROGRAM 1 & used <span class="MsoSubtleEmphasis"><em><span style="color: grey;">SWITCH DEBOUNCING </span></em></span>in it.</span></span><strong><span style="font-family: Calibri; font-size: small;"> </span></strong></span></span></span></span></span></span></div><span style="font-family: Calibri;"><span style="font-size: small;"><span style="font-family: Calibri;"></span></span></span><br />
<span style="font-family: Calibri;"><span style="font-size: small;"><span style="font-family: Calibri;"><h5 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt; text-align: justify;"><span style="font-size: small;"><span style="color: #243f60;"><span style="font-family: Cambria;">PROGRAM 3</span></span></span></h5><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">ORG 0000h</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.0</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">loop1:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JB P2.0,loop1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> mov R7,#255</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">deb1_loop1:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JB P2.0,loop1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> djnz R7,deb1_loop1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> CLR P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">loop2:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JNB P2.0,loop2</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> SETB P2.1</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> AJMP loop1</span></span></div><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">In this modified program the controller waits for LOGIC 0 ( loop1: JB P2.0,loop1 ) on input pin i.e. P2.0 then loads R7 with 255 now it checks if the input PIN still has LOGIC 0 ( JB P2.0,loop1 ) the controller checks this LOGIC 0 till the value in R7 becomes 0 which in this case is 255 times. If even once the controller detects LOGIC 1 then it exits the debouncing loop & goes back to the main loop ( loop1 ) indicating error in switch press.</span></span><span style="font-family: Calibri; font-size: small;"> </span><span style="font-size: small;"><span style="font-family: Calibri;">Basically the code:-</span></span><span style="font-family: Calibri; font-size: small;"> </span><br />
<div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> mov R7,#255</span></span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-family: Calibri; font-size: small;">deb1_loop1:</span></div><div class="MsoNoSpacing" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;"><span style="font-size: small;"><span style="font-family: Calibri;"> JB P2.0,loop1</span></span></div></span></span></span><span style="font-family: Calibri;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="font-size: small;"><span style="font-family: Calibri;"> djnz R7,deb1_loop1</span></span><span style="font-size: small;"><span style="font-family: Calibri;">is used for switch debouncing if you think the debounce period is less then use the <strong>LOOP WITHIN LOOP TECHNIQUE</strong> to check the input pins for more than 255 times. But personally I never had any problems with debouncing using the above code.</span></span><span style="font-family: Calibri; font-size: small;"> </span></span></span></span><br />
<div><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"><span style="font-size: small;"><span style="font-family: Calibri;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; font-size: 13px;"><span style="font-family: Calibri; font-size: small;"><br />
</span></span></span></span></span></span></span></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-52950291310434500192010-08-25T13:04:00.000+05:302010-08-25T13:04:27.549+05:30Interfacing LED to Microcontroller & LED blinking program<span class="Apple-style-span" style="font-family: Arial; font-size: small;"><span class="Apple-style-span" style="font-size: 13px;"><span class="Apple-style-span" style="font-family: 'myriad web', 'lucida sans', arial, helvetica, sans-serif; line-height: 20px;"><span style="font-size: small;"><span style="font-family: Calibri;"><em><span>Figure 1</span></em><span> shows how to interface the LED to microcontroller. As you can see the Anode is connected through a resistor to Vcc & the Cathode is connected to the Microcontroller pin. So when the Port Pin is </span><strong><span>HIGH the LED is OFF</span></strong><span> & when the Port Pin is </span><strong><span>LOW the LED is turned ON</span></strong><span>.</span></span></span><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkrbLQGgJRa579DHeJFdaJEAxO9C-JkjhMgxzG8vG3r61jfPxbBkM62vMo6lS70uho5d8ni6vqssSJkVv0xlJmT-ryXY-e0HcPBCNRn4hl3UjBauADsC-J6jAT6Hzsj1bCvoJ-RYe8Ie4/s1600/led_interfacing.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkrbLQGgJRa579DHeJFdaJEAxO9C-JkjhMgxzG8vG3r61jfPxbBkM62vMo6lS70uho5d8ni6vqssSJkVv0xlJmT-ryXY-e0HcPBCNRn4hl3UjBauADsC-J6jAT6Hzsj1bCvoJ-RYe8Ie4/s320/led_interfacing.JPG" /></a></div><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt; text-align: center;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"><br />
</span></span></span></span></h2><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span class="Apple-style-span" style="color: #4f81bd; font-family: Cambria; font-size: large;">Flashing LED ALGORITHM</span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Start.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Turn ON LED.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Turn OFF LED.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">GO TO 2.</span></span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">We now want to flash a LED. It works by turning ON a LED & then turning it OFF & then looping back to START. However the operating speed of microcontroller is very high so the flashing frequency will also be very fast to be detected by human eye.</span></span></span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Modified Flashing LED ALGORITHM</span></span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Start.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Turn ON LED.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Wait for some time (delay).</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Turn OFF LED.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Wait for some time (delay).</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Go To 2. </span></span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">You can see in the modified algorithm that after turning ON the LED the controller waits for the delay period & then turns OFF the led & again waits for the delay period & then goes back to the start. </span></span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">ORG 0000h.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">loop:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">CLR P2.0</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">CALL DELAY</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">SETB P2.0</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">CALL DELAY</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">JMP loop </span></span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;"><span>In the above program </span><strong><span>LED is connected to P2.0</span></strong><span>. The above program can also be written as follows:</span></span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">ORG 0000h.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">loop:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">CPL P2.0</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">CALL DELAY</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">JMP loop </span></span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">The only drawback of the second program is that the LED's ON time will be equal to LED's OFF time. Whereas in the first program if different delay routines are called the LED's ON time can be different than that of LED's OFF time.</span></span></span><br />
<h1 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 24pt;"><span><span style="font-size: large;"><span style="color: #365f91;"><span style="font-family: Cambria;">GENERATING DELAY</span></span></span></span></h1><h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;"> LOOP TECHNIQUE</span></span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Start.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Load a number in a RAM location. e.g. R0.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Decrement RAM Location.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Is RAM = 00? If NO GO TO 3.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">STOP.</span></span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">As you can see in the algorithm a number is loaded in a RAM location. It is then decremented & then if the content of the RAM location is not equal to zero a jump is made to the decrementing instruction.</span></span></span><br />
<span style="font-size: small;"><span style="font-family: Calibri;"><span>In 8051 a single instruction "</span><strong><span>DJNZ</span></strong><span>" is specifically designed for this kind of programs. It stands for </span><strong><span>Decrement & Jump if Not Zero</span></strong><span>. This instruction takes care or STEP 3 & STEP 4 of the above algorithm.</span></span></span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Program for LOOP TECHINQUE </span></span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">mov R7,#100</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">l1_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">djnz r7,l1_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">ret.</span></span></span></blockquote></blockquote><span style="font-size: small;"><span style="font-family: Calibri;"><span> In above program number 100 is loaded in R7 so the LOOP (djnz instruction) is executed 100 times. To increase the delay we will have to load a larger number. </span><strong><span>The largest delay can be achieved by loading R7 with 255 i.e. 0FFh.</span></strong></span></span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">LOOP WITHIN LOOP TECHNIQUE</span></span></span></span></h2><span><span style="font-size: small;"><span style="font-family: Calibri;">For longer delays we use this technique. In previous case only a single RAM location was used here the number of RAM locations depends on the number of LOOPS used. Here we discuss delays using two RAM locations.</span></span></span><br />
<blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Start.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Load R7.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Load R6.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Decrement R6.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Is R6=0 if NO go to 4.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Decrement R7</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Is R7=0 if NO go to 3.</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">8.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Stop.</span></span></span><span><span style="font-family: Calibri; font-size: small;"> </span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">The above algorithm contains two loops the <strong>INNER LOOP</strong> i.e. STEP 4 & 5. The <strong>OUTER LOOP</strong> consist of steps 3, 4, 5, 6 & 7.</span></span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"> </span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Program for LOOP WITHIN LOOP TECHINQUE <span> </span></span></span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Mov r7,#100</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">L2_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Mov r6,#200</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">L1_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Djnz r6,l1_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Djnz r7,l2_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">8.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">ret.</span></span></span></blockquote></blockquote><span><span style="font-size: small;"><span style="font-family: Calibri;">Here the inner loop (l1_delay: djnz r6,l1_delay) takes 200 iterations before R6 becomes 0. When this happens the loop is exited & then R7 is decremented & if R7 is not equal to 0 then R6 is again loaded with 200. & again the inner loop is executed. This continues till R7=0 i.e. the inner loop is executed 100 times before the before the controller can exit from this subroutine. </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">The delay generated can be controlled by changing the values that are loaded in R6 & R7.</span></span></span><span style="font-family: 'Times New Roman', serif; font-size: 12pt;"> </span><br />
<h2 style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 10pt;"><span><span style="font-size: medium;"><span style="color: #4f81bd;"><span style="font-family: Cambria;">Program for LOOP WITHIN LOOP TECHINQUE using three RAM locations.</span></span></span></span></h2><blockquote dir="ltr" style="margin-right: 0px;"><blockquote dir="ltr" style="margin-right: 0px;"><span><span><span style="font-family: Calibri; font-size: small;">1.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">2.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Mov r7,#50</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">3.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">L3_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">4.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Mov r6,#100</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">5.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">L2_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">6.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Mov r5,#200</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">7.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">L1_delay:</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">8.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Djnz r5,l1_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">9.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Djnz r6,l2_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">10.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">Djnz r7,l3_delay</span></span></span><br />
<span><span><span style="font-family: Calibri; font-size: small;">11.</span><span style="font: normal normal normal 7pt/normal 'Times New Roman';"> </span></span></span><span><span style="font-size: small;"><span style="font-family: Calibri;">ret.</span></span></span><br />
<div><span><span style="font-size: small;"><span style="font-family: Calibri;"><br />
</span></span></span></div></blockquote></blockquote></span></span></span>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-56052422406738911712010-08-22T20:34:00.000+05:302010-08-22T21:47:42.984+05:308051 Port functions<div align="center"><center><div style="text-align: left;"><span class="Apple-style-span" style="font-family: Tahoma; font-size: small;"><span class="Apple-style-span" style="font-size: 12px;"><b><br />
</b></span></span></div><br />
<table bgcolor="#003300" border="1" bordercolor="#00ffff" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-bottom: 1pt outset; border-collapse: collapse; border-left: 1pt outset; border-right: 1pt outset; border-top: 1pt outset; width: 853px;"><tbody>
<tr style="height: 13.4pt;"> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ccffcc; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 13.4pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 127px;"><div class="MsoNormal"><b><span style="font-family: Tahoma;"><span style="font-size: 9pt;">Ports </span></span></b></div></td> <td bordercolor="#00ffff" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ccffcc; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 13.4pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 696px;"><div class="MsoNormal"><b><span style="font-family: Tahoma;"><span style="font-size: 9pt;"> Function</span></span></b></div></td></tr>
<tr style="height: 27.5pt;"> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 27.5pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 127px;" valign="top"><div class="MsoNormal"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Port 0</span></span></b></div><div class="MsoNormal"><span style="font-family: Verdana;"><span style="font-size: 9pt;">(Pin 32-39)</span></span></div></td> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 27.5pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 696px;" valign="top"><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Dual-purpose port</span></span></b><span style="font-family: Verdana;"><span style="font-size: 9pt;">- 1. general purpose I/O Port. </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> 2. multiplexed address & data bus </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> Open drain outputs</span></span></div></td></tr>
<tr style="height: 34.85pt;"> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 34.85pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 127px;"><div class="MsoNormal"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Port 1</span></span></b></div><div class="MsoNormal" style="margin: 5pt 0in;"><span style="font-family: Verdana;"><span style="font-size: 9pt;">(Pin 1-8)</span></span></div><div class="MsoNormal"><br />
</div></td> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 34.85pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 696px;"><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px; word-spacing: -1px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> <b>Dedicated I/O port</b> – Used solely for interfacing to external devices </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px; word-spacing: -1px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> Internal pull-ups</span></span></div></td></tr>
<tr style="height: 49.1pt;"> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 49.1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 127px;"><div class="MsoNormal"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Port 2</span></span></b></div><div class="MsoNormal" style="margin: 5pt 0in;"><span style="font-family: Verdana;"><span style="font-size: 9pt;">(Pin 21-28)</span></span></div><div class="MsoNormal"><br />
</div></td> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 49.1pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 696px;"><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Dual-purpose port</span></span></b><span style="font-family: Verdana;"><span style="font-size: 9pt;">- 1. general purpose I/O port. </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> 2. a multiplexed address & data bus.</span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> Internal pull-ups</span></span></div></td></tr>
<tr style="height: 52.85pt;"> <td bordercolor="#c0c0c0" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 52.85pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 127px;"><div class="MsoNormal"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Port 3</span></span></b></div><div class="MsoNormal" style="margin: 5pt 0in;"><span style="font-family: Verdana;"><span style="font-size: 9pt;">(Pin 10-17)</span></span></div><div class="MsoNormal"><br />
</div></td> <td bordercolor="#00ffff" bordercolordark="#c0c0c0" bordercolorlight="#c0c0c0" style="background: #ffffff; border-bottom: 1pt inset; border-left: 1pt inset; border-right: 1pt inset; border-top: 1pt inset; height: 52.85pt; padding-bottom: 0.75pt; padding-left: 0.75pt; padding-right: 0.75pt; padding-top: 0.75pt; width: 696px;"><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><b><span style="font-family: Verdana;"><span style="font-size: 9pt;">Dual-purpose port</span></span></b><span style="font-family: Verdana;"><span style="font-size: 9pt;">- 1. general purpose I/O port. </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> 2. pins have alternate purpose related to special features of the 8051 </span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> Internal pull-ups</span></span></div><div class="MsoNormal"><br />
</div></td></tr>
</tbody></table></center></div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-60304844441733964512010-08-22T20:32:00.000+05:302010-08-22T20:32:45.915+05:308051 PIN OUT<div class="MsoNormal"><b><span style="font-family: Arial; font-size: 11pt;">8051 PIN OUT </span></b></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><b><span style="font-family: Wingdings; font-size: 9pt;">l</span><span style="font-family: Tahoma; font-size: 9pt;"> Power</span></b><span style="font-size: 9pt;"><span style="font-family: Verdana;"> - Vcc, Vss</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><b><span style="font-family: Wingdings; font-size: 9pt;">l </span></b><span style="font-size: 9pt;"><b><span style="font-family: Tahoma;">Reset </span></b><span style="font-family: Verdana;">- RST</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><b><span style="font-family: Wingdings; font-size: 9pt;">l </span></b><span style="font-size: 9pt;"><b><span style="font-family: Tahoma;">Crystal</span></b><span style="font-family: Verdana;"> - XTAL[1,2]</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><b><span style="font-family: Wingdings; font-size: 9pt;">l </span></b><span style="font-size: 9pt;"><span style="font-family: Tahoma; font-weight: 700;">External device interfacing</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> – EA, ALE, PSEN, WR, RD</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><b><span style="font-family: Wingdings; font-size: 9pt;">l</span></b><span style="font-size: 9pt;"><span style="font-family: Tahoma; font-weight: 700;"> I/O Port</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> – P0[7;0], P1[7:0], P2[7:0], P3</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-size: 9pt;"><span style="font-family: Verdana;"> </span><b><span style="font-family: Tahoma;">P3 is shared with control lines</span></b></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> – Serial I/O RxD, TxD,</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> – external interrupts INT0, INT1</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"> – Counter control T0, T1</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Tahoma; font-weight: 700;"><span style="font-size: 9pt;"> P0 and P2 are multiplexed with Address and Data bus</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWyMm-OdfHl14qlXBCixOMMYQaQ0fu8iByt_e3O0_sncrfbRO8YP7Lk-18pEmzr-IjTzlptLcpqkk_1gM4f-sfZt7BIpNb8eleMhn_gRZILYLYlbcwYAFTi3o7aG-cnt8_Xj1A33Iyqfw/s1600/pinout.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWyMm-OdfHl14qlXBCixOMMYQaQ0fu8iByt_e3O0_sncrfbRO8YP7Lk-18pEmzr-IjTzlptLcpqkk_1gM4f-sfZt7BIpNb8eleMhn_gRZILYLYlbcwYAFTi3o7aG-cnt8_Xj1A33Iyqfw/s320/pinout.gif" /></a></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><span style="font-family: Tahoma; font-weight: 700;"><span style="font-size: 9pt;"><br />
</span></span></div><div class="MsoNormal" style="margin-bottom: -3px; margin-top: -3px;"><br />
</div>Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-7642980772366292523.post-87598983009471037202010-08-22T20:29:00.000+05:302010-08-22T20:29:57.717+05:30Building reset circuits for 8051<div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;">RESET is an active High input When RESET is set to High, 8051 goes back to the power on state.</span></span></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;">The 8051 is reset by holding the RST high for at least two machine cycles and then returning it low.</span></span></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAgu6l_JWeB4ZDQY56WVjTm-nX1i7kxaW88NgXhTOfv9KCLIIRN6fhfj6ErOP0ru7rFU8unXC0Kngep8BGwd0Lo37IABG70wMjStc49bzvbAi6fJUEgiGwfUWQGYryrC9O0wS7e-QYHFo/s1600/reset.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="254" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAgu6l_JWeB4ZDQY56WVjTm-nX1i7kxaW88NgXhTOfv9KCLIIRN6fhfj6ErOP0ru7rFU8unXC0Kngep8BGwd0Lo37IABG70wMjStc49bzvbAi6fJUEgiGwfUWQGYryrC9O0wS7e-QYHFo/s320/reset.gif" width="320" /></a></div><div class="MsoNormal" style="margin-bottom: 0px; margin-top: 0px;"><span style="font-family: Verdana;"><span style="font-size: 9pt;"><br />
</span></span></div>Anonymousnoreply@blogger.com0