亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? picoblaze_pwm_control.vhd

?? EDA原理及VHDL實現(何賓教授)
?? VHD
字號:
--
-- Reference design - Pulse Width Modulation (PWM) using PicoBlaze software and 
--                    interrupts only on the Spartan-3E Starter Kit.
--
-- Ken Chapman - Xilinx Ltd - 22nd May 2006
--
-- Allows the intensity of the 8 LEDs to be controlled using pulse width modulation. 
-- The 4 simple header pins provided at connector J4 may also be controlled.
--
-- All 12 channels are PWM with a PRF of 1KHz and duty cycle resolution of 8-bits
-- (256 steps) with each being independently controlled using simple commands typed 
-- at a terminal connected to the RS232 port (J9).
--
-- The design is set up for a 50MHz system clock and UART communications of 9600 baud.
--
-- The JTAG loader utility is also available for rapid program development.
--
--
------------------------------------------------------------------------------------
--
-- NOTICE:
--
-- Copyright Xilinx, Inc. 2006.   This code may be contain portions patented by other 
-- third parties.  By providing this core as one possible implementation of a standard,
-- Xilinx is making no representation that the provided implementation of this standard 
-- is free from any claims of infringement by any third party.  Xilinx expressly 
-- disclaims any warranty with respect to the adequacy of the implementation, including 
-- but not limited to any warranty or representation that the implementation is free 
-- from claims of any third party.  Furthermore, Xilinx is providing this core as a 
-- courtesy to you and suggests that you contact all third parties to obtain the 
-- necessary rights to use this implementation.
--
------------------------------------------------------------------------------------
--
-- Library declarations
--
-- Standard IEEE libraries
--
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
--
------------------------------------------------------------------------------------
--
--
entity picoblaze_pwm_control is
    Port (       led : out std_logic_vector(7 downto 0);
              simple : out std_logic_vector(12 downto 9);
           tx_female : out std_logic;
           rx_female : in std_logic;
                 clk : in std_logic);
    end picoblaze_pwm_control;
--
------------------------------------------------------------------------------------
--
-- Start of test architecture
--
architecture Behavioral of picoblaze_pwm_control is
--
------------------------------------------------------------------------------------
--
-- declaration of KCPSM3
--
  component kcpsm3 
    Port (      address : out std_logic_vector(9 downto 0);
            instruction : in std_logic_vector(17 downto 0);
                port_id : out std_logic_vector(7 downto 0);
           write_strobe : out std_logic;
               out_port : out std_logic_vector(7 downto 0);
            read_strobe : out std_logic;
                in_port : in std_logic_vector(7 downto 0);
              interrupt : in std_logic;
          interrupt_ack : out std_logic;
                  reset : in std_logic;
                    clk : in std_logic);
    end component;
--
-- declaration of program ROM
--
  component pwm_ctrl
    Port (      address : in std_logic_vector(9 downto 0);
            instruction : out std_logic_vector(17 downto 0);
             proc_reset : out std_logic;                       --JTAG Loader version
                    clk : in std_logic);
    end component;
--
--
-- declaration of UART transmitter with integral 16 byte FIFO buffer.
--  
  component uart_tx
    Port (              data_in : in std_logic_vector(7 downto 0);
                   write_buffer : in std_logic;
                   reset_buffer : in std_logic;
                   en_16_x_baud : in std_logic;
                     serial_out : out std_logic;
                    buffer_full : out std_logic;
               buffer_half_full : out std_logic;
                            clk : in std_logic);
    end component;
--
-- declaration of UART Receiver with integral 16 byte FIFO buffer
--
  component uart_rx
    Port (            serial_in : in std_logic;
                       data_out : out std_logic_vector(7 downto 0);
                    read_buffer : in std_logic;
                   reset_buffer : in std_logic;
                   en_16_x_baud : in std_logic;
            buffer_data_present : out std_logic;
                    buffer_full : out std_logic;
               buffer_half_full : out std_logic;
                            clk : in std_logic);
  end component;
