输入捕获计时器1 ATMEGA 328P计算占空比周期
我是MP编程的新手,并且正在使用CodeVision程序进行一个项目,该项目需要:
- 在A0上连接电位计。
- 生成具有等效平均直流电压的PWM信号,比电位计的电压的测量值。 DAC的测量电压显示在LCD(16*2)的第1行。
- 选择合适的RC电路以获取纯直流电压。
- 将生成的PWM信号连接到ICP1并计算其占空比,并在屏幕上的第2行上显示。
因此,屏幕应该像:
Pot1 = 0.000 V
Duty Cycle = ..%
我制作了第一行,但我不知道如何将Timer1实现到此要求中。
同样,计时器1具有ICRH和ICRL,我很困惑应该使用哪些。
I am new to MP programming and I am working on a project with codevision program, which requires to:
- Connect potentiometer at A0.
- Generate a PWM signal with an equivalent average DC voltage to the measured value of the voltage of the potentiometer.
The measured voltage from the DAC is displayed on line 1 of lcd (16*2). - Choose a suitable RC circuit to get a pure DC voltage.
- Connect the generated PWM signal to the ICP1 and calculate its duty cycle and display it on line 2 off the screen.
So the screen should be like:
Pot1 = 0.000 V
Duty Cycle = ..%
I made the first line but I don't know how to implement timer1 into this requirement.
Also timer 1 has ICRH and ICRL and I am confused which of them should be used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论