Altera_Forum
Honored Contributor
11 years agoLive Control of PWM Outputs (need advice)
I've been searching around google for how to implement what I need but I'm not understanding the underlying ideas as a whole, and I'm hoping for some explanation and advice.
My project: Generate several PWM outputs. The frequency/phase/dutycycle should all be controllable WHILE the FPGA is running (if this is even possible?). My hardware: Altera DE0 Nano board What I understand so far (I think): I need to make some sort of live prompt on the screen where the user enters values for the freq/phase/dutycycle. I'm assuming this requires underlying C/C++ to read the keystrokes. I've written Verilog that uses a counter to turn the PWM outputs on/off according to a duty cycle parameter, as well as a shift register to introduce phase shifting to the outputs. I don't understand how to use keyboard input or even C/C++ code to change the Verilog module's parameters as the FPGA is running. The closest thing I can think of is using a NiosII with a C software application, but this would require the user to rebuild and run after every parameter is changed. Also, I assume there is some sort of Altera IP for PWM outputs, but my searches have given me nothing. I would really appreciate at least a high level explanation of how one can control Verilog parameters while the FPGA is running and how C code in NIOSII interacts with a Verilog module. Thank you for any help you can give!