C51 COMPILER V7.09   MAIN                                                                  06/14/2006 10:50:18 PAGE 1   


C51 COMPILER V7.09, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c ROM(SMALL) BROWSE DEBUG OBJECTEXTEND

line level    source

   1          /*
   2          **********************************************************************************************************
             -*********
   3          *                                                                                               BLINK LED DEMO
   4          * Description:  The first demo program for AT89S52-gLCD-STK1 board to blink an LED at ~10Hz by software de
             -lay
   5          * File:                 cd:\src\chp2\src2_1\main.c
   6          * Software:             Keil C (C51) compiler, Eval version 7.09 under uVision2 IDE v2.40
   7          * Programmer:   John Leung, TechToys Co. (www.TechToys.com.hk)
   8          * Hardware:             AT89S52-gLCD-STK1, with Atmel 89S52, 11.0592 MHz crystal
   9          * Date:                 24th May 2006
  10          * Version:              1.0
  11          * Programmer:   John Leung
  12          *
  13          *                                                                                               All Rights Reserved
  14          *
  15          **********************************************************************************************************
             -*********
  16          */
  17          #include <reg52.h>
  18          
  19          #define ON      0
  20          #define OFF     1
  21          
  22          //Pin definition
  23          sbit LED = P2^0;
  24          
  25          // Function prototype
  26          void DelayMs(unsigned int msec);
  27          
  28          
  29          
  30          /*
  31          **********************************************************************************************************
             -*********
  32          *                                                                                       MILLI-SECOND SOFTWARE DELAY ROUTINE
  33          * Function:     This function makes software delay in milli-sec, adjusted for a crystal freq. 11.0592MHz for A
             -T89S52
  34          * Argument:     'msec'          amount of delay in milli-sec
  35          * Return:       none
  36          *
  37          * Note:         
  38          **********************************************************************************************************
             -*********
  39          */
  40          void DelayMs(unsigned int msec)
  41          {
  42   1              unsigned int x,y;
  43   1      
  44   1              for(x=0; x<=msec;x++)
  45   1                      {
  46   2                              for(y=0;y<=110;y++);
  47   2                      }
  48   1      }
  49          
C51 COMPILER V7.09   MAIN                                                                  06/14/2006 10:50:18 PAGE 2   

  50          // Main 
  51          // Simple demo program just to blink an LED at a rate of ~10Hz
  52          void main(void)
  53          {
  54   1              for(;;)
  55   1                      {
  56   2                              LED = ON;
  57   2                              DelayMs(50);
  58   2                              LED = OFF;
  59   2                              DelayMs(50);
  60   2                      }
  61   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     46    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
