⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 求助!68013 slave fifo模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.htm

📁 关于FIFO的一些设计资料
💻 HTM
📖 第 1 页 / 共 3 页
字号:
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/edit.gif" 
            align=absMiddle></A> <!----><BR><BR><SPAN class=tpc_title>求助!68013 
            Slave FIFO模式 请大家分析一下我的代码</SPAN><BR><!----><BR><SPAN 
            class=tpc_content>我做一个USB接口用到68013的Slave FIFO 模式 
            ,可是依照开发包里和TRM中的例程却怎么也不行。我的设置是端点2 OUT BULK 1024 4buffer AUTOOUT Slave 
            FIFO ,这是我原来的TD_Init()函数<BR>TD_Init()<BR>{<BR>CPUCS = 0x10; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // CLKSPD[1:0]=10, for 48MHz 
            operation<BR><BR>IFCONFIG = 0xc3;<BR>// IFCLKSRC=1 &nbsp; , FIFOs 
            executes on internal clk source<BR>// xMHz=1 &nbsp; &nbsp; , 48MHz 
            internal clk rate<BR>// IFCLKOE=0 &nbsp; , tri state IFCLK pin 
            <BR>// IFCLKPOL=0 &nbsp; , Don't invert IFCLK pin signal from 
            internal clk<BR>// ASYNC=0 &nbsp; &nbsp; , master samples 
            synchronous<BR>// GSTATE=0 &nbsp; , Don't drive GPIF states out on 
            PORTE[2:0], debug WF<BR>// IFCFG[1:0]=11, FX2 in slave FIFO 
            mode<BR><BR><BR>SYNCDELAY; <BR>REVCTL = 0x03; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; // use enhanced packet handling<BR><BR>// EP2 1024 
            BULK OUT 4x<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>EP2CFG = 0xA8; &nbsp; &nbsp; // EP2 if DIR = out ,TYPE = BULK, 
            SIZE = 1024 ,BUF = quad<BR><BR>// EP4 EP6 EP8 are not used in this 
            implementation...<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; <BR>EP4CFG = 0x20; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            clear valid bit<BR>SYNCDELAY; <BR>EP6CFG = 0x60; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // clear valid bit<BR>SYNCDELAY; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; // <BR>EP8CFG = 0x60; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; // clear valid bit<BR><BR>SYNCDELAY; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // <BR>FIFORESET = 0x80; &nbsp; 
            &nbsp; &nbsp; &nbsp; // activate NAK-ALL to avoid race 
            conditions<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            // <BR>FIFORESET = 0x02; &nbsp; &nbsp; &nbsp; &nbsp; // reset, FIFO 
            2<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>FIFORESET = 0x04; &nbsp; &nbsp; &nbsp; &nbsp; // reset, FIFO 
            4<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>FIFORESET = 0x06; &nbsp; &nbsp; &nbsp; &nbsp; // reset, FIFO 
            6<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>FIFORESET = 0x08; &nbsp; &nbsp; &nbsp; &nbsp; // reset, FIFO 
            8<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>FIFORESET = 0x00; &nbsp; &nbsp; &nbsp; &nbsp; // deactivate 
            NAK-ALL<BR><BR>SYNCDELAY;<BR>// handle the case where we were 
            already in AUTO mode...<BR><BR>EP2FIFOCFG = 0x00; &nbsp; &nbsp; 
            &nbsp; &nbsp; // AUTOOUT=0, 
            WORDWIDE=0<BR>SYNCDELAY;<BR><BR>EP2FIFOCFG = 0x11; &nbsp; &nbsp; 
            &nbsp; &nbsp; // AUTOOUT=1, WORDWIDE=1<BR>SYNCDELAY;<BR><BR>// since 
            the defaults are four times buffered we must write dummy byte counts 
            fourth<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>OUTPKTEND = 0x82; &nbsp; &nbsp; &nbsp; &nbsp; // arm first 
            buffer<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>OUTPKTEND = 0x82; &nbsp; &nbsp; &nbsp; &nbsp; // arm second 
            buffer<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>OUTPKTEND = 0x82; &nbsp; &nbsp; &nbsp; &nbsp; // arm third 
            buffer<BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
            <BR>OUTPKTEND = 0x82; &nbsp; &nbsp; &nbsp; &nbsp; // arm fourth 
            buffer<BR><BR>IFCONFIG |= 0x20; &nbsp; &nbsp; &nbsp; &nbsp; // drive 
            IFCLK pin signal at 48MHz<BR><BR><BR>Rwuen = TRUE; &nbsp; &nbsp; 
            &nbsp; &nbsp; // Enable 
            remote-wakeup<BR>}<BR><BR>可是我发现这样不行,控制面板不能向端点2写入数据,显示“Write IOCTL 
            failed",好像没有使能arm端点,于是我将程序改写成这样<BR>TD_Init()<BR>{<BR>CPUCS = 0x10; 
            &nbsp; &nbsp; &nbsp; &nbsp; <BR><BR>IFCONFIG = 
            0xc3;<BR><BR>SYNCDELAY; <BR>REVCTL = 0x01; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; //注意,我设成自动arm 端点buffer模式<BR><BR>&nbsp; SYNCDELAY; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>EP2CFG = 0xA8; &nbsp; 
            <BR><BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>EP4CFG = 0x20; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>SYNCDELAY; 
            <BR>EP6CFG = 0x60; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>SYNCDELAY; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>EP8CFG = 0x60; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR><BR>SYNCDELAY; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; <BR>FIFORESET = 0x80; &nbsp; &nbsp; 
            &nbsp; &nbsp; <BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; <BR>FIFORESET = 0x02; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>FIFORESET = 0x04; &nbsp; &nbsp; &nbsp; &nbsp; <BR>SYNCDELAY; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>FIFORESET = 0x06; 
            &nbsp; &nbsp; &nbsp; &nbsp; <BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; <BR>FIFORESET = 0x08; &nbsp; &nbsp; &nbsp; 
            &nbsp; <BR>SYNCDELAY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR>FIFORESET = 0x00; &nbsp; &nbsp; &nbsp; &nbsp; 
            <BR><BR>SYNCDELAY;<BR><BR>EP2FIFOCFG = 0x00; &nbsp; &nbsp; &nbsp; 
            <BR>SYNCDELAY;<BR><BR>EP2FIFOCFG = 0x11; &nbsp; //自动arm端点2FIFO 
            &nbsp; &nbsp; &nbsp; <BR>SYNCDELAY;<BR>&nbsp; &nbsp; &nbsp; &nbsp; 
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>IFCONFIG 
            |= 0x20; &nbsp; &nbsp; &nbsp; &nbsp; <BR><BR>Rwuen = TRUE; &nbsp; 
            &nbsp; &nbsp; 
            <BR>}<BR><BR>这样控制面板能写了,但是我用逻辑分析仪观察,不管我发多少个数据,FLAGC管脚会周期性的出现一个低脉冲,其它时候都为高,即使是发一个数也是这样,实在不明白是为什么(我是用默认的低有效,只要控制面板向端点2写数,FLGAC就不会为低,只是周期低脉冲,我的主控制器一直在读数,而且读出的数还不对),是不是我的固件设置有问题,还是我的FPGA程序的问题(我用FPGA作为MASTER),不知道Slave 
            FIFO模式有什么需要注意的地方,是不是我有什么遗漏,急需高手指点,请大家帮帮忙,谢谢!</SPAN><BR><!----></TD></TR>
        <TR vAlign=bottom bgColor=#ffffff>
          <TD colSpan=6><!---->
            <TABLE cellSpacing=1 cellPadding=4 bgColor=#e7e3e7>
              <TBODY>
              <TR>
                <TD class=t_one><A 
                  href="http://www.zndev.com/applyadu.php">高速无限下载文件,请申请vip会员</A></TD></TR></TBODY></TABLE><!----></TD></TR>
        <TR vAlign=bottom bgColor=#ffffff>
          <TD colSpan=5><!----><FONT color=red>[楼 主]</FONT> 
            <!----><B>Posted:</B>2006-06-06 14:55|</TD>
          <TD align=right><A href="javascript:scroll(0,0)"><IMG alt=顶端 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/top.gif"></A> 
          </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE width="98%" align=center>
  <TBODY>
  <TR>
    <TD height=1></TD></TR></TBODY></TABLE><!---->
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" cellSpacing=1 
cellPadding=0 width="98%" align=center bgColor=#e7e3e7>
  <TBODY>
  <TR>
    <TD 
    style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px" 
    vAlign=top width="20%" bgColor=#ffffff height="100%"><FONT face=Gulim 
      color=#000066><B>daxiandada</B></FONT><BR>
      <TABLE cellSpacing=0 cellPadding=0 width="98%">
        <TBODY>
        <TR>
          <TD align=middle><BR><BR></TD></TR></TBODY></TABLE><BR><BR><!----><IMG 
      src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/8.gif"> 
      <BR>级别: <FONT color=#555555>驱动牛犊</FONT><BR>精华: <FONT 
      color=green><B>0</B></FONT><BR>发帖: <FONT 
      color=green><B>7</B></FONT><BR>威望: <FONT color=#984b98><B>8 
      点</B></FONT><BR>积分: <FONT color=#984b98><B>70 分</B></FONT><BR><!---->贡献值: 
      <FONT color=red><B>0 点</B></FONT><BR><!---->注册时间:2006-05-30<BR></TD>
    <TD vAlign=top width="80%" bgColor=#ffffff height="100%">
      <TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" height="100%" 
      cellSpacing=0 cellPadding=6 width="99%" align=center>
        <TBODY>
        <TR height="100%">
          <TD vAlign=top bgColor=#ffffff colSpan=6><!----><A 
            href="http://blog.zndev.com/blog.php?bbsuid=148030" 
            target=_blank><IMG alt=进入个人主页 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/homepage.gif" 
            align=absMiddle></A> <!----><A 
            href="http://bbs.zndev.com/profile.php?action=show&amp;uid=148030"><IMG 
            alt=查看作者资料 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/profile.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/message.php?action=write&amp;touid=148030"><IMG 
            alt=发送短消息 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/message.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/sendemail.php?uid=148030"><IMG alt=发送邮件 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/email.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/sendemail.php?action=tofriend&amp;tid=112251"><IMG 
            alt=推荐此帖 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/emailto.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/post.php?action=quote&amp;fid=9&amp;tid=112251&amp;pid=719840&amp;article=1"><IMG 
            alt=引用回复这个帖子 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/quote.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/post.php?action=modify&amp;fid=9&amp;tid=112251&amp;pid=719840&amp;article=1"><IMG 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/edit.gif" 
            align=absMiddle></A> <!----><BR><BR><SPAN 
