UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor amyfawcett
Visitor
349 Views
Registered: ‎12-02-2018

square wave output on nexys 4 board

Hey, I want to output a tone from the pwm audio output on my nexys 4. How should I connect the wave output to the physical port?  the basic module I'm using is below, I have connected 'speaker' to aud_pwm in the constraints - do i also need to connect the 'shut down' port? If so to what? Any help is appreciated :)

 

module music(
    input clk,
    output speaker,
    );
    
    
 //16 bit binary counter
 reg[15:0] counter;
 
 always @ (posedge clk) if (counter==56817) counter <= counter+1; else
 counter <= counter + 1;
 
reg spk;
always @ (posedge clk) if(counter == 28408) spk <= ~speaker;
 
assign speaker = spk;

endmodule

 

0 Kudos