--
------------------------------------------------------------------------------------
--
-- Signals used to connect KCPSM3 to program ROM and I/O logic
--
signal address          : std_logic_vector(9 downto 0);
signal instruction      : std_logic_vector(17 downto 0);
signal port_id          : std_logic_vector(7 downto 0);
signal out_port         : std_logic_vector(7 downto 0);
signal in_port          : std_logic_vector(7 downto 0);
signal write_strobe     : std_logic;
signal read_strobe      : std_logic;
signal interrupt        : std_logic :='0';
signal interrupt_ack    : std_logic;
signal kcpsm3_reset     : std_logic;
--
-- Signals for interrupt generation 
--
signal  interrupt_count : integer range 0 to 195 :=0;
signal  interrupt_event : std_logic;
--
-- Signals for connection of UART 
--
signal      status_port : std_logic_vector(7 downto 0);
signal       baud_count : integer range 0 to 325 :=0;
signal     en_16_x_baud : std_logic;
signal    write_to_uart : std_logic;
signal          tx_full : std_logic;
signal     tx_half_full : std_logic;
signal   read_from_uart : std_logic;
signal          rx_data : std_logic_vector(7 downto 0);
signal  rx_data_present : std_logic;
signal          rx_full : std_logic;
signal     rx_half_full : std_logic;
--
--
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--
-- Start of circuit description
--
begin
  --
  ----------------------------------------------------------------------------------------------------------------------------------
  -- KCPSM3 and the program memory 
  ----------------------------------------------------------------------------------------------------------------------------------
  --

  processor: kcpsm3
    port map(      address => address,
               instruction => instruction,
                   port_id => port_id,
              write_strobe => write_strobe,
                  out_port => out_port,
               read_strobe => read_strobe,
                   in_port => in_port,
                 interrupt => interrupt,
             interrupt_ack => interrupt_ack,
                     reset => kcpsm3_reset,
                       clk => clk);
 
  program_rom: pwm_ctrl
    port map(      address => address,
               instruction => instruction,
                proc_reset => kcpsm3_reset,                       --JTAG Loader version 
                       clk => clk);

  --
  ----------------------------------------------------------------------------------------------------------------------------------
  -- Interrupt 
  ----------------------------------------------------------------------------------------------------------------------------------
  --
  --
  -- Interrupt is used to set timing of PicoBlaze during PWM generation.
  -- Interrupts are generated at a rate consistent with a resolution 256 steps of a 1KHz pulse 
  -- repetition frequency waveform. Therefore an interrupt is required every 3.92us which is 
  -- equivalent to once every 196 cycles when using the 50MHz clock provided on the Starter Kit board.
  --

  interrupt_control: process(clk)
  begin
    if clk'event and clk='1' then

      --Generate interrupt every 3.92us  
      if interrupt_count=195 then
         interrupt_count <= 0;
         interrupt_event <= '1';
       else
         interrupt_count <= interrupt_count + 1;
         interrupt_event <= '0';
      end if;

      -- processor interrupt waits for an acknowledgement
      if interrupt_ack='1' then
         interrupt <= '0';
        elsif interrupt_event='1' then
         interrupt <= '1';
        else
         interrupt <= interrupt;
      end if;

    end if; 
  end process interrupt_control;

  --
  ----------------------------------------------------------------------------------------------------------------------------------
  -- KCPSM3 input ports 
  ----------------------------------------------------------------------------------------------------------------------------------
  --
  --
  -- UART FIFO status signals to form a bus
  -- 

  status_port <= "000" & rx_full & rx_half_full & rx_data_present & tx_full & tx_half_full;

  --
  -- The inputs connect via a pipelined multiplexer
  --

  input_ports: process(clk)
  begin
    if clk'event and clk='1' then

      case port_id(0) is

        -- read simple toggle switches and buttons at address 00 hex
        when '0' =>    in_port <=  status_port;

        -- read UART receive data at address 01 hex
        when '1' =>    in_port <= rx_data;

        -- Don't care used for all other addresses to ensure minimum logic implementation
        when others =>    in_port <= "XXXXXXXX";  

      end case;

      -- Form read strobe for UART receiver FIFO buffer at address 01 hex.
      -- The fact that the read strobe will occur after the actual data is read by 
      -- the KCPSM3 is acceptable because it is really means 'I have read you'!

      if (read_strobe='1' and port_id(0)='1') then 
        read_from_uart <= '1';
       else 
        read_from_uart <= '0';
      end if;

     end if;

  end process input_ports;

  --
  ----------------------------------------------------------------------------------------------------------------------------------
  -- KCPSM3 output ports 
  ----------------------------------------------------------------------------------------------------------------------------------
  --
  -- adding the output registers to the processor
   
  output_ports: process(clk)
  begin

    if clk'event and clk='1' then
      if write_strobe='1' then

        -- Write to LEDs at address 80 hex.

        if port_id(7)='1' then
          led <= out_port;
        end if;

        -- Write to header pins on simple I/O connector J4 at address 40 hex.

        if port_id(6)='1' then
          simple <= out_port(3 downto 0);
        end if;

      end if;

    end if; 

  end process output_ports;

  --
  -- write to UART transmitter FIFO buffer at address 20 hex.
  -- This is a combinatorial decode because the FIFO is the 'port register'.
  --

  write_to_uart <= '1' when (write_strobe='1' and port_id(5)='1') else '0';

  --
  ----------------------------------------------------------------------------------------------------------------------------------
  -- UART  
  ----------------------------------------------------------------------------------------------------------------------------------
  --
  -- Connect the 8-bit, 1 stop-bit, no parity transmit and receive macros.
  -- Each contains an embedded 16-byte FIFO buffer.
  --

  transmit: uart_tx 
  port map (              data_in => out_port, 
                     write_buffer => write_to_uart,
                     reset_buffer => '0',
                     en_16_x_baud => en_16_x_baud,
                       serial_out => tx_female,
                      buffer_full => tx_full,
                 buffer_half_full => tx_half_full,
                              clk => clk );

  receive: uart_rx
  port map (            serial_in => rx_female,
                         data_out => rx_data,
                      read_buffer => read_from_uart,
                     reset_buffer => '0',
                     en_16_x_baud => en_16_x_baud,
              buffer_data_present => rx_data_present,
                      buffer_full => rx_full,
                 buffer_half_full => rx_half_full,
                              clk => clk );  
  
  --
  -- Set baud rate to 9600 for the UART communications
  -- Requires en_16_x_baud to be 153600Hz which is a single cycle pulse every 326 cycles at 50MHz 
  --

  baud_timer: process(clk)
  begin
    if clk'event and clk='1' then
      if baud_count=325 then
         baud_count <= 0;
         en_16_x_baud <= '1';
       else
         baud_count <= baud_count + 1;
         en_16_x_baud <= '0';
      end if;
    end if;
  end process baud_timer;

  --
  ----------------------------------------------------------------------------------------------------------------------------------
  --

