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

📄 readme.txt

📁 keil公司提供的c51例子
💻 TXT
字号:
http://www.keil.com/download/c51.asp

(1). 8051_ex0.zip

This example program demonstrates how to program the external interrupt 0 (/INT0) pin as a falling-edge interrupt source.

(2). 8051 Bit I/O Example Program

This example program shows how to:

Declare a Special Function Register (SFR)
Declare a Bit in a Bit-Addressable SFR
Configure an I/O Port Pin as an Input
Read an Input Pin
Write an Output Pin
It works with virtually all devices that are 100%-compatible with the Standard 8051 Port 1.

You can test this program using the uVision2 Debugger. I/O Ports are completely simulated (input and output) so you can change the state of the P1.0 input and watch the state of the P1.1 output as it changes.

Buttons are defined for the toolbox which set and clear the P1.0 pin (see the DEBUG.INI file). You may use these buttons to change the state of P1.0.

To test this example program:

1. Start the debugger.
2. Click on Debug - Go to run the program.
3. Make sure that View - Periodic Window Update is checked.
4. Click Peripherals - I/O-Ports - Port 1 to view P1.
5. Click on the Set P1.0 and Clr P1.0 toolbox buttons.
6. Watch as P1.1 changes to match P1.0.

(3). 8051 Counter 0 Example Program
This example program shows how to configure timer/counter 0 as a 16-bit counter taking input from Port 3.4. Each time P3.4 goes low, the 16-bit counter increments by 1.

To test this program...

1. Start the debugger.
2. View the Toolbox window.
3. View the Serial window.
4. Run the program.
5. Click the Toggle Port 3.4 button in the toolbox.

You will see the value of the counter increase each time you
click on the Toggle button in the ToolBox.

 (4). 8051 Memory Write Example Program
This program is a simple demonstration of the DATA, IDATA, PDATA, and XDATA memory areas of the 8051. The program writes a short string into each of these memory areas. You may use the memory window (View - Memory Window) to view the contents of each memory area.

There are four user-configurable Memory Windows available. Each one can be configured to display a memory area and data type. So, you can watch HEX values from XDATA in one memory window and ASCII values from IDATA in another window.

The example program writes stuff into memory ONLY for demonstration purposes. You should not use this method of writing into memory in structured, high-level programming languages. This example is only intended to give you a feel for the memory organization of the 8051.

Note: This example was created using a Generic 8052 device. However, it will work with ANY 8051 that has DATA, IDATA, and XDATA memory.

(5). 8051 Port I/O Example Program

This example project shows how to read and write the 8-bit ports of a standard 8051.



⌨️ 快捷键说明

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