Help in 8051 simple project ..

Thread Starter


Joined Sep 6, 2010
I want to make a simple program of adding two numbers through microprocessor and have to show its output.

I want to use a dipswitch at input and LEDs for output. I am done with processor programming and want help in hardware circuitry.

How do we connect dipswitch and LEDs ? do we ground them through resistor or give VCC through resistor ??


Joined Feb 4, 2008
Generally, you can do both as far as the outputs of the device are not of the open collector type. Which method is better depends on the circuit and the current source/sink capability of the device driving the LEDs.


Joined Jun 7, 2009
you would sink your port to ground with switches/resistors, and you'd sink your LED current through your port, but only if it had the drive capability.