MCF52259 as USB device

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCF52259 as USB device

855 次查看
xinzhoutang
Contributor I

Hello ,

 

I am now using MCF52259 as an USB device .  It's the first time to use usb peripheral .I am a little confused about the meaning of  tok_dne bit .

 

If  this bit is set only after receiving a token packet ?

 

For example if it's an out token ,  what will happen after receiving a data packet from the host  ?  A bit will be set to indicate the receiving of a data packet ?

 

Also , if the device wants to send a status packet . What will the device do ?

 

thanks a lot .

 

tangxinzhou@gmail.com

标签 (1)
0 项奖励
回复
1 回复

670 次查看
mjbcswitzerland
Specialist V

Hi

 

The tok_dne bit means that a token has completed. Depending on whether the pipe is an IN or OUT pipe determines which direction it is, but the TX_TRANSACTION bit in the STAT register will also indicate the direction (an IN transaction will have this set to 0).

 

When the user wants to send data (or zero data) the Tx buffer descriptor needs to be set up and the OWN bt set so that the device then sends the content. Otherwise the controller handles all tokens like ACK and NAK automatically.

 

See also http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF (there is some M522XX specific stuff in the appendix).

 

Regards

 

Mark

 

 

0 项奖励
回复