嗨,
“通过另一个源生成PWM并进行处理”是什么意思?
你在谈论你正在计数的时钟信号吗?
如果你能熟练使用C语言,你可能会使用微控制器进行背景操作。
您是否曾在数据表中查找过这种器件的PWM发生器部分?
猜猜是什么,它也使用CPU时钟来从中获取PWM信号。
所有可编程的东西,如频率,PWM分辨率(步长)等总是来自一些主时钟。
在FPGA中,主时钟可以是几百MHz。
使用满量程8位分辨率(占空比0到100%,256步),您可以达到大约一兆赫兹的频率。
这应该胜过嵌入在微控制器中的大多数PWM发生器。
但是,为了使事情可调整,您需要设计一些开销并实现必要的逻辑以使调整值生效。
或者,如果您不需要/想要在运行时更改设置,则需要了解如何以可配置的可重用方式编写HDL源。
对于VHDL泛型可能很有用。
因此,您只需编写一些PWM生成模块,并在您的顶层设计中通过泛型设置它
PWM信号有不同的应用。
看看他的那个(http://www.fpga4fun.com/PWM_DAC.html)。
方法略有不同,但很好地解释了。
此外,您还可以在该网站上找到更多适合初学者的实用提示。
HDL只是帮助您创建事物的工具。
但真正需要的是对数字系统及其设计的基本理解。
有一个很好的综合
Eilert
以上来自于谷歌翻译
以下为原文
Hi,
What do you mean by "getting the PWM generated by another source and processing it"?
Are you refering to the clock signal that you are counting?
If you are fluent with C you probably have some backgrond using microcontrollers. Have you once looked up the PWM generator section of such a device in the datasheet? Guess what, it uses the CPUs clock too to derive the PWM signals from that.
All the programmable stuff, like frequency, PWM resolution (step width) etc. are always derived from some main Clock.
In an FPGA the Main clock can be of some hundred MHz. With a full scale 8 bit resolution (duty cycle 0 to 100% in 256 Steps) you can reach frequencys of about a megahertz. That should beat most PWM generators embedded in microcontrollers.
However, in order to make things adjustable you need to design with some overhead and implement the neccessary logic for the adjustment values to take effect.
Or, if you do not need/want to change the settings during runtime, you need to learn how to write HDL sources in a configurable reusable way. For VHDL generics can be useful. Thus you write some PWM generating module once and set it properties by the generics in your toplevel design
There are different applications for PWM signals.
Take a look at his one ( http://www.fpga4fun.com/PWM_DAC.html ).
The approach is a little different but nicely explained.
Also you will find many more practical hints for beginners on that website.
HDLs are just a tool to help you create things. But what is really needed is a fundamental understanding of digital systems and their design.
Have a nice synthesis
Eilert