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

📄 blinky.lst

📁 C8051F单片机应用和液晶显示器编程的例子
💻 LST
字号:
C51 COMPILER V7.05   BLINKY                                                                04/20/2005 13:16:04 PAGE 1   


C51 COMPILER V7.05, COMPILATION OF MODULE BLINKY
OBJECT MODULE PLACED IN Blinky.OBJ
COMPILER INVOKED BY: C:\Program Files 2\SiLabs\MCU\IDEfiles\C51\BIN\C51.exe Blinky.c DB OE

stmt level    source

   1          //-----------------------------------------------------------------------------
   2          // Blinky.c
   3          //-----------------------------------------------------------------------------
   4          // Copyright (C) 2004 Silicon Laboratories, Inc.
   5          //
   6          // AUTH: JS
   7          // DATE: 03 JUL 02
   8          //
   9          // This program flashes the green LED on the C8051F31x target board about 
  10          // five times a second using the interrupt handler for Timer2.
  11          //
  12          // Target: C8051F31x
  13          //
  14          // Tool chain: KEIL Eval 'c'
  15          //
  16          
  17          //-----------------------------------------------------------------------------
  18          // Includes
  19          //-----------------------------------------------------------------------------
  20          #include <c8051f310.h>                    // SFR declarations
  21          
  22          //-----------------------------------------------------------------------------
  23          // 16-bit SFR Definitions for 'F30x
  24          //-----------------------------------------------------------------------------
  25          
  26          sfr16 TMR2RL   = 0xca;                    // Timer2 reload value
  27          sfr16 TMR2     = 0xcc;                    // Timer2 counter
  28          
  29          //-----------------------------------------------------------------------------
  30          // Global CONSTANTS
  31          //-----------------------------------------------------------------------------
  32          
  33          #define SYSCLK       24500000 / 8         // SYSCLK frequency in Hz
  34          
  35          sbit LED = P3^3;                          // LED='1' means ON
  36          sbit SW2 = P0^7;                          // SW2='0' means switch pressed
  37          
  38          //-----------------------------------------------------------------------------
  39          // Function PROTOTYPES
  40          //-----------------------------------------------------------------------------
  41          void SYSCLK_Init (void);
  42          void PORT_Init (void);
  43          void Timer2_Init (int counts);
  44          void Timer2_ISR (void);
  45          
  46          //-----------------------------------------------------------------------------
  47          // MAIN Routine
  48          //-----------------------------------------------------------------------------
  49          void main (void) {
  50   1      
  51   1                                                
  52   1         PCA0MD &= ~0x40;                       // CIDL WDTE WDCLK 0 CPS2 CPS1 CPS0 ECF (sfr PCA0MD=0xD9;PCA0 MO
             -DE)
  53   1                                                // CIDL=0/1 当系统控制器处于空闲方式时,PCA 继续正常工作/当系统

⌨️ 快捷键说明

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