?? pwmmain.c
字號:
/*------------------------------------------------------------------------------
pwmMain.c : Sample Program that demonstrates the pulse width modulator for the
following microcontrollers
Philips 80C552
Philips 80C554
Philips 83/87C552
Philips 83/87C554
Philips 83/87C557E4
Philips 83/87C557E8
Copyright (c) 1988-2001 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/
sfr PWM0 = 0xFC;
sfr PWM1 = 0xFD;
sfr PWMP = 0xFE;
/*------------------------------------------------------------------------------
main() : Runs a while loop as the PWM automatically loops
------------------------------------------------------------------------------*/
void main( void )
{
PWMP = 0x01; //Set the repition frequenct to 2.85kHz
PWM0 = 0x3F; //Set the Duty cycle to 75%
PWM1 = 0xAA; //Set the Duty cycle to 33%
while(1); //Loop while PWM runs in background
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -