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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? vspi.v

?? SPI串口的內(nèi)核實(shí)現(xiàn)(分別使用verilog和vhdl語言描述的)
?? V
?? 第 1 頁 / 共 2 頁
字號(hào):
// ----------------------------------------------------------------------//  Copyright 1997-1998 VAutomation Inc. Nashua NH USA. //  Visit HTTP://www.vautomation.com for mor details on our other//  Synthesizable microprocessor and peripheral cores.// //  This program is free software; you can redistribute it and/or modify//  it under the terms of the GNU General Public License version 2 as//  published by the Free Software Foundation.// //  This program is distributed in the hope that it will be useful,//  but WITHOUT ANY WARRANTY; without even the implied warranty of//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//  GNU General Public License for more details.// //  The GNU Public License can be found at HTTP://www.gnu.org.//  //  The copyright notice above MUST remain in the source code at all//  times!// //  File: vspi.vhd//  Revision: $Name: REV9910 $//  Gate Count: 500 gates (LSI Logic 10K)//  Description:// //       Serial Peripheral Interface (SPI)// //  The VSPI core implements an SPI interface compatible with the many//  serial EEPROMs, and microcontrollers. The VSPI core is typically used//  as an SPI master, but it can be configured as an SPI slave as well.// //  The SPI bus is a 3 wire bus that in effect links a serial shift//  register between the "master" and the "slave". Typically both the//  master and slave have an 8 bit shift register so the combined//  register is 16 bits. When an SPI transfer takes place, the master and//  slave shift their shift registers 8 bits and thus exchange their 8//  bit register values.// //  The VPSI core is completely software configurable. The clock//  polarity, clock phase, the clock frequency in master mode, and the//  number of bits to be transferred are all software programmable. These//  configuration bits are usually determined by the capabilities of the//  other device you wish to communicate with.// //  SPI supports multiple slaves on a single 3 wire bus by using seperate//  SLaVe SELect signals (SVLSEL) to enable the desired slave. Multiple//  masters are also supported and some support is provided for detecting//  collisions when multiple masters attempt to transfer at the same//  time.// //  A Wired-OR mode is provided which allows multiple masters to collide//  on the bus without risk of damage. In this mode, an external pullup//  resisitor is required on the SI and SO pins. WOR mode also allows the//  SPI bus to operate as a 2 wire bus by connecting the SI and SO pins//  together to form a single bidirectional data pin.// //  Generally, pullups are recommended on all of the external SPI signals//  to insure they are held in a valid state even when the VSPI core is//  disabled.// //  Limitations://       When operating as a slave, the SPI clock signal (SCK) must be//       slower than 1/8th of the CPU clock. 1/16th is recommended. Note//       that this core is fully synchronous to the cpu CLK and thus SCK//       is sampled and then operated on. This results in 3 to 4 clocks//       of delay which will violate the SPI spec if SCK is faster than//       1/8th of the CPU clock. When the VSPI core is in master mode, it//       operates exactly on the proper edges since it is generating SCK.// //       The VSPI core was specifically designed to be an SPI master and//       to be connected to a microprocessor such as VAutomations//       V8-uRISC CPU. This core also has the capability to be a slave//       but that feature is considered secondary which is why it is//       speed limited.// //  Register Definition://  Addr Name    R/W     Description//   0   DOUT    W       8 Bit data out register//   0   DIN     R       8 Bit data in register//   1   CTL     R/W     Control Register//                       [0]=Reserved.//                       [1]=MSTENB      Enable SPI master mode//                       [2]=WOR Wire-OR mode enabled//                       [3]=CKPOL       Clock Polarity 1=SCK idles high,//                                       0=SCK idles low//                       [4]=PHASE       Phase Select//                       [6:5]=DVD       Clock divide - 00=8, 01=16,//                                       10=32, 11=64//                       [7]=IRQENB      Interrupt enable//   2   STATUS  R/W     Interrupt Status register//                       Each bit of the status register is cleared to//                       zero by by writting ONE to the respective bit.//                       [7]=IRQ Interrupt active//                               Set at the end of a master mode//                               transfer, or when SLVSEL goes high on a//                               slave transfer//                       [6]=Overrun//                               This bit is set when the DOUT register//                               is written while an SPI transfer is in//                               progress.//                       [5]=COL//                               This bit is set when there is a master//                               mode collision between multiple SPI//                               masters. It is set when SLVSEL goes low//                               while MSTENB=1.//                       [2:4]=zero//                       [1]=TXRUN//                               1=Master mode operation underway.//                               This bit is read only.//                       [0]=SLVSEL//                               This bit corresponds to the SLVSEL pin//                               on the VSPI core (note that this is//                               normally interted at the IO pin). read//                               only.//   3   SSEL    R/W     Slave Select/bit count register//                       SSEL[7:5]//                               Number of bits to shift in master mode, //                               000=8 bits, 001=1 bit, 111=7 bits.//                       SSEL[4:0]//                               5 individual Slave Selects for master//                               mode// //  The VSPI core operates in two fundamentally different modes based on//  the PHASE bit (CTL[4]). The two modes are depicted in the timing//  diagrams below. The key difference centers around the fact that SPI//  data is clocked out on one edge of the clock, and sampled on the//  other. The two modes select where the opposite edge DFF is placed.//  When PHASE=0, a negative edge flop is inserted into the shift_in//  path. The shift_out data is tricky because we must output data from//  the TX_HOLD register for the first bit as we have not seen a clock on//  SCK to clock the data into the shift register. When PHASE=1, the//  negative edge flop is inserted into the shift_out path to hold the//  data for an extra 1/2 clock.// //  Microprocessor interface//       The VSPI microprocessor interface is quite simple and connects//  easily to VAutomations V8-uRISC CPU. Transfers are fully synchronous//  to the CLK signal. When CHIP_SEL and WRITE are both active at the//  rising edge of CLK, a write to the desired register occurs. CHIP_SEL//  and WRITE should only be active for 1 clock cycle.// //  Timing diagram:// //  PHASE=0 (POLCK=0 shown, invert SCKI if POLCK=1)//  Cycle #     | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |//                 _   _   _   _   _   _   _   _      //  SCK    _______| |_| |_| |_| |_| |_| |_| |_| |_____//               ___ ___ ___ ___ ___ ___ ___ ___//  MOSI  ------<_7_X_6_X_5_X_4_X_3_X_2_X_1_X_0_>-----//             _____ ___ ___ ___ ___ ___ ___ _______//  MISO  ----<___7_X_6_X_5_X_4_X_3_X_2_X_1_X_0_XXXX>-//             _____________________________________//  SLVSEL ___/                                     \_//  Shift register runs on the second edge of SCKI. A negative edge flop//  is placed in the shift_in path to sample data on the first edge of//  SCKI.//  PHASE=1 (POLCK=0 shown, invert SCKI if POLCK=1)//  Cycle #       | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |//                 _   _   _   _   _   _   _   _      //  SCK   ________| |_| |_| |_| |_| |_| |_| |_| |_______//                 ___ ___ ___ ___ ___ ___ ___ ___//  MOSI  --------<_7_X_6_X_5_X_4_X_3_X_2_X_1_X_0_>-----//                 _ ___ ___ ___ ___ ___ ___ _________//  MISO  ----XXXXX_7_X_6_X_5_X_4_X_3_X_2_X_1_X_0_____>-//             _______________________________________//  SLVSEL ___/                                       \_//  Shift register runs on the second edge of SCKI. A negative edge flop//  is placed in the shift_out path to hold data data for an extra 1/2//  clock.// //  Crude block diagram:// //  DATAIN--------------------------+//                                  |//                     |\           |//  MISO-------+-------> \      +---v--------+                |\//             |       |  >-----> 8bit Shift >-------+--------> \//             |    +--> /      |> Register  |       |        |  >-->MOSI//             |    |  |/       +---v--------+       |   +----> /        //             |    |               |                |   |    |///             |    |               +---DATAOUT      |   |      //             |    |                                |   |      //             |    +-------------------------+      |   |               //             |     +------------------------|------+   |//             |     |  |\                    |          | //             |     +--> \        +----+     |          | //             |        |  >------->Neg >-----+----------+ //             +--------> /        |DFF |                  //                      |/        O|>   |                  //                                 +----+                  //  Not shown are the control and status registers, the master mode bit//  counters and other control logic.//  //  IO cell Requirements://  The IO cells required for the SPI bus are quite simple. The following//  VHDL code will synthesize to the appropriate cells.// //    miso <= misoo when misoe='1' ELSE 'Z';  -- tristate buffer//    mosi <= mosio when mosie='1' ELSE 'Z';  -- tristate buffer//    sck  <= scko  when scke ='1' ELSE 'Z';  -- tristate buffer// ---------------------------------------------------------------------//  This product is licensed to://  $name$ of $company$//  for use at site(s)://  $site$// ------------Revision History-----------------------------------------//  $Log: vspi.vhd,v $//  Revision 1.7  1999/09/09 16:02:37  scott//  std_ulogic'ified, numeric_std'ified, RMM'ified// //  Revision 1.6  1999/02/17 00:51:50  eric//  Added more checking on various error conditions.// //  Revision 1.5  1999/02/02 19:56:13  eric//  Changes to fully sync to the CPU clock.// //  Revision 1.4  1998/10/16 13:54:57  eric//  Corrected missing sensitiviy list signals for FIRST_BIT.// //  Revision 1.3  1998/09/30 14:56:56  eric//  Initial release level.// //  Revision 1.2  1998/09/24 02:51:44  eric//  Master mode works in phase=0.// ---------------------------------------------------------------------// // --------------------------ENTITY---------------------module vspi (clk,   rst,   addr,   datain,   dataout,   write,   chip_sel,   irq,   misoe,   misoi,   misoo,   mosie,   mosii,   mosio,   scke,   scki,   scko,   slvsele,   slvselo,   slvsel);//    Title      : NUMERIC_STD arithmetic package for synthesis//               : Rev. 2.3 (Feb 27 1995)//               ://    Library    : This package shall be compiled into a library symbolically//               : named IEEE.//               ://    Developers : IEEE DASC Synthesis Working Group, PAR 1076.3//               ://    Purpose    : This package defines numeric types and arithmetic functions//               : for use with synthesis tools. Two numeric types are defined://               :     -- > UNSIGNED: represents UNSIGNED number in vector form//               :     -- > SIGNED: represents a SIGNED number in vector form//               : The base element type is type STD_LOGIC.//               : The leftmost bit is treated as the most significant bit.//               : Signed vectors are represented in two's complement form.//               : This package contains overloaded arithmetic operators on//               : the SIGNED and UNSIGNED types. The package also contains//               : useful type conversions functions.//               ://               : If any argument to a function is a null array, a null array is//               : returned (exceptions, if any, are noted individually).//               ://    Note       : No declarations or definitions shall be included in, or//               : excluded from, this package. The package declaration declares//               : the functions that can be used by a user. The package body//               : shall be considered the formal definition of the semantics of//               : this package. Tool developers may choose to implement the//               : package body in the most efficient manner available to them.//               ://  ----------------------------------------------------------------------------// ==================================================//  Numeric array type definitions// ==================================================input   clk; //  we use IEEE standard 1164 logic types.//  + and - operators//  everything clocks on rising edgeinput   rst; //  resetinput   [1:0] addr; //  address businput   [7:0] datain; //  data busoutput  [7:0] dataout; //  data businput   write; //  write enableinput   chip_sel; //  device Selectoutput  irq; //  interrupt requestoutput  misoe; //  MISO tristate enableinput   misoi; //  Master in/Slave out data inoutput  misoo; //  MISO data outoutput  mosie; //  MOSI tristate enableinput   mosii; //  Master out/Slave in data inoutput  mosio; //  MOSI data outoutput  scke; //  SCK Clock tristate enableinput   scki; output  scko; //  SCK clock outputoutput  slvsele; //  tristate enable for slave selectsoutput  [4:0] slvselo; input   slvsel; wire    [7:0] dataout; //  SPI interface without IO cellswire    irq; wire    misoe; wire    misoo; wire    mosie; wire    mosio; //  SCK Clock input (shift register runs on this)wire    scke; wire    scko; //  external slave selectswire    slvsele; //  Slave Selectwire    [4:0] slvselo; reg     [2:0] bit_ctr; //  control registerreg     [7:0] ctl_reg; reg     col_flag; //  collision flagreg     [4:0] dvd_ctr; //  clock dividerreg     dvd2; wire    dvd_zero; //  clk divider controls//  local version of IRQ before gated with IRQENBreg     irq_flag; wire    master_mode; //  Master mode when 1wire    misoe_lcl; //  local versionwire    mosie_lcl; //  local versionreg     oflow; wire    open_drain; wire    phase; wire    polck; reg     sck_r1; reg     sck_r2; reg     sck_r3; //  synchronizerswire    [1:0] sel_clk; //  THE SPI shift register 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
视频在线观看91| 亚洲色图欧洲色图婷婷| 视频在线观看一区二区三区| 欧美精品丝袜久久久中文字幕| 亚洲福利视频一区二区| 欧美日韩免费电影| 另类小说视频一区二区| 精品99一区二区| 国产不卡在线视频| 亚洲丝袜另类动漫二区| 欧美系列亚洲系列| 日本一区中文字幕| 久久久久国产免费免费| 99精品黄色片免费大全| 午夜精品免费在线观看| 精品999在线播放| av网站一区二区三区| 亚洲精品乱码久久久久久| 9191成人精品久久| 国产精品一区二区久久精品爱涩| 最新久久zyz资源站| 欧美剧在线免费观看网站 | 成人精品小蝌蚪| 亚洲另类春色校园小说| 日韩免费视频一区二区| 成人午夜激情视频| 天堂蜜桃一区二区三区| 国产欧美一区二区精品仙草咪| 色呦呦日韩精品| 久久精品国产久精国产| 亚洲欧美一区二区视频| 欧美一区二区三区免费大片 | 日韩女优制服丝袜电影| 国产不卡高清在线观看视频| 亚洲无线码一区二区三区| 国产亚洲成av人在线观看导航| 色一情一乱一乱一91av| 国模无码大尺度一区二区三区| 亚洲日本在线视频观看| 精品欧美黑人一区二区三区| 色综合色综合色综合| 精品一区二区三区影院在线午夜| 亚洲天堂2016| 国产亚洲综合在线| 91精品国产一区二区三区| 99视频超级精品| 国产一区二区久久| 奇米影视7777精品一区二区| 亚洲美女视频在线| 国产欧美一区二区三区鸳鸯浴| 7777精品久久久大香线蕉| 91在线观看地址| 成人一区二区视频| 久久66热偷产精品| 日韩中文欧美在线| 亚洲一区二区三区中文字幕在线 | 91久久香蕉国产日韩欧美9色| 国产精品1区2区3区在线观看| 日韩中文字幕亚洲一区二区va在线 | 蜜桃久久久久久久| 亚洲午夜成aⅴ人片| 亚洲色图制服诱惑| |精品福利一区二区三区| 国产精品女主播av| 国产精品青草久久| 国产日韩欧美a| 久久只精品国产| 欧美精品一区二区在线播放| 欧美一区二区三区思思人| 欧美片网站yy| 欧美日韩精品一区二区三区| 在线免费精品视频| 欧美在线观看一区二区| 色噜噜狠狠成人网p站| 色av一区二区| 在线精品视频小说1| 91成人免费电影| 欧美在线观看视频一区二区三区| 91视频.com| 色8久久精品久久久久久蜜| 日本高清不卡aⅴ免费网站| 色综合一个色综合| 欧美伊人精品成人久久综合97 | 美女视频一区二区三区| 美日韩一区二区| 日韩av电影免费观看高清完整版| 首页亚洲欧美制服丝腿| 日本人妖一区二区| 国产剧情在线观看一区二区| 成人在线视频一区二区| 99久精品国产| 欧美日韩中文一区| 日韩一区二区三区在线观看 | 成人午夜碰碰视频| 色综合欧美在线视频区| 欧美日本在线一区| 久久夜色精品一区| 国产精品国产三级国产aⅴ入口 | 国产不卡一区视频| 色综合久久久久综合体桃花网| 欧美色图第一页| 日韩欧美久久一区| 国产精品网站在线观看| 亚洲一区二三区| 国内精品自线一区二区三区视频| 国产aⅴ综合色| 欧美色涩在线第一页| 精品福利二区三区| 亚洲免费av在线| 久久97超碰国产精品超碰| 9人人澡人人爽人人精品| 欧美日韩aaaaa| 国产精品视频麻豆| 爽好久久久欧美精品| 成人福利视频网站| 欧美精品v日韩精品v韩国精品v| 久久久久国产精品麻豆ai换脸| 一区二区三区中文字幕| 国产原创一区二区| 欧美在线免费视屏| 国产欧美精品一区| 日韩成人免费电影| 99久久久久免费精品国产| 日韩精品一区二区三区四区视频| 日韩一区在线播放| 经典三级视频一区| 精品视频在线免费看| 国产欧美日韩综合| 日本欧美大码aⅴ在线播放| 99精品在线免费| 国产午夜精品美女毛片视频| 日本怡春院一区二区| 91精品福利视频| 国产精品视频免费看| 精品一区二区三区久久| 欧美三级欧美一级| 亚洲男同性恋视频| 暴力调教一区二区三区| 日韩欧美亚洲国产另类| 亚洲成人动漫av| 91在线国内视频| 国产精品色婷婷| 国产在线精品视频| 日韩欧美久久久| 日韩国产在线观看一区| 在线视频一区二区免费| 综合亚洲深深色噜噜狠狠网站| 国产一区二区三区免费看| 欧美一区二区三区四区久久| 五月婷婷综合在线| 在线视频亚洲一区| 亚洲天堂网中文字| 不卡av电影在线播放| 国产欧美一区二区三区鸳鸯浴| 久久69国产一区二区蜜臀| 欧美一区二区三区视频在线 | 欧洲一区在线观看| 中文字幕一区二区三区不卡| 国产成人aaa| 国产亚洲欧洲一区高清在线观看| 国产主播一区二区三区| 日韩精品中文字幕一区二区三区| 三级一区在线视频先锋| 欧美日韩中文字幕精品| 婷婷六月综合网| 欧美电影一区二区| 免费高清成人在线| 欧美精品一区二区三区蜜桃| 国产真实乱偷精品视频免| 久久老女人爱爱| 风间由美一区二区av101| 欧美国产乱子伦| 99精品黄色片免费大全| 亚洲黄网站在线观看| 欧美影院一区二区三区| 亚洲成av人片一区二区| 欧美一二三四区在线| 国产一区二区伦理片| 国产精品伦一区二区三级视频| 9i在线看片成人免费| 亚洲激情自拍视频| 欧美视频在线播放| 久久精品国产**网站演员| 精品国产3级a| 99久久国产综合精品女不卡| 亚洲一区二区三区精品在线| 欧美日韩精品高清| 麻豆91在线播放免费| 久久精品夜色噜噜亚洲aⅴ| 丰满亚洲少妇av| 亚洲图片欧美一区| 日韩欧美aaaaaa| 99久久综合色| 日日夜夜免费精品| 久久久久国产免费免费 | 婷婷中文字幕一区三区| 精品欧美一区二区久久| 成人一级片网址| 亚洲国产精品一区二区久久恐怖片 | 自拍偷自拍亚洲精品播放|