class=tpc_title></SPAN><BR><!----><BR><SPAN 
            class=tpc_content>我正好也是做到这 卡住了 帮不上什么忙 有一哥们在咱前头 郁闷得要死 
没有高手啊</SPAN><BR><!----></TD></TR>
        <TR vAlign=bottom bgColor=#ffffff>
          <TD colSpan=6><!---->
            <TABLE cellSpacing=1 cellPadding=4 bgColor=#e7e3e7>
              <TBODY>
              <TR>
                <TD class=t_one><A 
                  href="http://www.zndev.com/applyadu.php">高速无限下载文件,请申请vip会员</A></TD></TR></TBODY></TABLE><!----></TD></TR>
        <TR vAlign=bottom bgColor=#ffffff>
          <TD colSpan=5><!----><FONT color=red>[1 楼]</FONT> 
            <!----><B>Posted:</B>2006-06-06 21:20|</TD>
          <TD align=right><A href="javascript:scroll(0,0)"><IMG alt=顶端 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/top.gif"></A> 
          </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE width="98%" align=center>
  <TBODY>
  <TR>
    <TD height=1></TD></TR></TBODY></TABLE><!----><A name=lastatc></A>
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" cellSpacing=1 
cellPadding=0 width="98%" align=center bgColor=#e7e3e7>
  <TBODY>
  <TR>
    <TD 
    style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px" 
    vAlign=top width="20%" bgColor=#ffffff height="100%"><FONT face=Gulim 
      color=#000066><B>seegerhelen</B></FONT><BR>
      <TABLE cellSpacing=0 cellPadding=0 width="98%">
        <TBODY>
        <TR>
          <TD align=middle><BR><BR></TD></TR></TBODY></TABLE><BR><BR><!----><IMG 
      src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/8.gif"> 
      <BR>级别: <FONT color=#555555>驱动牛犊</FONT><BR>精华: <FONT 
      color=green><B>0</B></FONT><BR>发帖: <FONT 
      color=green><B>38</B></FONT><BR>威望: <FONT color=#984b98><B>11 
      点</B></FONT><BR>积分: <FONT color=#984b98><B>79 分</B></FONT><BR><!---->贡献值: 
      <FONT color=red><B>0 点</B></FONT><BR><!---->注册时间:2004-08-12<BR></TD>
    <TD vAlign=top width="80%" bgColor=#ffffff height="100%">
      <TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" height="100%" 
      cellSpacing=0 cellPadding=6 width="99%" align=center>
        <TBODY>
        <TR height="100%">
          <TD vAlign=top bgColor=#ffffff colSpan=6><!----><A 
            href="http://blog.zndev.com/blog.php?bbsuid=89034" 
            target=_blank><IMG alt=进入个人主页 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/homepage.gif" 
            align=absMiddle></A> <!----><A 
            href="http://bbs.zndev.com/profile.php?action=show&amp;uid=89034"><IMG 
            alt=查看作者资料 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/profile.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/message.php?action=write&amp;touid=89034"><IMG 
            alt=发送短消息 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/message.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/sendemail.php?uid=89034"><IMG alt=发送邮件 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/email.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/sendemail.php?action=tofriend&amp;tid=112251"><IMG 
            alt=推荐此帖 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/emailto.gif" 
            align=absMiddle></A> <A 
            href="http://bbs.zndev.com/post.php?action=quote&amp;fid=9&amp;tid=112251&amp;pid=720175&amp;article=2"><IMG 
            alt=引用回复这个帖子 
            src="求助!68013 Slave FIFO模式 请大家分析一下我的代码 驱动程序开发网技术社区 - powered by phpwind_net.files/quote.gif" 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -