4.3 Port 1
The Port 1 is an 8-bit bi-directional I/O port. Port pins P1.2 to P1.7 provide internal pull-ups. P1.0
and P1.1 require external pull-ups. P1.0 and P1.1 also serve as the positive input (AIN0) and the
negative input (AIN1), respectively, of the on-chip precision analog comparator. The Port 1 output
buffers can sink 20 mA and can drive LED displays directly. When 1s are written to Port 1
pins, they can be used as inputs. When pins P1.2 to P1.7 are used as inputs and are externally
pulled low, they will source current (IIL) because of the internal pull-ups.
Port 1 also receives code data during Flash programming and verification.
因為我是在想,會不是是KEIL C Build hex檔時,有錯誤(應該不太可能)。作者: austin1211 時間: 2008-7-4 09:22
你說你寫組語可以,但是C不可以RUN
那我知道
是 Keil C 最佳化把你的 Delay 函式省掉了
所以你可以用示波器量量看LED,應該有很高速的Hi Lo 變化
處理方法
方法一:
在程式開頭加入下行
#include <intrins.h>
修改Delay 函式
delay( unsigned int d )
{
int i,j,k;