C51 COMPILER V9.54   MAIN                                                                  04/26/2022 17:09:08 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          
   2          /******************** (C) COPYRIGHT 2021 SONiX *******************************
   3          * COMPANY:  SONiX
   4          * DATE:   2022/04/22
   5          * IC:     SN8F5835
   6          *____________________________________________________________________________
   7          * REVISION    Date        Author    Description
   8          * 1.0         2021/04/22   Eden   1. First release
   9          *____________________________________________________________________________
  10          *****************************************************************************/
  11          
  12          
  13          
  14          
  15          
  16          /*_____ I N C L U D E S _________________________________*/
  17          #define __XRAM_SFR_H__
  18          #include <SN8F5835.h>
  19          #include "timer.h"
  20          /*_____ F U N C T I O N S _______________________________*/
  21          void TIMER0_Initialization(void);
  22          void GPIO_Initialization(void);
  23          
  24          /*_____ D E F I N I T I O N S ___________________________*/
  25          
  26          
  27          /*_____ D E C L A R A T I O N S _________________________*/
  28          
  29          
  30          
  31          /*_____ M A C R O S _____________________________________*/
  32          #define    IO_PORT0_OUTPUT_LOW        P0M |= 0xFF;    P0 &= 0x00;
  33          #define    IO_PORT1_OUTPUT_LOW        P1M |= 0xFF;    P1 &= 0x00;
  34          #define    IO_PORT3_OUTPUT_LOW        P3M |= 0xFF;    P3 &= 0x00;
  35          #define    IO_PORT4_OUTPUT_LOW        P4M |= 0xFF;    P4 &= 0x00;
  36          
  37          /**
  38           *  @Brief    main: Timer0 Demo Function
  39           *  @param    None
  40           *  @return   None
  41           */
  42          
  43          void main(void)
  44          {
  45   1        /*
  46   1         *  System initial:
  47   1         *  (1) GPIO
  48   1         *  (2) Timer0
  49   1         *  
  50   1         */
  51   1          GPIO_Initialization();                        /*  (1) */
  52   1          TIMER0_Initialization();                      /*  (2) */
  53   1          while(1)
  54   1          {
C51 COMPILER V9.54   MAIN                                                                  04/26/2022 17:09:08 PAGE 2   

  55   2            WDTR = 0x5A;                                /*  Clear Watchdog Timer  */
  56   2          }
  57   1      }
  58          
  59          /**
  60           *  @Brief    TIMER0_Initialization: Timer0 Initial Function
  61           *  @param    None
  62           *  @return   None
  63           */
  64          
  65          void TIMER0_Initialization(void)
  66          {
  67   1        /*
  68   1         *  (1) Set Timer0 Mode0 (13-bit Timer) And IHRC As Timer Source
  69   1         *  (2) Set TL0 Overflow Value
  70   1         *  (3) Set TH0 Overflow Value
  71   1         *    
  72   1         */ 
  73   1          TMOD |= (mskTMOD_T0_MODE3|mskTMOD_T0CT);                        /*  (1) */
  74   1          TH0 = TH0_VALUE;                                                /*  (2) */
  75   1          TL0 = TH0_VALUE;                                                /*  (3) */  
  76   1          TCON0 |=(mskTCON0_T0_DIV128|mskTCON0_T1_DIV128);                  
  77   1          IEN0 |= (mskIEN0_ET0|mskIEN0_ET1);                              
  78   1          EAL = 1;                                                        
  79   1          TCON |= (mskTCON_TR0|mskTCON_TR1);                              
  80   1                          
  81   1      
  82   1      }
  83          
  84          /**
  85           *  @Brief    initial GPIO status
  86           *  @param    None
  87           *  @return   None
  88           */
  89          void GPIO_Initialization(void)
  90          {
  91   1          IO_PORT0_OUTPUT_LOW
  92   1          IO_PORT1_OUTPUT_LOW
  93   1          IO_PORT3_OUTPUT_LOW
  94   1          IO_PORT4_OUTPUT_LOW       
  95   1      }
  96          
  97          
  98          /**
  99           *  @Brief    isr_timer0: Timer0 ISR Function
 100           *  @param    None
 101           *  @return   None
 102           */
 103          void ISR_Timer0(void) interrupt ISRTimer0 using 3
 104          {
 105   1        /*
 106   1         *  (1) Timer0 ISR Test Pin Toggle
 107   1         *  (2) Re-load Timer Counter 
 108   1         *
 109   1         */ 
 110   1          OB_T0TEST_PIN ^= 1;                             /*  (1) */ 
 111   1          TCON &= TIMER0_STOP;                              
 112   1          TL0 = TL0_VALUE;                                /*  (2) */
 113   1          TH0 = TH0_VALUE;                                /*  (2) */
 114   1          TCON |= (mskTCON_TR0);                          
 115   1      
 116   1      }
C51 COMPILER V9.54   MAIN                                                                  04/26/2022 17:09:08 PAGE 3   

 117          void ISR_Timer1(void) interrupt ISRTimer1 using 3
 118          {
 119   1        /*
 120   1         *  (1) Timer1 ISR Test Pin Toggle
 121   1         *  (2) Re-load Timer Counter 
 122   1      
 123   1         *
 124   1         */   
 125   1          OB_T1TEST_PIN ^=1;                                              /*  (1) */ 
 126   1          TCON &= TIMER1_STOP;                                            
 127   1          TH0 = TH0_VALUE;                                                  /*  (2) */
 128   1          TCON |= (mskTCON_TR1);                                          
 129   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     95    ----
   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)
