artistsiop.blogg.se

Buzzer interfacing with 8051 with c
Buzzer interfacing with 8051 with c





buzzer interfacing with 8051 with c

So when we need any input we have to initialize a particular port or pin of 8051 microcontroller as input. When 8051 microcontroller initially boots or powered up its ports are default initialized as output. In below configuration external source will supply current to led. Hence the below led microcontroller configuration is recommended to utilize in circuits involving led and microcontroller.

buzzer interfacing with 8051 with c

Their is a very big chance of microcontroller to reset due to power shortage. In that configuration microcontroller will supply current to glow led. You can also change the polarity of the circuit by connecting led anode to microcontroller and cathode to external ground. Microcontroller pin becomes high and current will find no way to flow and led switches off. When microcontroller pin is made high(in code).Microcontroller pin becomes ground and current start flowing from 5 volt source to ground making led to switch on. When microcontroller pin is made low(from code).In the below picture led cathode is connected to microcontroller directly and anode is connected to +5 volts source in series with a resistor. One end(cathode or anode) of led is connected to microcontroller pin and the other with power rail.







Buzzer interfacing with 8051 with c