C51 COMPILER V9.54   MAIN                                                                  05/06/2022 17:05:37 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 2022 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          /*_____ I N C L U D E S _________________________________*/
  11          #define __XRAM_SFR_H__
  12          #include <SN8F5835.h>
  13          #include "crc.h"
  14          
  15          /*_____ F U N C T I O N S _______________________________*/
  16          void GPIO_Initialization(void);
  17          
  18          /*_____ D E F I N I T I O N S ___________________________*/
  19          
  20          /*_____ D E C L A R A T I O N S _________________________*/
  21          extern uint16_t code CRC_CHECK_DATA;
  22          
  23          /*_____ M A C R O S _____________________________________*/
  24          #define    IO_PORT0_OUTPUT_LOW        P0M |= 0xFF;    P0 &= 0x00;
  25          #define    IO_PORT1_OUTPUT_LOW        P1M |= 0xFF;    P1 &= 0x00;
  26          #define    IO_PORT3_OUTPUT_LOW        P3M |= 0xFF;    P3 &= 0x00;
  27          #define    IO_PORT4_OUTPUT_LOW        P4M |= 0xFF;    P4 &= 0x00;
  28          
  29          #define OB_IO_OUTPUT_LOW      P00=0;  P0M |=0x01; 
  30          #define OB_IO_OUTPUT_HIGH     P00=1;  P0M |=0x01;
  31          
  32          
  33          /**
  34           *  @Brief    main: CRC Test Demo Function
  35           *  @param    None
  36           *  @retval   None
  37           */
  38          
  39          void main(void)
  40          {
  41   1        uint16_t dbCRC16_Result;
  42   1        uint16_t dbCRC16_AppResult;
  43   1        uint8_t code *AddrprtCRCOption;
  44   1        
  45   1        /*  Initialize GPIO status  */
  46   1        GPIO_Initialization();
  47   1        
  48   1        /*  Initialize and Configurate CRC data */
  49   1        AddrprtCRCOption = (uint8_t code *)&CRC_CHECK_DATA;
  50   1        
  51   1        while(1)
  52   1        {
  53   2          /*  For example, auto calculate ROM to last 1page and 2byte with CRC CRC16-CCITT  */    
  54   2          /*  Initializes and configures the CRC function
C51 COMPILER V9.54   MAIN                                                                  05/06/2022 17:05:37 PAGE 2   

  55   2              (1) CRC mode configuration
  56   2              (2) CRC seed initialization   
  57   2              (3) Start CRC calculation */  
  58   2          CRCM = mskCRCM_CRC16 | mskCRCM_RANGE_BYPASS1 | mskCRCM_ENABLE;    /* (1)  */
  59   2          CRCM |= mskCRCM_RESET;                                            /* (2)  */
  60   2          CRCM |= mskCRCM_RUN;                                              /* (3)  */
  61   2      
  62   2          /*  Check CRC calculation done  */
  63   2          while ((CRCM & mskCRCM_BUSY) != 0x00);
  64   2      
  65   2          /*  Compare wtih hardware result and APP result, the APP results were be set on OPTIONS_SN8F5835.A51  */
  66   2          dbCRC16_Result = (CRCDATH << 8) | CRCDATL;
  67   2          dbCRC16_AppResult = (*(AddrprtCRCOption+0)<<8) + *(AddrprtCRCOption+1);   
  68   2          
  69   2          /*  If HW CRC result is right, IO output high
  70   2              If HW CRC result is wrong, IO output low  */
  71   2          if(dbCRC16_Result==dbCRC16_AppResult)
  72   2          {
  73   3            OB_IO_OUTPUT_HIGH
  74   3          }
  75   2          else
  76   2          {
  77   3            OB_IO_OUTPUT_LOW
  78   3          }
  79   2        }
  80   1      }
  81          
  82          
  83          /**
  84           *  @Brief    Initialize GPIO status
  85           *  @param    None
  86           *  @retval   None
  87           */
  88          void GPIO_Initialization(void)
  89          {
  90   1        /*  Set whole IOs to output low */
  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          


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


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