Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AT90USB Isochronous endpoints

Status
Not open for further replies.

behranghm

Member level 1
Joined
Feb 12, 2006
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,626
at90usb example

Does anyone know of any demo or usb library in which AT90USB1286/7 have been configured with Isochronous endpoints? I have used these 2 libraries so far :
1)http://www.fourwalledcubicle.com/wiki/Wikka/MyUSB
2)http://www.atmel.com/dyn/products/p...family_name=AVR%AE+8%2DBit+RISC+&part_id=3874

I think the USB library provided in the first link is better than what the Atmel has provided. The point is that I have seen numerous examples in which the device is configured for BULK or Interrupt endpoints. But Isochronous is a tricky issue, because no usb device driver should request isochronous interface in its default configuration, i.e. the device should have at least two interfaces to be able to use isochronous bandwidth. Any clue? how about drivers for such an application?
 

at90usb library

The assumption, that MyUSB lib is better than AVR lib, has to be proved with a real design, I think. Better documentation or more user friendly handling would be already great. It has been said, that the AVR USB programming examples are a better reference than the AT90USB handbooks because of some hard to understand or possibly incorrect information.

None of the two, however, has isochronous examples. I wonder, if Windows has generic class drivers in isochronous mode, but I wasn't aware of it yet. At least, WINDDK has an isousb driver example.
 

isochronous feedback problem

I really didn’t mean to insist that MyUsb library is better than Atmel’s USB libraries for AT90USB devices, what seemed to me was that more convenient high level functions are available in this library and USB low level task is almost completely hidden looking from the application. In one instance though I tested the MyUsb USBtoSerial Demo against the Atmel’s similar demo. I connected the UART TX and RX lines of the microcontroller with a jumper and surprisingly enough I noticed that Atmel’s demo was missing some of the characters (I monitored the events with USB monitor application). But again I don’t really insist on that because I tested the library no more than once and I had no driver other than a simple .inf file which turned the USB device into a VCP.
 

usb audio endpoint

I regard your results as a hint, that MyUSB actually could be better.
 

at90usb driver

Hi guys,

I'm Dean Camera, the programmer behind MyUSB - just thought I'd drop in and help out.

I really didn’t mean to insist that MyUsb library is better than Atmel’s USB libraries for AT90USB devices

I do! But of course, I'm biased.

None of the two, however, has isochronous examples.

The MyUSB library does indeed have Isochronous demos. Take a look at the "AudioOutput" demo which is included with the library, it uses isochronous endpoints to transfer audio data from the host PC to output onto the board LEDs or an attached speaker.

You'll notice that the audio demos have two identical interfaces with alternate setting numbers. By default the normal endpoint-less interface is selected, to prevent bandwidth usage. Once the host send the control request to switch over to the alternate setting, the interface with the isochronous endpoint is activated and the data flows.


The assumption, that MyUSB lib is better than AVR lib, has to be proved with a real design

I'd like your (and others) opinions on the library if you're willing to give it, especially parts which you think need to be changed, or any parts you think are missing. The goal is to make a robust, feature rich and user friendly library, and I can't do the latter without user feedback.


Cheers!
- Dean
 

    behranghm

    Points: 2
    Helpful Answer Positive Rating
at90usb

Hi Dean Camera
First of all I should say I am very happy that you exist. As far as user friendliness, it’s marvelous.
I figured out about the Isochrones demo in your superb USB library right after I had left my comments saying you had not provided any such example in your library. It’s the most delicious piece of code I’ve seen in a while. About Isochrones, can you give us any hints as to what we should do on the PC side to acquire direct access to the device? Any DLLs? Can you tell us what we should do so that the device wouldn’t enumerate as an Audio class device? And about bootloader you have provided, it works perfectly well with hardware manipulation, but how should it be if we want the bootloader to be lunched totally by software through the USB? Many thanks again.
 

isochronous feedback endpoint

I apologize for taking only a short look at MyUSB and not noticing the audio example. Thank you for the profound work.

Frank
 

at90usb usb audio

I apologize for taking only a short look at MyUSB and not noticing the audio example. Thank you for the profound work.

No problem.

First of all I should say I am very happy that you exist.

I'm happy I exist too! I can't think what I'd do each day if I didn't ;).

About Isochrones, can you give us any hints as to what we should do on the PC side to acquire direct access to the device? Any DLLs?

I've not experimented with making my own drivers yet, I've only used the OS's built in drivers. Some classes, such as the HID class which mice and keyboards use, have special APIs in the OS so that arbitrary data can be sent and received from the device, rather than going through the OS's standard paths. Since you'll need to use a non-standard class other than the Audio Class, the OS won't be able to provide a driver, nor give a direct API.

I suggest looking into the "libUSB" project, which can make drivers for USB devices in Linux and Windows. LibUSB drivers can expose direct USB access to the endpoints.

Can you tell us what we should do so that the device wouldn’t enumerate as an Audio class device?

Change the interface class/subclass/protocol values in the descriptors. The descriptors tell the PC what the device is and what it can do -- by changing the interface values from their current values (which indicate a USB Audio Class device) to other values, you prevent the OS from enumerating the device with the OS's audio drivers. Using the vendor-specific class code (0xFF) will prevent it from trying anything altogether, and require you to supply your own driver.

And about bootloader you have provided, it works perfectly well with hardware manipulation, but how should it be if we want the bootloader to be lunched totally by software through the USB?

Jump to it. Once you've found the address of the start of the bootloader (check in your AVRs datasheet) you can just jump to it via a function pointer:

Code:
void (*BootLoaderStart)(void) = <Address of Bootloader>;
BootLoaderStart();

Which will jump the bootloader and run it.

- Dean
 

    behranghm

    Points: 2
    Helpful Answer Positive Rating
windows class driver which supports isochronous

tha's nice Dean, thanks again, just like what you had said, I tried jumping to the start of the bootloader from one of the demos you have provided to us (I tried almost all the fuse settings of BOOTSZ with a verity of start addresses for thebootloader). It hasn’t worked yet, I don’t know where else to check.
About PC driver, I tried Windriver DriverWizard version 9.01, it identifies many of the USB classes and I think I managed to make a driver for your Isochrones demo.
 

at90usb wrong bootloader start address

I tried jumping to the start of the bootloader from one of the demos you have provided to us (I tried almost all the fuse settings of BOOTSZ with a verity of start addresses for thebootloader). It hasn’t worked yet, I don’t know where else to check.

What board are you using? How does it fail, does the bootloader start but fail to enumerate, or does it just not start at all?

I suspect you are giving it a byte address rather than a word address for the bootloader, or the other way around, so its jumping to the wrong address.

- Dean
 

    behranghm

    Points: 2
    Helpful Answer Positive Rating
at90usb +examples

Hi,
for now It’s almost the STK525 I am using (something similar to that though because I have made the PCB myself and I’m using an At90UsB1286 with QFN package).
Now you are quite right about the wrong jump to the address, because the bootloader could be launched correctly by hardware (holding HWB and RESET and so on), But as I try to invoke the bootloader in software, the application (on the device) just hangs and the bootloader does not initiate at all. Apparently there is something wrong with the way I am trying to jump to the bootloader. For a while I was thinking maybe interrupts should be disabled prior to this jump but that doesn’t seem to be true.
Now I’ve been looking at this AudioOutput demo of yours for hours now. This code is so neat and clean I regret why it’s unidirectional! I was trying to find a way to add an input Isochrones endpoint to it but I haven’t managed to do so. Could it be done in the current interface? Or is another interface needed? Aren’t you planning to add any such thing to your library any time soon? Many thanks anyways.
 

c source code usb isochronous examples

You did take a look at the matching AudioInput demo? That shows Isochronous data flowing in the other direction. Admittedly there are a few bugs in the released version which causes it to fail, but the theory is sound.

- Dean
 

alternate setting isochronous endpoint

It’s been a while I have been trying to make a bidirectional isochronous device, I manipulated the the descriptors and part of the main application (AudioOutput) to make a second isochrones pipe (IN direction). Then I made some drivers with Windriver version 9 (it identifies almost all usb classes and endpoints) there seems to be nothing wrong with the driver I mean. Now I can send data in both directions, but there is an odd problem, the IN pipe should be kept active all the time (I have to send some dummy data on the bus all the time) . what’s the problem? Where should I be checking? Is there anything wrong with the descriptors?

Added after 4 hours 4 minutes:

could the Isochrones endpoints be in the same interface? Is there any conflict in this? or should I define an interface for each of them?
 

at90usb usb bootloader source

Isochronous endpoints are designed for time-critical, but not integrity critical data. That is, you should use them for real time streaming data (like audio or video) where it is important to minimise the latency of the transmission, but errors in the transmission shouldn't cause the packet to be re-sent.

As such, you shouldn't use Isochronous endpoints for data that should arrive intact under all circumstances. The appropriate endpoint type for integrity-critical data is BULK type endpoints.

Isochronous endpoints should always have data being loaded into them, or you'll have problems. The correct way to turn an Isochronous endpoint on or off is to have an interface with an alternative setting (one of which has no endpoints, the other which has the isochronous endpoint) so that the host can issue control requests to switch between the alt settings to enable or disable the isochronous pipe.

- Dean
 

    behranghm

    Points: 2
    Helpful Answer Positive Rating
isochronous endpoint settings

this could be a bad question, but what are these unhooked events which are reported by the compiler? How could they be hooked? Is it easy? I was thinking of a way to put the microcontroller into power down mode, i.e. to kill the oscillator by some command from the PC, is it possible? And if it’s possible, could the microcontroller be brought back to USB action through some usb command (I mean some USB busactivity)? Does it have anything to do with remote wakeup capability?
 

usb audio class isochronous end point wiki

this could be a bad question, but what are these unhooked events which are reported by the compiler? How could they be hooked? Is it easy? I was thinking of a way to put the microcontroller into power down mode, i.e. to kill the oscillator by some command from the PC, is it possible? And if it’s possible, could the microcontroller be brought back to USB action through some usb command (I mean some USB busactivity)? Does it have anything to do with remote wakeup capability?

Sorry for the delay - I don't check this thread often. You can email me directly for faster replies: dean at fourwalledcubicle dot com.

MyUSB provides a special "event" system, so that the library can indicate to the user application when a certain action has occurred so that the user application can take some action. Events are optional, if you do not write handlers for them they are left unhooked, and do nothing when fired.

You can see many examples of the event hooking in the demo applications. The file header contains a HANDLES_EVENT(x), where "x" is the name of the event to hook, and the file C source contains the corresponding EVENT_HANDER(x) handler code.

Events fire for conditions such as USB bus suspension/wake up by the host, attachment and removal from the USB bus, etc.


I've just released the much improved 1.5.0 BETA version of the library at the project homepage (https://www.fourwalledcubicle.com/MyUSB.php) which now has accompanying DoxyGen documentation in online and downloadable form. That has more information on the events API.

EDIT: The host will automatically suspend and resume devices as it sees fit. You can hook the suspended event to put the AVR into sleep, and I believe the wakeup event should cause the USB controller to bring the AVR out of sleep when required.

The Remote Wakeup API is so that a suspended device can request that the host bring the device out of suspended mode prematurely (for example, a mouse would implement it so that moving the mouse while it is suspended would wake up the mouse and the computer as required) rather than waiting for a wake up event from the host.

- Dean
 

    behranghm

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top