BLINKING - 8051

  • MICROCONTROLLER - AT89S52 
  • COMPILER - MIKROC
  • SIMULATION - PROTEUS 8.1
  • CRYSTAL - 4MHz
CIRCUIT


PROGRAM
/*
MICROCONTROLLER -AT89S51/52
COMPILER ---MIKROC
BY---EMERGING TECHNOLOGIES --WWW.EMERGINGTECHS.ORG
*/
void main() {

  while(1)
  {
 P0 = 0x00;        // Turn ON diodes on PORT0
    P1 = 0x00;        // Turn ON diodes on PORT1
    P2 = 0x00;        // Turn ON diodes on PORT2
    P3 = 0x00;        // Turn ON diodes on PORT3
    Delay_ms(500);   // 1 second delay

    P0 = 0xFF;        // Turn OFF diodes on PORT0
    P1 = 0xFF;        // Turn OFF diodes on PORT1
    P2 = 0xFF;        // Turn OFF diodes on PORT2
    P3 = 0xFF;        // Turn OFF diodes on PORT3
    Delay_ms(500);   // 1 second delay


  }        // Endless loop
}