USB Communication

Hosted forum for UMDK related questions

Moderators: BigEvilCorporation, prophet36

Post Reply
jtn0514
Interested
Posts: 17
Joined: Sat Dec 28, 2013 9:33 pm

USB Communication

Post by jtn0514 » Thu Jan 26, 2017 8:26 pm

Just curious if anyone has been able to send data outa via the high speed USB port yet. Any examples or even a hardware register list perhaps or read/write rules when accessing the USB port?

prophet36
Very interested
Posts: 234
Joined: Sat Dec 13, 2008 6:58 pm
Location: London, UK
Contact:

Re: USB Communication

Post by prophet36 » Fri Jan 27, 2017 3:43 pm

jtn0514 wrote:Just curious if anyone has been able to send data outa via the high speed USB port yet. Any examples or even a hardware register list perhaps or read/write rules when accessing the USB port?
All the MD-accessible hardware registers are described here. Architecturally, there is no way to directly send data over USB from the MD side, because USB itself is a master-initiated protocol: in order to simulate device-initiated requests, the host has to poll each device. All the existing MD<->host communication is orchestrated using a simple semaphore (this is possible because the SDRAM controller effectively makes the cart RAM dual-ported; it's accessible from the host side and from the MD side). You could do the same thing in reverse, i.e the MD writes an address and length at some agreed-upon memory location whereupon writing the length triggers a host read from the specified block of memory. The host side would need to periodically poll this agreed-upon location, waiting for these "memory transfer" commands from the MD. Does that make sense?

prophet36
Very interested
Posts: 234
Joined: Sat Dec 13, 2008 6:58 pm
Location: London, UK
Contact:

Re: USB Communication

Post by prophet36 » Fri Jan 27, 2017 4:00 pm

Ooops, sorry about the magic numbers! I should fix that. Basically,

CMD_RUNNING=0 --> MD is busy executing a command
CMD_READY=1 --> MD is ready to accept a new command
CMD_REQUEST=2 --> Host has written a new command for the MD to execute

Code: Select all

commandLoop:
	cmp.w	#2, cmdFlag		/* see if host has left us... */
	bne.s	commandLoop		/* ...a command to execute */

Post Reply