I want to send raw data out of the usb interface in the mk20dx128 that does not necessarily correspond to any usb message; just raw bytes for testing. Is that possible, in anyones experience here? If so, does anyone have simple code examples of doing so?
Please take a look at chapter 4 (key concepts) and the first half of chapter 5 (data flow model), and maybe chapter 8 (protocol). This may not answer all your questions, but it should at least give you a good idea of the actual protocol used. The info in chapter 4 and the first bit of chapter 5 will give you the most important concepts and terminology, which are needed to talk meaningfully about doing custom USB stuff.
Thanks Paul, totally understand that the upper protocol layers will not allow that to happen with regard to properly communication with anything. What I was asking (poorly) was if there was a possible way to simply cause transmission of a packet out of the transceiver without expectation of proper link-layer, protocol behaviour. I guess an analogous question would be, could I set up ethernet registers to send data without having the full tcp-ip stack working for this particular chip? I may be wrong, but it would seem like a bad hardware design to not be able to test the phy layer independent of the higher-level stack. It seems like I should be able to configure the proper clocks, set up a buffer and BDT, and hand it over to the DMA engine in the USB module. At the lowest level, how could the hardware possibly know anything other than an address, how much data to send, and who has ownership of the descriptor?