Forum Discussion
Altera_Forum
Honored Contributor
13 years ago --- Quote Start --- I am completely new in FPGA, and I don't know the VHDL as well, Could you please help me to change the parts as you mentioned and revise the code. --- Quote End --- You won't learn if I simply revise the code for you, so instead I will give you hints. The first thing you should learn is don't find code on the internet and just use it. Find yourself a VHDL tutorial and start working your way through it. The code you have downloaded makes use of the VHDL buffer keyword. I have never used this keyword, and have never seen code that uses it. This keyword allows you to both read and write the port in a design. A more experienced VHDL coder would use an internal signal, and drive an output port, i.e., the buffer keyword would be changed to output. So here are your tasks: 1. Modify the design to use an internal signal and an output port. 2. Add a gpio port to the top-level design, and drive that signal with the internal signal you created in (1). Add the pin assignment for the gpio port, and resynthesize the design. Connect your oscilloscope to the gpio pin (and a ground pin), and you will see the PWM waveform. I would recommend you learn to use the Modelsim simulator. It allows you to simulate your VHDL and to see the waveforms from your design, without having to run it in hardware. Cheers, Dave