EmbeddedMarket.com

Design. Manufacturing. Import. Export.
 
Connect & Contact -

Offers -

Buy Arduino - Freeduino-DU Board in Group / For Workshops @ Rs.666 Valid for minimum 25 quantity. Contact Sales.
Real Time Order Ticker -

Your Purchase Cart -

Store Currency:    Rs.   US$

Products: 0   Total : Rs.  0.00

Place Order | Login & Tracking

Date Posted: Tuesday, December 20, 2011

89V51RD2 - LED Toggle using a Switch


Article By Pratik Deshpande
Founder and Chief Mentor at DeccanRobots
© Copyright Article






89V51RD2 LED Source Code has explained the simple technique to ON or Off one LED or a bank of 8 LEDs. 

 

Let’s now understand as “How to read switch press input to toggle one LED from ON – Off – ON

 

These experiments are performed using 89V51RD2 Starter Kit.

 

Beginners and experts use this all in one board to learn the microcontrollers and test product prototypes.

 

Connections for this experiment:

1.                  Connect one wire connector between P1.0 and one LED

2.                  Connect one wire connector between P2.0 and one Switch

3.                  Connect P3.0, P3.1 and RST to ISP programming (RS232 section)

4.                  Connect 9VDC supply to the board

 

 

Experiment 1:

           

Start:

        JB P2.0,Start

        JB P1.0,MakeItON

        SETB P1.0

        SJMP WaitForDebounce

MakeItON:

        CLR P1.0

WaitForDebounce:

        JNB P2.0, WaitForDebounce

        SJMP Start

 

This programs checks if the switch is pressed or not. Once pressed it will check the status of LED and toggle it. Program waits for switch debounce (release of switch) and goes back to Start once switch is released.

Product Category Map
Low Cost Microcontroller Board Development Board AVR Microcontroller ARM7 Development Board Microcontroller Programmer
Arduino Kit PIC Microcontroller Breakout Modules SMD To DIP Adapter Spares
Communication Boards Modules Enclosures Antistatic Products Soldering Desoldering Equipments Industrial Embedded
Hobby Robotics 8051 Microcontroller Components
Approvals & Partners
ATMEL Certified Board Manufacturer Official ARM Partner Verified by PayPal Payment options for Indian customers

www.ATMEL.com

www.ARM.com

www.PayPal.com
Payment gateway logo online payment options
Also Accept NEFT, Cash & Cheque, SBI Bank Deposit
EmbeddedMarket.com has delivered products to various cities in India including , Agartala, Agra, Ahmedabad, Ahmedabad-380058, Ahmednagar, Aligarh, Allahabad, Alwar, Ambala, Ambernath, Amravati, Amritsar, Anantapur, Angamaly, Angul, Ankleshwar, Aruppukottai, Auranagabad, Aurangabad, Aurangabad. , Bagalkot, Balngalore, Banaglore, Bandel, Bangalore, Baroda, Barshi, Belgaum, Bellary, Bengaluru, Benguluru, Bhadravati, Bhandara, Bharatpur, Bharuch, Bhilai, Bhilai, distt - durg, Bhimavaram, Bhopal, Bhubaneswar, Bhubaneswer, Bhuj, Bolpur, Bombay, Bongaon, Borsad, Burdwan, Calicut, Carson city, Chanchal, Chandigarh, Chas, Chennai, Chidambaram, Chinchwad, Chittoor, Cochin, Coimbatore, Coimbatore ,, Coos bay, Coppet, Cuddalore district, Cuttack, Dabhoi, Dakpathar, Deharadun, Dehradun, Delhi, Dhanbad, Dharwad, Dhoraji, Dindigul, Dombivili, Dombivli, Durg, Durgapur, Ernakulam , Erode, Faizabad, Faridabad, Faridkot, Gandhinagar, Gandhinagar - , Gangtok, Gazibad, Ghaziabad, Goa, Gorakhpur, Greater noida, Guntur, Gurgaon, Guwahati, Gwalior, Haridwar, Haripura, Hassan, Ho chi minh, Hodal, Hubli, Hukkeri, Hydarabad, Hyderabad, Ichalkaranji, India, Indore, Jabalpur, Jaipur, Jalandhar, Jalgaon, Jammu, Jamnagar, Jaysingpur, Jhunjhunu, Jodhpur, Junagadh, Kadampanad, Kahangad, Kakinada, Kalambaste, Kalpakkam, Kalyan, Kancheepuram, Kannur, Kanpur, Karad, Karnal, Khammam, Kharagpur, Kochi, Kochi,, Kolahpur, Kolhapur, Kolkata, Kollam, Komarapalayam, Kopargaon, Kotkapura, Kottayam, Kozhikode, Kumarganj, dakshin dinajpur, Kurukshetra, Lalitpur, Latur, Lausanne, Lucknow, Ludhiana, Machilipatnam, Madhyamgram, Madurai, Madurai-2, Malviya nagar, Mandi, Mangalore, Manipal, Margao, Margaon, Mathura, Meerut, Mehsana, Mhow, Mhow, district - indore, Miraroad, thane, Modinagar (ghaziabad), Mohali, Morjim, Moti nagar, Mumbai, Murud, Mysore, Nagpur, Nalgonda, Nalla sopara, Nandyal, kurnool-district, Nashik, Navi mumbai, Navi-mumbai, Nazira, Nellore dt, New delhi, New mumbai, Neyveli-3, Noida, Ongole, Osmanabad, Pachmarhi, Palakkad, Panaji, Panchkula, Panjim, Pantnagar, Panvel, Patan, Patan(north gujarat), Patiala, Patna, Pilani, Pimple nilakha, pune, Ponda, Pondicherry, Powai, Pune, Pune / maharashtra, Pune 37, Raipur, Rajahmundry, Rajapalayam, Rajkot, Ramgarh cantt., Ramnthapuram, Ranchi, Ratnagiri, Ribandar, Rohtak, Roorkee, Rourkela, Salem, Sangli, Sangola, Satara, Sector 82, noida, Secunderabad, Secunderbad, Shahdara, Shevgaon, Siliguri, Silvassa, Singapore, Sivasagar, Solan, Solapur, Sonepat, Surat, Suratkal, Surendranagar, Talod, Tamluk, Tanuku, Thane, Thane (w), Thane [ west ] 400607, Thane west, Thanjavur, Thiruvalla, Thiruvallore, Thiruvananthapuram, Thiruvannamalai district, Thookkupalam , Thrissur, Tiruchirappalli, Tirupati, Tirupur, Trichur, Trichy, Trivandrum, Udaipur, Udupi, Ujjain, Ulhasnagar, Up, Vadodara, Vallabh vidyanagar, Valsad, Vasai road, Vasai road (west), Vasco-da-gama, Vellore, Vidisha, Vijapur, Vijayawada, Virudhunagar, Visakhapatnam, Vithalwadi(w), Warangal, Yamunanagar, Zuari nagar, Zuarinagar

WARNING - Do not visit OFFICE address without online order. Read this notification for details