Author Topic: How should I set up an environment to learn LUFA library with an AT90USB1286?  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
I've been tinkering with microcontrollers for about a decade now and USB stacks have always been somewhat of an elusive barrier for me.  I recently discovered this library here http://www.fourwalledcubicle.com/LUFA.php and it looks absolutely amazing.  Unfortunately, it's just too damn big for me to digest.  I think i've got a good grasp on C and the basics of program design / state machines, etc, but this thing is huge!  Where do I start?  I looked at some of the examples and they are overwhelming.

I've got a book that corresponds to this library here: https://sites.google.com/site/pic24micro/Home/pic24-software-library-collection and it appears that the LUFA library was inspired by the project.  Unfortunately, it's also huge and doesn't even get into USB.  I understand all of the lessons in it though and the tutorials on peripherals are very helpful. 

Basically what I'm getting at is that I don't understand how to work with large programs.  There is a huge leap between tutorials and working with several different files with global variables, doxygen, etc.  Does anyone have suggestions that might help me overcome these hurdles? 
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
So far the easiest USB library to me is actually libusb-stm32 on a STM32F042 or STM32F103 board. (full disclosure: I am a contributor to this project.)

Most of the “blue pill” STM32 boards has a bug in their USB implementation that disallowed remuneration. You can buy one of my SushiBits One boards which is almost equivalent to a “Blue Pill” but has a proper USB circuitry if you want to. (Sorry for the plug... not quite :P)
 

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
That's not exactly easy.  I already have more proto boards than I know what to do with.  I have a 2 PIC Microsticks, a stupid Arduino, an Olimex USB-STK something, a beaglebone, a Raspberry PI, a Teensy 2.0 ++, etc.  I think I can program the Teensy with my AVR ISP MKII.  I haven't figure out what to do about the bootloader. 
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
That's not exactly easy.  I already have more proto boards than I know what to do with.  I have a 2 PIC Microsticks, a stupid Arduino, an Olimex USB-STK something, a beaglebone, a Raspberry PI, a Teensy 2.0 ++, etc.  I think I can program the Teensy with my AVR ISP MKII.  I haven't figure out what to do about the bootloader.
There is some level of boilerplate due to the sheer complexity of USB. (Was the Intel team of engineers contortionists, or was some non-technical-background management involved in the protocol design?)
 

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
That's not exactly easy.  I already have more proto boards than I know what to do with.  I have a 2 PIC Microsticks, a stupid Arduino, an Olimex USB-STK something, a beaglebone, a Raspberry PI, a Teensy 2.0 ++, etc.  I think I can program the Teensy with my AVR ISP MKII.  I haven't figure out what to do about the bootloader.
There is some level of boilerplate due to the sheer complexity of USB. (Was the Intel team of engineers contortionists, or was some non-technical-background management involved in the protocol design?)

I'm not quite sure.  On the guy's profile, he says he worked at Atmel for a year and interned there too.  A lot of people have had success with it and there is a MIDI library too. 
 

Offline DaveHardyTopic starter

  • Regular Contributor
  • *
  • Posts: 103
My objective is to send MIDI information via USB from a desktop MIDI sequencer to a HID. The HID will then interpret the MIDI information and play music. Ideally, I'd like to do this on a 5V processor around $3-$5 US without a proprietary bootloader or library.

I successfully installed the LUFA library on Atmel Studio 7 and was able to load some example programs that compile correctly, but that's about it. I purchased a USBKEY2 and couldn't get AS7 to recognize it. I'm thinking about just soldering a AT90USB1287 to a PCB and using an AVRISPMKII to program it at this point. Furthermore, assigning pin names and employing standard functions / definitions looks complicated and tedious. I really like this library though. It looks ideal if I can get it to work for me.

I purchased a PJRC Teensy 2.0++ to make things easier, but I don't like the Arduino environment. I can't use it for production stuff either because of the proprietary bootloader.

I have an Arduino Uno too. I guess I could use the Arduino bootloader, but I still don't like the environment for writing larger programs.

I purchased a Microstick II and a Microstick FV after reading the book From Assembly Langauage to C Using the PIC24 Family. I like it, but, unfortunately, the example libraries only work with the Microstick II and a narrow range of 3.3V processors.

I haven't investigated the ST microcontrollers yet, although I've heard good things in forums. I can't figure out if they have a proprietary IDE or if I have to pay for a license.

Should I look at TI?

What should my next logical step be here? Does anyone know where a good and detailed manual is for working with the LUFA library?
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
My objective is to send MIDI information via USB from a desktop MIDI sequencer to a HID. The HID will then interpret the MIDI information and play music. Ideally, I'd like to do this on a 5V processor around $3-$5 US without a proprietary bootloader or library.
If this is your use case, USB HID would be the wrong protocol to use. There is a USB audio class subprotocol that specifically transports MIDI through USB for that purpose. And that protocol has better cross platform support than HID, with Windows, Linux, macOS, Android and (this is a rare occurrence) iOS all carrying class drivers with the OS, and for iOS it does not require MFi licensing to work.

I haven't investigated the ST microcontrollers yet, although I've heard good things in forums. I can't figure out if they have a proprietary IDE or if I have to pay for a license.
ST's own preferred IDE is their Eclipse and GCC based TrueStudio which is now free. As of personally I use stock, unbranded Eclipse CDT with GNU MCU Eclipse extension and ARM-provided GCC ARM Embedded toolchain.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf