OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [rtl/] [core/] [neorv32_pwm.vhd] - Diff between revs 62 and 66

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 62 Rev 66
Line 114... Line 114...
  -- Write access ---------------------------------------------------------------------------
  -- Write access ---------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  -- -------------------------------------------------------------------------------------------
  wr_access: process(clk_i)
  wr_access: process(clk_i)
  begin
  begin
    if rising_edge(clk_i) then
    if rising_edge(clk_i) then
      ack_o <= acc_en and (rden_i or wren_i);
      ack_o <= rden or wren;
 
 
      -- write access --
      -- write access --
      if (wren = '1') then
      if (wren = '1') then
        -- control register --
        -- control register --
        if (addr = pwm_ctrl_addr_c) then
        if (addr = pwm_ctrl_addr_c) then
Line 185... Line 185...
        pwm_cnt <= std_ulogic_vector(unsigned(pwm_cnt) + 1);
        pwm_cnt <= std_ulogic_vector(unsigned(pwm_cnt) + 1);
      end if;
      end if;
 
 
      -- channels --
      -- channels --
      for i in 0 to NUM_CHANNELS-1 loop
      for i in 0 to NUM_CHANNELS-1 loop
--if (pwm_cnt = pwm_ch(i)) or (pwm_ch(i) = x"00") or (enable = '0') then
 
--  pwm_o(i) <= '0';
 
--elsif (pwm_cnt = x"00") then
 
--  pwm_o(i) <= '1';
 
--end if;
 
        if (unsigned(pwm_cnt) >= unsigned(pwm_ch(i))) or (enable = '0') then
        if (unsigned(pwm_cnt) >= unsigned(pwm_ch(i))) or (enable = '0') then
          pwm_o(i) <= '0';
          pwm_o(i) <= '0';
        else
        else
          pwm_o(i) <= '1';
          pwm_o(i) <= '1';
        end if;
        end if;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.