How should I set up an environment to learn LUFA library with an AT90USB1286? - Page 1
Forum section: electronics / general

author: DaveHardy
author_rank: Regular Contributor
timestamp: October 11, 2018, 12:29:32 am
content: 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 herehttp://www.fourwalledcubicle.com/LUFA.phpand 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-collectionand 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?

author: technix
author_rank: Super Contributor
timestamp: October 11, 2018, 02:21:40 pm
content: So far the easiest USB library to me is actuallylibusb-stm32on 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 mySushiBits Oneboards which is almost equivalent to a “Blue Pill” but has a proper USB circuitry if you want to. (Sorry for the plug... not quite)

author: DaveHardy
author_rank: Regular Contributor
timestamp: October 11, 2018, 07:24:01 pm
content: 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.

author: technix
author_rank: Super Contributor
timestamp: October 12, 2018, 07:41:34 am
content: Quote from: DaveHardy on October 11, 2018, 07:24:01 pmThere 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?)

author: DaveHardy
author_rank: Regular Contributor
timestamp: October 24, 2018, 07:20:19 pm
content: Quote from: technix on October 12, 2018, 07:41:34 amI'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.

author: DaveHardy
author_rank: Regular Contributor
timestamp: October 24, 2018, 07:28:09 pm
content: 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?

author: technix
author_rank: Super Contributor
timestamp: October 25, 2018, 02:43:24 am
content: Quote from: DaveHardy on October 24, 2018, 07:28:09 pmIf 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.Quote from: DaveHardy on October 24, 2018, 07:28:09 pmST'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.