?? blinky.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 + -