Hi all There are total 6 i/o lines available on controller, 5 switches and 5 LED's are to be interfaced by using this 6 I/O's.No other external IC are to be used,only resistors and similar parts can be used. any suggestion to achieve this will be appreciated. rgds Naresh
You cannot drive a LED directly by a 8051's pin.
"You cannot drive a LED directly by a 8051's pin." Oh yes you can - provided that you have carefully read the Data Sheet and verified that the ratings are sufficient. You will, of course, still need the normal current-limiting device (eg, series resistor) - see the LED Data Sheet. Note that many devices specify a maximum current for each pin and a maximum total for the whole chip - again, read the Data Sheet
5 switches and 5 LED's are to be interfaced by using this 6 I/O's.No other external IC are to be used,only resistors and similar parts can be used. any suggestion to achieve this will be appreciated. I believe this is homework since the solution is dead simple after you think a bit. So, your teacher is trying to "teach you to fish" (think) and you want us to "give you a fish". Erik PS only 5 I/Os are needed for a simple solution, six for an 'elegant'