用示波器不能显示PWM输出的波形,怎么办??!!!

- UID
- 828816
|
用示波器不能显示PWM输出的波形,怎么办??!!!
我用9S12DP256单片机,写了一个很简单的程序,如下:
void PWMinit(void)
{
PWMPOL=0x01;//极性选择位是1,
PWMCLK=0x00;//A为时钟源
PWMPRCLK=0x07;//分频
PWMCAE=0x00;//左对齐
PWMPER0=0x19;//周期寄存器
}
void main(void)
{
PWMinit();
PWMDTY0=10;//占空比
PWME=0x01;
EnableInterrupts;
for(;;) {}
}
连上示波器之后,不能输出方波,示波器只显示高电平,为什么呀???急急急!!! |
|
|
|
|
|

- UID
- 519949
- 性别
- 男
|
|
|
|
|
|

- UID
- 834301
|
void PWMinit(void)
{
PWMPOL=0x01;//极性选择位是1,
PWMCLK=0x00;//A为时钟源
PWMPRCLK=0x07;//分频
PWMCAE=0x00;//左对齐
PWMPER0=0x19;//周期寄存器
} |
|
|
|
|
|

- UID
- 828816
|
谢谢各位的回答!
后来发现是示波器接错了~~~~~ |
|
|
|
|
|