+ Post New Thread
Results 1 to 16 of 16
  1. #1
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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/pr...+&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?

  2. #2
    Super Moderator
    Points: 237,342, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,342
    Level
    100

    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.



    •   Alt3rd May 2008, 09:37

      advertising

        
       

  3. #3
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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.



  4. #4
    Super Moderator
    Points: 237,342, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,342
    Level
    100

    usb audio endpoint

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



  5. #5
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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


    1 members found this post helpful.

  6. #6
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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.



  7. #7
    Super Moderator
    Points: 237,342, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,342
    Level
    100

    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



    •   Alt6th May 2008, 20:26

      advertising

        
       

  8. #8
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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


    1 members found this post helpful.

  9. #9
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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.



  10. #10
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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


    1 members found this post helpful.

  11. #11
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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.



    •   Alt7th May 2008, 15:55

      advertising

        
       

  12. #12
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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



  13. #13
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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?



  14. #14
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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


    1 members found this post helpful.

  15. #15
    Member level 1
    Points: 1,476, Level: 8

    Join Date
    Feb 2006
    Posts
    35
    Helped
    0 / 0
    Points
    1,476
    Level
    8

    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?



  16. #16
    Newbie level 4
    Points: 917, Level: 6

    Join Date
    May 2008
    Posts
    7
    Helped
    5 / 5
    Points
    917
    Level
    6

    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 (http://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


    1 members found this post helpful.

--[[ ]]--