My favorites | Sign in
Project Home Downloads Wiki Source
Search
for
LUFAduino  
Run Arduino code on a Micropendous
Updated Feb 12, 2012 by opend...@gmail.com

The latest version of this firmware is available in the latest Micropendous Distribution or via SVN in the /Micropendous/Firmware/LUFAduino directory.

Purpose: Arduino is a popular physical computing platform with a C/C++-based API that simplifies programming of microcontrollers. LUFAduino combines the LUFA USB library, the Arduino library, and the preemptive FreeRTOS kernel to enable programming Micropendous boards in Arduino code. All USB functionality is hidden and USB Virtual Serial behaves like standard Serial on an Arduino board. The preemptive FreeRTOS kernel allows the use of delays without interfering with USB functionality. It also allows for multiple loop()s and multitasking.

Source Code: View or Download

Targets: Micropendous2, Micropendous3, or Micropendous4, or other USB AVR boards with more than 2kbytes of SRAM.

USB Mode: Device-mode enumerating as USB Virtual Serial

Status: Under Development. Serial, pin definitions, digitalIn/Out, and analogOut are functional. Please help out by posting any problems you encounter to the Micropendous Group.

Usage

There is a short video of LUFAduino in action on YouTube.

Assuming you have completed all setup tasks in the QuickStart tutorial, simply compile and upload the LUFAduino firmware onto your Micropendous using the process found in ProgramAndTest.

Note: run make, then make flip (Windows) or make dfu (Linux) to compile and load this firmware onto your Micropendous board. Need to run make twice.

make
make flip

LUFAduino-programmed devices will enumerate as a Virtual Serial Port and any data sent to the device will be echoed back. Pin 0 (PD0) will flash a LED connected to GND (remember to use a resistor or your LED may burn out).

Firmware Design

Arduino loop() and setup() functions are in Sketch.cxx. Simply edit this file with your custom code using any code editor. Under Windows, Programmers Notepad comes with WinAVR and is very useful. See SettingUpProgrammersNotepad for setup instructions.

loop() - sends any data received over the USB Virtual Serial connection back to the host.

taskLoop(loop2) - is a second loop created using duinOS syntax which flashes a LED connected to Pin 5 (PD0) using analogOut().

Simply edit either or both of the loop()s for your project.

For detailed firmware design, see USBVirtualSerial_FreeRTOS for details of how FreeRTOS was added and USBVirtualSerial for details about LUFA USB.

Comment by m...@b2emotion.com, Dec 18, 2010

How to integrate LUFAduino to Arduino IDE?

Comment by project member opendous...@gmail.com, Dec 18, 2010

I intend to integrate LUFAduino into Arduino once the code is more mature. Right now it is still being debugged. Please use your favourite programmer's editor and compile and load using a Command Prompt/Terminal. Same as your would for other Micropendous firmware demos.

What particular functionality does your code rely on? Please let me know of any problems you encounter.

Comment by m...@b2emotion.com, Dec 19, 2010

Most PCs today have not serial port RS-232, so I'm just loking for cheap replace serial RS-232 by USB communication (USBVirtualSerial may be enough ..) in hobby segment without using special translators (FTDI,2nd Atmega8 etc).

Comment by project member opendous...@gmail.com, Dec 19, 2010

For basic USB to Serial the AT90USB162 is the cheapest way to go. It is available as a 0.8mm pitch TQFP and easily DIY'able. Check out the www.Micropendous.org/Micropendous162 which is designed for DIY.

The AT90USB162 is pin-compatible with the the ATmega32U2 for which you can get cheap development boards through eBay: http://cgi.ebay.com/NooGroove-USB-Board-ATMEGA32-AT90USB162-AVR-Stick-DFU-/150529511094

If you require something that is Arduino-compatible then look into the ATmega32U4. The AT90USB1287 is aimed at hosting USB devices.

Comment by mich...@gmail.com, Dec 2, 2011

Hello, I would like to integrate TCP/IP stack into LUFAduino for using Wifi of 3G USB sticks. For that purpose, uIP (renamed Contiki: www.contiki-os.org/) is a good candidate since it is designed for small 8-bit micro-controllers. Did someone tried and succeed to integrate uIP?

Thank you, Michel

Comment by project member opendous...@gmail.com, Dec 2, 2011

Hi Michel,

Yes, Dean Camera (LUFA's author) integrated uIP into his Webserver project which plugs into a RNDIS device (USB port of a DSL or Cable modem) and serves webpages:

http://code.google.com/p/lufa-lib/source/browse/trunk/Projects/Webserver/

As long as you keep throughput expectations low it may be possible to do what you suggest.
Comment by mich...@gmail.com, Dec 2, 2011

Thank you for your quick response! I'll learn many things from this example.

My question was also related to the integration level of uIP to LUFAduino. For example the author of uIP propose a little BSD-like socket interface, on top of uIP, named Protosockets that uses Protothreads. Protothreads is a small lib implementing scheduled multitasking. Obviously, Protothreads overlap with FreeRTOS and Protosockets have to be written on top of FreeRTOS tasks. Did someone already made this kind of integration?

Regards, Michel

Comment by mich...@gmail.com, Dec 3, 2011

Hello again,

I got some responses from FreeRTOS discussions:http://permalink.gmane.org/gmane.network.uip.user/1649

Finally the protothread library does not interfere with FreeRTOS kernel since protothreads run inside a task. There are some uIP demos in the FreeRTOS download already, some that use protothreads and some that don't.

Regards, Michel

Comment by project member opendous...@gmail.com, Dec 3, 2011

I am not aware of any protothread integration on an AVR.

>integration level of uIP to LUFAduino

LUFAduino does not integrate uIP, LUFAduino only integrates LUFA+FreeRTOS+Arduino_Core?.

Comment by project member opendous...@gmail.com, Dec 3, 2011

I should note that this isn't the best forum to inquire about Micropendous or LUFA as I am the only person who gets copies of comments.

Try the LUFA and/or Micropendous Support Lists for a bigger audience: http://groups.google.com/group/lufa-support http://groups.google.com/group/Micropendous


Sign in to add a comment
Powered by Google Project Hosting