MCF52259 as USB device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF52259 as USB device

865 Views
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

Labels (1)
0 Kudos
Reply
1 Reply

680 Views
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 Kudos
Reply