end Behavioral;

------------------------------------------------------------------------------------------------------------------------------------
--
-- END OF FILE picoblaze_pwm_control.vhd
--
------------------------------------------------------------------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区在线观看| 日韩精品在线网站| 91精品国产综合久久婷婷香蕉| 日韩精品一区国产麻豆| 一个色综合网站| 国产精品66部| 欧美一区二区人人喊爽| 国产精品国产精品国产专区不片| 日韩高清欧美激情| 91免费视频观看| 欧美激情一区二区三区在线| 美女网站色91| 日韩一区二区在线看| 亚洲午夜视频在线观看| 97se亚洲国产综合自在线观| 精品动漫一区二区三区在线观看| 亚洲国产视频一区| 91福利社在线观看| 亚洲激情男女视频| 91丨九色丨蝌蚪富婆spa| 国产丝袜欧美中文另类| 老司机午夜精品| 日韩午夜av一区| 日本三级韩国三级欧美三级| 欧美性猛片xxxx免费看久爱| 亚洲免费在线电影| 91在线视频播放| 日韩一区有码在线| 99视频在线精品| 亚洲男人天堂av网| 一本在线高清不卡dvd| 亚洲欧美日韩小说| 日本乱码高清不卡字幕| 亚洲精品视频一区二区| 在线观看网站黄不卡| 亚洲一区二区三区中文字幕| 欧美色综合网站| 亚洲国产综合色| 欧美日韩国产综合草草| 午夜久久久久久| 日韩一级片网站| 国内一区二区视频| 国产欧美精品日韩区二区麻豆天美| 国产精品一区2区| 国产精品私人自拍| 色一情一伦一子一伦一区| 亚洲午夜羞羞片| 精品国精品国产尤物美女| 国产成人免费xxxxxxxx| 日韩理论片一区二区| 色婷婷综合久久久久中文 | 蜜桃精品视频在线| 欧美成人官网二区| 春色校园综合激情亚洲| 亚洲欧美一区二区三区久本道91| 欧洲精品视频在线观看| 日本中文字幕一区| 国产视频一区在线播放| 97aⅴ精品视频一二三区| 亚洲一区二区视频| 久久亚洲综合色| 91麻豆精东视频| 理论片日本一区| 中文字幕在线观看不卡| 欧美日韩一区二区三区四区五区| 九九精品一区二区| 最新热久久免费视频| 欧美精品久久久久久久多人混战 | 337p亚洲精品色噜噜| 狠狠色综合播放一区二区| 中文字幕综合网| 欧美大片免费久久精品三p| av不卡免费电影| 奇米色777欧美一区二区| 国产精品福利电影一区二区三区四区 | 99国产精品国产精品久久| 亚洲五月六月丁香激情| 国产亚洲精品精华液| 欧美性欧美巨大黑白大战| 国产99久久久国产精品| 天天色综合成人网| 一区视频在线播放| 亚洲精品一区二区三区在线观看 | 亚洲自拍欧美精品| 国产无人区一区二区三区| 欧美丰满一区二区免费视频| 高清不卡一区二区在线| 制服丝袜亚洲色图| 国产99久久久国产精品潘金网站| 亚洲一区电影777| 欧美日韩精品一区视频| 亚洲一二三级电影| 国产xxx精品视频大全| 国产亚洲精品资源在线26u| 欧美日韩和欧美的一区二区| 成人精品国产一区二区4080| 青青草国产精品97视觉盛宴| 一区二区三区日韩精品| 国产精品蜜臀av| 久久综合久久综合亚洲| 日韩一区二区三区精品视频| 欧美片网站yy| 欧美日韩美少妇| 色综合久久中文综合久久牛| 成人免费看片app下载| 国产成人8x视频一区二区| 美女脱光内衣内裤视频久久网站| 亚洲一区二区欧美日韩| 一区二区三区在线观看动漫 | 久久久综合九色合综国产精品| 欧美日韩精品欧美日韩精品一 | 美女视频一区二区| 水蜜桃久久夜色精品一区的特点| 亚洲午夜一区二区| 亚洲综合激情网| 午夜精品福利一区二区三区av| 亚洲一区二区三区在线看| 亚洲成av人片一区二区梦乃| 亚洲不卡一区二区三区| 午夜精品福利久久久| 日本欧美一区二区在线观看| 免费成人在线视频观看| 国产成人精品1024| 国产精品一级二级三级| 成人av网站在线观看| 91丨porny丨蝌蚪视频| 色综合久久中文字幕| 欧美日韩不卡一区| 欧美成人精品福利| 久久蜜桃香蕉精品一区二区三区| 久久久久久夜精品精品免费| 国产精品蜜臀av| 亚洲精品第一国产综合野| 午夜精品福利一区二区三区蜜桃| 日本欧美在线观看| 国产精品一区二区果冻传媒| 91玉足脚交白嫩脚丫在线播放| 在线精品国精品国产尤物884a| 欧美精品日韩一本| 久久久蜜桃精品| 亚洲精品高清视频在线观看| 日韩激情一二三区| 国产一区二区三区精品欧美日韩一区二区三区 | 日本系列欧美系列| 国产精品99久久久久久久女警| 91亚洲国产成人精品一区二三| 色视频一区二区| 欧美白人最猛性xxxxx69交| 国产精品欧美久久久久一区二区| 一区二区三区中文字幕电影| 日本成人在线看| 91在线精品一区二区三区| 欧美精选一区二区| 亚洲国产精品精华液ab| 亚洲午夜视频在线| 国产v日产∨综合v精品视频| 欧美综合欧美视频| 国产喂奶挤奶一区二区三区| 亚洲午夜在线电影| 国产suv精品一区二区6| 欧美日精品一区视频| 免费成人美女在线观看.| 成人三级在线视频| 制服.丝袜.亚洲.中文.综合| 亚洲欧美影音先锋| 精品亚洲成a人| 色视频欧美一区二区三区| 国产亚洲一二三区| 免费看日韩a级影片| 一本一道久久a久久精品 | 国产经典欧美精品| 欧美日韩精品久久久| 亚洲色大成网站www久久九九| 精品无码三级在线观看视频| 在线观看区一区二| 中文字幕在线观看一区二区| 韩国成人精品a∨在线观看| 欧美日韩不卡一区二区| 日韩毛片一二三区| 成人精品亚洲人成在线| xf在线a精品一区二区视频网站| 亚洲一区自拍偷拍| 色综合一区二区三区| 国产亚洲欧美日韩日本| 国内一区二区视频| 4438亚洲最大| 亚洲丰满少妇videoshd| 色一情一伦一子一伦一区| 欧美韩日一区二区三区四区| 久久国产精品免费| 日韩三级免费观看| 亚洲免费成人av| 欧美精品一区视频| 日本久久电影网| 国产精品成人网| 粉嫩嫩av羞羞动漫久久久| 欧美精品一区二区三区一线天视频| 亚洲成人手机在线| 欧美日韩综合在线免费观看| 久久精品久久99精品久久|