Hey embedded lovers from today I started to post series of 8051 tutorials and first post is use port as output using led interfacing with keil, BASCOM,Proteus.
This post is introduces you the very basic phenomena of taking an output from the microcontroller 8051,
Hearer we are use P89V51RD2 which is made by Philips using 8051 core which belongs to the family of 8051 series of microcontrollers, is very commonly used by a large community of hobbyist and engineers. Its simplicity and ease of programming with inbuilt features easily makes its position in the top preferred list of microcontroller for both beginners and advanced user.
LEDs are by far the most widely used means of taking output. They find huge Application as indicators during experimentations to check the validity of results at different stages. They are very cheap and easily available in a variety of shape, size and colours.
The principle of operation of LEDs is simple. The commonly available LEDs have a drop voltage of 1.7 V and need 10 mA to glow at full intensity.
The value of resistance R can be calculated using the equation
Since most of the controllers work on 5V,
470 ohm is commonly used substitute in case 330 ohm, because 330 ohm is not available.
P89V51RD2 is a 40 pin microcontroller which belongs to 8051 series of microcontroller. It has four ports each of 8 bits P0, P1, P2 and P3.The P89V51RD2 has 64K+8K FLASH bytes of programmable flash. The port P0 covers the pin 39 to pin 32, the port P1 covers the pin 1 to pin 8, the port P2 covers the pin 21 to pin 28 and the port P3 covers the pin 10 to pin 17. Pin 9 is the reset pin. The reset is active high. Whenever the controller is given supply, the reset pin must be given a high signal to reset the controller and bring the program counter to the starting address 0x0000. The controller can be reset by manually connecting a switch or by connecting a combination of resistor and capacitor as shown in the circuit diagram. A 11.0592 MHz crystal is connected between pin 18 pin 19. Pin 40 is Vcc and pin 20 is ground. Pin 40 is connected to Vcc.
LEDs are connected to the port P0. LEDs need approximately 10mA current to flow through them in order to glow at maximum intensity. However the output of the controller is not sufficient enough to drive the LEDs, so if the positive leg of the LED is connected to the pin and the negative to ground as shown in the figure, the LED will not glow at full illumination.
To overcome this problem LEDs are connected in the reverse order and they run on negative logic i.e., whenever 1 is given on any pin of the port, the LED will switch off and when logic 0 is provided the LED will glow at full intensity.
As soon as we provide supply to the controller, the LEDs start blinking i.e., they become on for a certain time duration and then become off for the same time duration. This delay is provided by calling the delay function.
ü Circuit diagram:
ü Code with Keil:
/* |
* Description : Source file to use chack pin as output. |
* File Name : main.c |
* header files Name : Philips/REG51F.H , delay.h |
* compiler : keil uVision4 |
* Author : Biren Ramoliya ( "http://littlebitjohnny.blogspot.com" ),( "Computer Zone" ) |
* Last Update : 11.09.2012, 08:00 AM |
*/ |
/* system file include */ |
#include <Philips/REG51F.H> |
#include "delay.h" |
/* define pin and port */ |
#define led P0 //port P0 as output |
/* main */ |
void main() |
{ |
led = 0x00; //led off |
while(1) |
{ |
led = ~led; //toggle led |
sdelay(1); //wait 1s |
} |
} |
ü Code with BASCOM:
'------------------------------------------------------------------------------- |
'* Description : Source file to use chack pin as output. |
'* File Name : main.bas |
'* compiler : BASCOM 8051 |
'* Author : Biren Ramoliya ( "http://littlebitjohnny.blogspot.com" ),( "Computer Zone" ) |
'* Last Update : 11.09.2012, 08:00 AM |
'------------------------------------------------------------------------------- |
'==================== syastem configrasen ====================================== |
'To use crystalfrequency 11.0592mhz = 11059200hz |
$crystal = 11059200 |
'==================== define Pin and Port ====================================== |
Led1 Alias P0 |
'==================== main fxn ================================================= |
Do |
Led1 = 255 'all led off |
Wait 1 'delay of 1 second |
Led1 = 0 'all led on |
Wait 1 'delay of 1 second |
Loop 'contenuas loop |
End |
'==================== end main fxn ============================================= |
ü Video
You can download all code and simulate from hear.
Smart Buds
ReplyDeleteBuy Smart Buds Online
Smart Bud Price
Smart Bud Organic
smartbud los angeles
smart bud price
smartbud ca
Smart Carts
ReplyDeleteBuy Smart Carts Online
Smart Carts Review
Smart Carts Flavor
Smart Carts Cartridge
smart carts cartridges review
smart carts flavors
Buy Adderall Online
ReplyDeleteAdderall 20 mg
Adderall pills
Side Effects of Adderall
How to get prescribed adderall
********************************************************************
Buy hydrocodone online
Hydrocodone 10 325
Hydrocodone acetaminophen 5 325
SIDE EFFECTS OF HYDROCODONE
Hydrocodone withdrawal
Buy methadone Online
ReplyDeleteMethadone Clinic Near Me
Methadone side effects
Methadone
Methadone pills
Methadone Treatment
Buy Oxycontin Online
ReplyDeleteOxycontin pills
Oxycontin effects
Oxycontin 60 mg
Oxycontin 80 mg
Oxycontin 15 mg
Oxycontin effects
Oxycontin high
Oxycontin ir
Oxycontin pills
Buy Percocet Online
ReplyDeletePercocet Side Effect
Acetaminophen Dosage
Percocet pill
Percocet 10
Percocet 30 mg
is percocet an opioid
Percocet 15 mg
Molly percocet
Percocet dosage
Percocet generic
Buy Roxicodone Online
ReplyDeleteRoxicodone
Roxicodone vs oxycodone
Roxicodone 30mg
Roxicodone 10mg
Roxicodone 15mg
**************************************************************************
Buy Tramadol Online
Tramadol
Tramadol pills
What is tramadol
is tramadol an opioid
Order tramadol online
Tramadol 50mg high
Tramadol 100mg
Tramadol hcl 50mg
Buy Valium Online
ReplyDeleteValium
Valium dosage
Buy valium online
Diazepam 5mg
Diazepam 10mg
**********************************************************
Valium high
Valium vs xanax
Valium generic
Valium pill
Valium side effects
What is valium
Diazepam side effects
dankwoods
ReplyDeletedankwoods price
where can i buy dankwoods
dankwoods for sale
dankwoods dank vapes
dankwoods vape
how much do dankwoods cost
dankwoods carts
dankwoods weed
buy dankwoods online
Dank Vapes
Official Dankwoods website
dankwoods how to
how can i get dankwoods
dankwoods in prescott az
dankwoods career
dankwoods flavors
how.much are dankwoods az
is dankwoods like smoking a cigar
idankwoods bluntswhite fire dispensary prices
pre rolled dankwoods blunt
dankwoods vapes
dankwoods store near me
where are dankwoods sold
Dank Vape
ReplyDeleteDank Vape Cartridges
Dank Vape Carts
Dank Vape Flavors
Vape Dank
Dank Vape Cartridge
Dank Vape Pens
Dank Vape Pen
Dank Vape Cartridges Review
mario carts
EXOTIC CARTS
exotic carts
STIIIZY CARTS
stiiizy carts
710KINGPEN
710kingpen
DANK VAPES:
Buy Dank Vapes Full Gram Cartridges Online
Marijuana Vape Pens
Dankvapes
Mars og
Dank cartridges
Dank vapes cartridges
Strawberry shortcake strain
Dank vapes official account
Dank vapes carts
Apple Jacks strain
Dank vapes fruity pebbles
diablo og dank vape
gelato dank vape
la confidential dank vape
dank tank vape
ginger dank vape
dank vape boxes
fruity pebbles dank vape
dank vape wedding cake
pineapple express dank vape
grape ape dank vape
white rhino dank vape
Buy Adderall Online
ReplyDeleteAdderall 20 mg
Adderall pills
Side Effects of Adderall
How to get prescribed adderall
********************************************************************
Buy hydrocodone online
Hydrocodone 10 325
Hydrocodone acetaminophen 5 325
SIDE EFFECTS OF HYDROCODONE
Hydrocodone withdrawal
***********************************************************************
Buy methadone Online
Methadone Clinic Near Me
Methadone side effects
Methadone
Methadone pills
Methadone Treatment
*****************************************************
Buy Oxycontin Online
Oxycontin pills
Oxycontin effects
Oxycontin 60 mg
Oxycontin 80 mg
Oxycontin 15 mg
Oxycontin effects
Oxycontin high
Oxycontin ir
Oxycontin pills
Buy Percocet Online
ReplyDeletePercocet Side Effect
Acetaminophen Dosage
Percocet pill
Percocet 10
Percocet 30 mg
is percocet an opioid
Percocet 15 mg
Molly percocet
Percocet dosage
Percocet generic
************************************************
Buy Roxicodone Online
Roxicodone
Roxicodone vs oxycodone
Roxicodone 30mg
Roxicodone 10mg
Roxicodone 15mg
**************************************************************************
Buy Tramadol Online
Tramadol
Tramadol pills
What is tramadol
is tramadol an opioid
Order tramadol online
Tramadol 50mg high
Tramadol 100mg
Tramadol hcl 50mg
*********************************************************************
Buy Valium Online
Valium
Valium dosage
Buy valium online
Diazepam 5mg
Diazepam 10mg
ReplyDeleteValium high
Valium vs xanax
Valium generic
Valium pill
Valium side effects
What is valium
Diazepam side effects
***************************************************
Buy Xanax Online
Green xanax bars
Blue xanax
Yellow xanax
Xanax pill
Xanax bars
Xanax
Xanax side effects
Xanax effects
Xanax generic
Xanax withdrawal
************************************************************
dankwoods
dankwoods price
where can i buy dankwoods
dankwoods for sale
dankwoods dank vapes
dankwoods vape
how much do dankwoods cost
dankwoods carts
dankwoods weed
buy dankwoods online
Dank Vapes
Official Dankwoods website
dankwoods how to
how can i get dankwoods
dankwoods in prescott az
dankwoods career
dankwoods flavors
how.much are dankwoods az
is dankwoods like smoking a cigar
idankwoods bluntswhite fire dispensary prices
pre rolled dankwoods blunt
dankwoods vapes
dankwoods store near me
where are dankwoods sold
best buy ssdbest buy ssd drivebest buy ssd drivessd drive best buyssd drive best buybuy ssdbuy ssdbest buy 1tb ssdbest buy 1tb ssdexternal ssd best buyexternal ssd best buy500gb ssd best buy500gb ssd best buyssd chemical solution for salessd chemical solution for salebest buy internal ssdbest buy internal ssdbuy ssd drivebuy ssd drivebest buy ssdbest buy ssd drivessd chemical solution for salebuy ssd500gb ssd best buy
ReplyDeletebuy girl scout cookies online
ReplyDeletegelato strain
kali mist strain review
kali mist strain info
kali mist strain genetics
blue skittles weed pics
skittles weed review
skittles weed seeds
watermelon skittles weed strain
moonrock kush leafly
moon rocks kush caviar
purple moonrock kush
blue moon rock kush
moon rock strain marijuana
moon rock strain description
moon rock strain for sale
moon rock strain review
moonrock strain
moon rocks strain thc %
skittles weed strain thc levels
skittles weed cartridge
ReplyDeletedank vapes irish cream
dank vapes knock off
dank vapes ca 079
dank vapes thc content
who is dank vapes
dank vapes chemdawg
dank vapes fruity pebbles fake
dispensary with dank vapes
dank vapes battery
dank vapes owner
hello can anyone share with me some ideas about dog breeding as i am so new to this and i just lost my grand ma who wants me to continue with the breeding of her dogs. please you comments and ideas will go a long way to help us, i will be dropping my websites link below so you can drop your ideas. thanks i really do need them
ReplyDeleteenglish bulldog puppies for sale
english bulldog puppy for sale
english bulldog puppies
english bulldog puppy near me
english bulldog puppies in CA
english bulldog puppy for sale near me
english bulldog puppy for sale
english bulldog puppies for sale
english bulldog puppy
english bulldog puppies
buy english bulldog puppies
english bulldog puppy for sale near me
cute english bulldog puppy
english bulldog puppies
english bulldog puppy
english bulldog puppies
hello can anyone share with me some ideas about dog breeding as i am so new to this and i just lost my grand ma who wants me to continue with the breeding of her dogs. please you comments and ideas will go a long way to help us, i will be dropping my websites link below so you can drop your ideas. thanks i really do need them
ReplyDeleteenglish bulldog puppies for sale
english bulldog puppy for sale
english bulldog puppies
english bulldog puppy near me
english bulldog puppies in CA
english bulldog puppy for sale near me
english bulldog puppy for sale
english bulldog puppies for sale
english bulldog puppy
english bulldog puppies
buy english bulldog puppies
english bulldog puppy for sale near me
cute english bulldog puppy
english bulldog puppies
english bulldog puppy
english bulldog puppies
ReplyDeletechihuahuas
chihuahua puppies for sale
Welcome to Abdullah Thani Services, Abdullah Thani Technical Services L.L.C comes under the list of interior fit-out companies in Dubai. Our well-experienced team of professionals has the skills to give you the best Fit-out services. Our team’s main goal is to meet your instructions and deliver what is expected.
ReplyDeleteWelcome to Plenty Things, Plenty Thingz is an E-Commerce store. It provides you the best thing for your child to encourage your child to play inside like pool dome and many more. It also provides you this cool and fun scooter for your child. It's an excellent toy to encourage your kids to play outside. If you want to explore barbecue pavilion then go and check out their website.
ReplyDeleteWelcome to nevada mortgage company, Vision Home Mortgage goal is to provide home loans to our clients while providing them with the lowest interest rates and closing costs possible. We offer our clients the traditional fixed which includes monthly principal and interest payments which never change during the loan’s lifetime.
ReplyDeletePlenty Thingz is een e-commerce website, hier kun je elk product vinden. Spin, wiebel en race; het kan allemaal met onze kinderauto! Deze wiebelende auto houdt je kind actief en ontwikkelt zijn evenwichts- en coördinatievaardigheden tijdens het spelen. Hier vindt u magnetronkasten.
ReplyDeleteYour blog helps me a lot in my work and provides a lot of interesting information about society. Thank you.
ReplyDeletemac tonight 2nd anniversary edition apk for android download
the glitched attraction download
CIS provides the best-performing ERP Software Pakistan
ReplyDeleteto improve your business proficiency with advanced reporting tools. We are the most dependable ERP solution providers in Pakistan with a vast clientele of satisfaction customers.
Great article! We will be linking to this great article on our website. Keep up the good writing
ReplyDeleteبهترین جراح بینی
عمل بینی
جراحی بینی
بینی گوشتی
بینی استخوانی
بینی