FPGA proven, AISC proven, I2C controller core from OpenCores

http://opencores.org/project,i2c

Bit-controller

5  block

  1) capture SCL and SDA    

 -- port
scl_i : in std_logic;
sda_i : in std_logic; 5 -- architecture 7 -- block
bus_status_ctrl : block
singal cSCL, cSDA : std_logic_vector( downto ); capture_scl_sda: process(clk, nRst)
begin
if (nRst = '') then
cSCL <= "";
cSDA <= "";
elsif (clk'event and clk = '') then
if (rst = '') then
cSCL <= "";
cSDA <= "";
else
cSCL <= (cSCL() & scl_i);
cSDA <= (cSDA() & sda_i);
endif;
endif;
end process capture_scl_sda;

  2) filter SCL and SDA (glitch-free)

 1 -- port
ena : in std_logic; -- core enable signal
clk_cnt : in unsigned( downto ); -- clock prescale value 5 -- block
signal fSCL : std_logic_vector( downto ); -- filter inputs for SCL
signal fSDA : std_logic_vector( downto ); -- filter inputs for SDA
signal filter_cnt : unsigned( downto ); -- clock divider for filter filter_divider: process(clk, nRst)
begin
if (nRst = '') then
filter_cnt <= (others => '');
elsif (clk'event and clk = '') then
if ( (rst = '') or (ena = '') ) then
filter_cnt <= (others => '');
elsif (filter_cnt = ) then
filter_cnt <= clk_cnt( downto );
else
filter_cnt <= filter_cnt -;
end if;
end if;
end process filter_divider; filter_scl_sda: process(clk, nRst)
begin
if (nRst = '') then
fSCL <= (others => '');
fSDA <= (others => '');
elsif (clk'event and clk = '') then
if (rst = '') then
fSCL <= (others => '');
fSDA <= (others => '');
elsif (filter_cnt = ) then
fSCL <= (fSCL( downto ) & cSCL());
fSDA <= (fSDA( downto ) & cSDA());
end if;
end if;
end process filter_scl_sda;

  3) generate filtered SCL and SDA signals

 1 -- architecture
signal sSCL, sSDA : std_logic; -- synchronized SCL and SDA inputs
signal dSCL, dSDA : std_logic; -- delayed versions ofsSCL and sSDA 5 -- block
scl_sda: process(clk, nRst)
begin
if (nRst = '') then
sSCL <= '';
sSDA <= ''; dSCL <= '';
dSDA <= '';
elsif (clk'event and clk = '') then
if (rst = '') then
sSCL <= '';
sSDA <= ''; dSCL <= '';
dSDA <= '';
else
sSCL <= (fSCL() and fSCL()) or
(fSCL() and fSCL()) or
(fSCL() and fSCL());
sSDA <= (fSDA() and fSDA()) or
(fSDA() and fSDA()) or
(fSDA() and fSDA()); dSCL <= sSCL;
dSDA <= sSDA;
end if;
end if;
end process scl_sda;

最新文章

  1. c#反射机制
  2. 关于Oracle数据库字符集
  3. 自定义属性 view
  4. ubuntu adobe flash player 安装
  5. Windows Azure免费空间如何搭建PHP网站/数据库、域名绑定
  6. java的变量
  7. Valuable site on github
  8. Hello world,Hello 2015,Bye 2014
  9. (转)DES、RSA、MD5、SHA、随机生成加密与解密
  10. android http 通信(httpclient 实现)
  11. DbUtility-第一次接触
  12. hdu 4739 Zhuge Liang&#39;s Mines (简单dfs)
  13. Centos6.8安装zabbix-3.2.6
  14. cmd 命令大全
  15. java记事本开发
  16. Nginx配置多个基于域名的虚拟主机+实验环境搭建+测试
  17. Centos下搭建邮件服务器
  18. CSS旋转缩放
  19. FoonSunCMS-Word图片上传功能-Xproer.WordPaster
  20. 单链表Java实现

热门文章

  1. System----堡垒机
  2. 【Codeforces 118B】Caesar&#39;s Legions
  3. [bzoj2783][JLOI2012]树_树的遍历
  4. P1464 Function 洛谷
  5. Spring MVC-表单(Form)标签-错误处理(Error Handling)示例(转载实践)
  6. Notepad++支持jQuery、html5、css3
  7. DBCP数据源使用
  8. MySQL 相邻两条数据相减
  9. Color a Tree HDU - 6241
  10. Codeforces 2018-2019 ICPC, NEERC, Southern Subregional Contest