AT89S52 Mini Development Board – LED Interfacing
AT89S52 Mini Development Board has 3 SMD LEDs connected to port pins P1.3, P1.4 & P1.5 via jumpers J6, J4 & J3 respectively. If any jumper is left open, then the corresponding port pin can be used independently. The sample code given below toggles the LEDs in fixed intervals. Jumpers (J6/J4/J3) have to be shorted for using the desired LED.Schematic
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
/***************************************************************** HEADER FILES ******************************************************************/ #include <REGX52.H> #define LED1 P1_5 #define LED2 P1_4 #define LED3 P1_3 /***************************************************************** FUNCTION DECLARATION ******************************************************************/ void Delay_ms(unsigned long int Delay); /***************************************************************** MAIN FUNCTION ******************************************************************/ void main() { while(1) { LED1=0;LED2=0;LED3=0; /* Make port pins low to turn on LEDs */ Delay_ms(500); /* Delay to keep LEDs ON for sometime */ LED1=1;LED2=1;LED3=1; /* Make port pins high to turn off LEDs*/ Delay_ms(500); /* Delay to keep LEDs OFF for sometime */ } } /***************************************************************** * Function : Delay_ms * * * * Description : Function for delay * * * * Parameter : ms - delay in milliseconds * ******************************************************************/ void Delay_ms(unsigned long int Delay) { Delay = Delay*15; while(--Delay!=0); } /*********************** END OF PROGRAM ************************/ |
Topics related to AT89S52 Mini Development Board
- AT89S52 Mini Development Board – Overview
- AT89S52 Mini Development Board – LED Interfacing
- AT89S52 Mini Development Board – LCD Interfacing
- AT89S52 Mini Development Board – Serial communication
- AT89S52 Mini Development Board – EEPROM Interfacing
- AT89S52 Mini Development Board – Buzzer Interfacing
- AT89S52 Mini Development Board – Servo Motor Interfacing
- AT89S52 Mini Development Board – Switch Interfacing
- AT89S52 Mini Development Board – RFID Interfacing
Resources
How to buy?
- Click here to buy the rhydoLABZ AT89S52 Mni Development Board (Mini) V1.01
- Click here to buy the rhydoLABZ AT89S52 Development Board
- Click here to buy the rhydoLABZ AT89S52-24PU Microcontroller
- Click here to buy the rhydoLABZ ATMEL 89SXX ISP Programmer (RS232)
SupportPlease share your ideas with us, visit our forum for discussion
Leave a Reply
You must be logged in to post a comment.