C51 COMPILER V9.54   MAIN                                                                  04/27/2022 11:01:41 PAGE 1   


C51 COMPILER V9.54, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN .\Objects\main.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE source\main.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Listin
                    -gs\main.lst) TABS(2) OBJECT(.\Objects\main.obj)

line level    source

   1          /******************** (C) COPYRIGHT 2021 SONiX *******************************
   2          * COMPANY:  SONiX
   3          * DATE:   2022/04/27
   4          * IC:     SN8F5835
   5          *____________________________________________________________________________
   6          * REVISION    Date        Author    Description
   7          * 1.0         2021/04/27  Eden      1. First release
   8          *____________________________________________________________________________
   9          *****************************************************************************/
  10          
  11          /*_____ I N C L U D E S _________________________________*/
  12          #define __XRAM_SFR_H__
  13          #include <SN8F5835.h>
  14          #include "int.h"
  15          
  16          /*_____ F U N C T I O N S _______________________________*/
  17          void GPIO_Initialization(void);
  18          
  19          /*_____ D E F I N I T I O N S ___________________________*/
  20          
  21          /*_____ D E C L A R A T I O N S _________________________*/
  22          uint8_t bGPIO_ReadDataBuf;
  23          
  24          /*_____ M A C R O S _____________________________________*/
  25          #define IO_PORT0_OUTPUT_LOW   P0M |= 0xFF;  P0 &= 0x00;
  26          #define IO_PORT1_OUTPUT_LOW   P1M |= 0xFF;  P1 &= 0x00;
  27          #define IO_PORT3_OUTPUT_LOW   P3M |= 0xFF;  P3 &= 0x00;
  28          #define IO_PORT4_OUTPUT_LOW   P4M |= 0xFF;  P4 &= 0x00;
  29          
  30          #define OB_IO_OUTPUT_LOW      P00=0;  P0M |=0x01; 
  31          #define OB_IO_OUTPUT_HIGH     P00=1;  P0M |=0x01;
  32          
  33          #define INT0_PIN_INPUT        P0M &= ~(0x01<<4);
  34          
  35          
  36          /**
  37           *  @Brief    main: INT Test Demo Function
  38           *  @param    None
  39           *  @retval   None
  40           */
  41          
  42          void main(void)
  43          {
  44   1        /*  Initialize GPIO status  */
  45   1        GPIO_Initialization();
  46   1        
  47   1        /*  Initializes and configures the INT0 function
  48   1            (1) Set INT0 IO to input mode for capture external signal
  49   1            (2) Set INT0 trigger edge to falling edge 
  50   1            (3) Clear INT0 ISR flag */
  51   1        INT0_PIN_INPUT                              /*  (1) */
  52   1        PEDGE = mskPEDGE_INT0_FALLINGEDGE;          /*  (2) */
  53   1        TCON &= ~mskTCON_INT0_FLAG;                 /*  (3) */
  54   1        
C51 COMPILER V9.54   MAIN                                                                  04/27/2022 11:01:41 PAGE 2   

  55   1        /*  Enable INT0 interrupt and global interrupt  */
  56   1        IEN0 |= mskIEN0_INT0_INT_ENABLE;
  57   1        EAL = 1;
  58   1        
  59   1        while(1)
  60   1        {
  61   2          /*  wait for external interrupt  */
  62   2        }
  63   1      
  64   1      }
  65          
  66          
  67          /**
  68           *  @Brief    Initialize GPIO status
  69           *  @param    None
  70           *  @retval   None
  71           */
  72          void GPIO_Initialization(void)
  73          {
  74   1        /*  Set whole IOs to output low */
  75   1        IO_PORT0_OUTPUT_LOW
  76   1        IO_PORT1_OUTPUT_LOW
  77   1        IO_PORT3_OUTPUT_LOW
  78   1        IO_PORT4_OUTPUT_LOW
  79   1      }
  80          
  81          
  82          /**
  83           *  @Brief    ISR_Int0
  84           *            External interrupt INT0 interrupt service routine
  85           */
  86          void ISR_Int0(void) interrupt ISRInt0
  87          {   
  88   1        /*  Observe the IO toggle to represent INT0 interrupt was execute */
  89   1        OB_IO_OUTPUT_HIGH
  90   1        OB_IO_OUTPUT_LOW
  91   1      }


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


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