⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tlc5620.lst

📁 TLC5620 12位串行DA芯片资料 大家要看哦
💻 LST
字号:
C51 COMPILER V7.06   TLC5620                                                               07/27/2007 15:42:01 PAGE 1   


C51 COMPILER V7.06, COMPILATION OF MODULE TLC5620
OBJECT MODULE PLACED IN TLC5620.OBJ
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE TLC5620.c BROWSE DEBUG OBJECTEXTEND

stmt level    source

   1          #include<reg52.h>
   2          
   3          sbit TLC5620_DATA=P0^0;
   4          sbit TLC5620_CLK=P0^1;
   5          sbit TLC5620_LOAD=P0^2;
   6          
   7          unsigned char code SineWaveTable[]=
   8          {
   9          0x7f,0x82,0x85,0x88,0x8b,0x8e,0x91,0x94,0x97,0x9a,
  10          0x9d,0xa0,0xa3,0xa6,0xa9,0xac,0xaf,0xb2,0xb5,0xb8,
  11          0xba,0xbd,0xc0,0xc2,0xc5,0xc8,0xca,0xcd,0xcf,0xd1,
  12          0xd4,0xd6,0xd8,0xda,0xdd,0xdf,0xe1,0xe3,0xe4,0xe6,
  13          0xe8,0xea,0xeb,0xed,0xee,0xf0,0xf1,0xf3,0xf4,0xf5,
  14          0xf6,0xf7,0xf8,0xf9,0xfa,0xfa,0xfb,0xfc,0xfc,0xfd,
  15          0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,
  16          0xfc,0xfc,0xfb,0xfa,0xfa,0xf9,0xf8,0xf7,0xf6,0xf5,
  17          0xf4,0xf3,0xf1,0xf0,0xef,0xed,0xec,0xea,0xe8,0xe6,
  18          0xe5,0xe3,0xe1,0xdf,0xdd,0xdb,0xd8,0xd6,0xd4,0xd2,
  19          0xcf,0xcd,0xca,0xc8,0xc5,0xc3,0xc0,0xbd,0xbb,0xb8,
  20          0xb5,0xb2,0xaf,0xac,0xa9,0xa7,0xa4,0xa1,0x9e,0x9b,
  21          0x97,0x94,0x91,0x8e,0x8b,0x88,0x85,0x82,0x7f,0x7c,
  22          0x78,0x75,0x72,0x6f,0x6c,0x69,0x66,0x63,0x60,0x5d,
  23          0x5a,0x57,0x54,0x51,0x4e,0x4b,0x48,0x46,0x43,0x40,
  24          0x3d,0x3b,0x38,0x36,0x33,0x31,0x2e,0x2c,0x29,0x27,
  25          0x25,0x23,0x21,0x1f,0x1c,0x1b,0x19,0x17,0x15,0x13,
  26          0x12,0x10,0x0f,0x0d,0x0c,0x0b,0x09,0x08,0x07,0x06,
  27          0x05,0x04,0x03,0x03,0x02,0x01,0x01,0x00,0x00,0x00,
  28          0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,
  29          0x02,0x03,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,
  30          0x0c,0x0d,0x0e,0x10,0x11,0x13,0x15,0x16,0x18,0x1a,
  31          0x1c,0x1e,0x20,0x22,0x24,0x27,0x29,0x2b,0x2e,0x30,
  32          0x33,0x35,0x38,0x3a,0x3d,0x40,0x42,0x45,0x48,0x4b,
  33          0x4e,0x50,0x53,0x56,0x59,0x5c,0x5f,0x62,0x65,0x68,
  34          0x6b,0x6f,0x72,0x75,0x78,0x7b,
  35          };
  36          void TLC5620SendBit(unsigned char dat)
  37          {
  38   1              if(dat==0)
  39   1              {
  40   2                      TLC5620_DATA=0;
  41   2              }else   //非0
  42   1                      {
  43   2                              TLC5620_DATA=1;
  44   2                      }
  45   1                      TLC5620_CLK=1;
  46   1                      TLC5620_CLK=0;
  47   1      }
  48          void TLC5620SendByte(unsigned char dat)
  49          {
  50   1              unsigned char i;
  51   1              //unsigned char temp;
  52   1              for(i=0;i<8;i++)
  53   1              {
  54   2                      TLC5620SendBit(dat & 0x80);
  55   2                      dat<<=1;
C51 COMPILER V7.06   TLC5620                                                               07/27/2007 15:42:01 PAGE 2   

  56   2              }
  57   1      }
  58          void TLC5620SendAddr(unsigned char addr)
  59          {
  60   1              unsigned char i;
  61   1              addr<<=6;
  62   1              for(i=0;i<2;i++)
  63   1              {                       
  64   2                      TLC5620SendBit(addr & 0x80);
  65   2                      addr<<=1;
  66   2              }
  67   1              TLC5620SendBit(0);//RNG=0;
  68   1      }
  69          void TLC5620DA(unsigned char addr,unsigned char dat)
  70          {
  71   1              TLC5620_CLK=0;
  72   1              TLC5620SendAddr(addr);
  73   1              TLC5620SendByte(dat);
  74   1              TLC5620_LOAD=0;
  75   1              TLC5620_LOAD=1;
  76   1      }
  77          
  78          main()
  79          {
  80   1      //      unsigned char i,j;      
  81   1              TLC5620DA(0,128);
  82   1               TLC5620DA(2,255);
  83   1              while(1)
  84   1              {
  85   2                       ;
  86   2              //      for(j=0;j<200;j++);
  87   2              //      i++;
  88   2              //      if(i>=128)i=0;
  89   2              }
  90   1      }


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


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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -