Solución de problemas de salida de audio en Nexys 2 (FPGA)

2

Recientemente he comprado el módulo PMOD AMP1 de digilent para usar con mi Nexys 2.

Cuando programo el proyecto de demostración y conecto los auriculares o los altavoces a la salida de auriculares Puedo escuchar un tono de tono extremadamente alto y apenas audible en la salida de los auriculares.

Después de leer la fuente, me di cuenta de que este proyecto está configurado para un reloj de 100Mhz, mientras que el reloj de mi placa es de 50Mhz. He modificado el synth.vhd de la siguiente manera:

entity synth is
    port(clk : in std_logic;
          syn_out : inout std_logic_vector(7 downto 0));
end synth;

architecture Behavioral of synth is

signal sclk : std_logic_vector(10 downto 0);

begin
    process(clk)
        begin 
            if clk'event and clk = '1' then
            -- divide a clock by "10111010101" (1493) which is about the value of 100M/256/261.6
            -- where 100M is the clock frequency on a Nexys3
            -- 256 is the number of points in the sine wave table
            -- 261.6 is the frequency of a middle C
                if sclk = "1011101010" then -- MODIFIED decreased by half for 50Mhz clk (746 is new clock divider)
                    --"11111111" is 255 is the maximum point in the sine wave table
                    if syn_out < "11111111" then 
                        syn_out <= syn_out + 1;
                    else
                        syn_out <= "00000000";
                    end if;
                    sclk <= "00000000000";
                else
                    sclk <= sclk + 1;
                end if;
            end if;
    end process;

end Behavioral;

Según nidhin también necesito modificar el archivo pwm:

constant ckPwmRange: integer:= 5;
   -- LSB in the cntPwm alias of cntDiv
signal cntPwm: std_logic_vector(ckPwmRange+8 downto 0);
   -- the most significant 8 bits are used for PW Modulator:
   -- cntPwm counts 100MHz/2^ckPwmRange

Creo que dado que el reloj se está ejecutando la mitad de rápido, el cntPwm también debería reducirse a la mitad. Creo que esto significa que ckPwmRange debería ser 2.5, pero en lugar de eso, podría reemplazar la asignación cntPw como:

signal cntPwm: std_logic_vector(ckPwmRange+7 downto 0);

?

    
pregunta ioseph

0 respuestas

Lea otras preguntas en las etiquetas