|
LUFAduino
Run Arduino code on a Micropendous
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. 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 DesignArduino 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. |
How to integrate LUFAduino to Arduino IDE?
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.
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).
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.
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
Hi Michel,
http://code.google.com/p/lufa-lib/source/browse/trunk/Projects/Webserver/
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
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
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?.
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