stonehillzou
驱动牛犊
驱动牛犊
  • 注册日期2004-07-16
  • 最后登录2004-08-11
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:975回复:1

大家看看这个,有分!!

楼主#
更多 发布于:2004-07-26 15:53
大家好,看看这是什么问题:
1.在控制传输中,如果插上总线供电设备(如U盘,鼠标)则在setup事务中总是等不到设备返回的ACK信号,但是插上自供电设备(如IDE转USB的移动硬盘),则能返回ACK信号。
2.在一个控制传输中setup事务总是能过去,可是in事务经常出现sof消失的现象,必须总线复位才能重新出现sof。可是总线复位后需要所有过程重新开始啊。大家帮帮我,为什么in事务会消失sof。
SL811Write (CtrlReg, 0x08);
Delay_ms(10);
SL811Write (CtrlReg, 0x00);
SL811Write (CSOFcnt, 0xAE);
SL811Write(DATASet,0xE0); SL811Write(CtrlReg,0x08);    
Delay_ms(20);
SL811Write(CtrlReg,0x01);
SL811Write(EP0Status,0xd0);
SL811Write(EP0Counter,0x00);
SL811Write( EP0Control,0x01);
SL811Write( EP0Address,0x10);
Delay_ms(25);
SL811Write(IntStatus, 0xff);
SL811Write (EP0XferLen, 0x8);

for (k = 0; k < 8; k ++)
SL811Write (k + 0x10, GetDescriptor[k]);

while(1)
{
         while(1)
         {
SL811Write (EP0Control,0x07);
//Delay_100us(1);
while(SL811Read ( IntStatus )&0x01) break;
j = SL811Read ( EP0Status );
if(j & 0x01)
break;
ClearWatchDog();
}
//Delay_ms(1);
SL811Write(EP0Status,0x90);
SL811Write (EP0XferLen, 0x12);
SL811Write(EP0Counter,0x00);
SL811Write( EP0Address,0x18);
SL811Write (IntStatus, 0xff);
while(1)
{
SL811Write (EP0Control,0x03);//执行该语句后经常
                                        //出现sof消失现象
while(1)
{
i = SL811Read ( IntStatus );
if( i & 0x01 ) break;
ClearWatchDog ();
}
j = SL811Read ( EP0Status );
if ( j & 0x01 )
break;
ClearWatchDog ();
}

SL811Write (EP0Status, 0x10); // SETUP PID, EP0
SL811Write(IntStatus, 0xff);
SL811Write (EP0XferLen, 0x0);
SL811Write(EP0Counter,0x00);
SL811Write( EP0Address,0x30);
while(1)
{
SL811Write (EP0Control,0x07);
//Delay_100us(1);
while(SL811Read ( IntStatus )&0x01)
{
ClearWatchDog ();
break;
}
j = SL811Read ( EP0Status );
if(j & 0x01)
break;
          ClearWatchDog();
}
ClearWatchDog ();
if( (j & 0x01 ) )
break;
}
Darlingsusb
驱动牛犊
驱动牛犊
  • 注册日期2004-07-09
  • 最后登录2005-01-05
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2004-07-31 16:09
你的问题解决了吗!
游客

返回顶部