?? main.c
字號:
#include <REG768.H>
void main (void)
{
unsigned char i;
/************************************************
Set CIN1A(P0^4) and CIN2A(P0^2 as Input Only and
CMP1 Out(P0^6) and CMP2 Out(P0^0) as Push-Pull
Output
************************************************/
P0M2 &= ~0x14; // Set P0^4 and P0^2 Input Only
P0M1 |= 0x14; // Disable Dig Out on Cmp Input pins.
PT0AD = 0x14; // Disable Digital Input on CMP pins.
/****************************************************
Enable the Comparator 1 with Pos In on CIN1A and
Neg In from internal Vref of 1.28V.
****************************************************/
CMP1 = 0x2C;
/****************************************************
Enable the Comparator 2 with Pos In on CIN2A and
Neg In from external CMPREF.
****************************************************/
CMP2 = 0x24;
/********************************************************
Delay 10uSec to allow comparator to stabilize
********************************************************/
for (i=0; i<= 10; i++); // Do nothing delay 10uSec
while(1)
{
; // Loop Forever
; // Your software here
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -