8051 = Turn on LED using current sinking method

 Turn on LED using current sinking method

 I have used Keil version 5 software IDE and Proteus as a simulator.

LED is connected to port 1.0 in the current-sinking method and has used an NXP chip (P89V51RD2).

A resistor of 200ohm is used to limit the current through the LED because excess current might burn the LED.

During the Current-sinking method, the Cathode ( - ) is connected to the port of µC so that it gets GND through µC and Anode ( + ) is connected to VCC.

So to ON the LED in the Current-sinking method we need to give 0 command to complete the circuit.


Code is in c language



#include<reg51.h>

sbit led = P1^0;

void main()

{

led = 0; // its current sinking so 0 means on

}



In proteus set 8051 frequency as 11.0592 MHz









Comments