📄 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 + -