Group Projects
Members' Projects
MHVLib - an efficiency oriented library for AVR microcontrollers
About
Having been frustrated with many of the inefficiencies of the Arduino core libraries, we have built an alternate set with performance and size in mind. Alastair has given a talk at the Canberra Linux User Group about this library - the slides can be viewed on SlideShare.
Much of the efficiency gains comes from addressing some of the key design deficiencies of the Arduino runtime - we do not store pin/port information in tables in flash, needlessly preallocate objects nor dictate that excessively large buffers must be used. Instead, control of these are handed over to the developer at compile time. Our design philosophy is simple - whereas the Arduino trades off efficiency for ease of use, we are targetting experienced developers who want more from their systems, so we trade off ease of use for efficiency.
The libraries have been built using the Eclipse IDE, but the makefiles included in the Release directories should allow building without Eclipse. For more information on using Eclipse with AVR, please see the AVR Eclipse Plugin. There is also a good starting tutorial at Interactive Matter.
Bootloader
If an Arduino-style bootloader is required, we recommend Optiboot, which clocks at only a quarter the size of the Arduino bootloader (0.5kb vs 2kb), and a programming baud rate of 115,200bps.
If USB is more your thing, you may want to consider USBaspLoader, which clocks in at 2kb (the same size as the Arduino bootloader), and pretends to be a USBasp programmer. This uses software USB (based on the V-USB library), removing the need for a USB->serial chip, and allows you to flash your chip over USB using AVRdude.
Download
You can grab the libraries from our GIT repository at git.makehackvoid.com:
git clone http://git.makehackvoid.com/mhvlib.git
You can also grab a tarball from the attachements at the bottom of the page.
Licensing
This software is licensed under the BSD license. This means you can do what you like with it, including distributing it with your own software licensed under different terms. The only restriction is that you attibute us for our work, and reproduce our copyright:
Copyright (c) 2010, Make, Hack, Void Inc
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Make, Hack, Void nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MAKE, HACK, VOID BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Whats Implemented
- Digital I/O
- Timers
- Serial
- External Interrupts
- Servo control
- Analogue to digital
- Hardware PWM
- Software PWM Matrix (for passive LED matrices)
- Gamma correction - calculate on the fly, or lookup tables (recommended)
- Fast synchronous serial shifter (untested)
- Software H Bridge for driving naked transistors (with PWM support)
- Realtime Clock
Todo
- Optimise servo library
- Add interrupt declarations for all microcontrollers
- Input Capture for timers
- Power Saving
- A/D Triggers
- SPI
- Documentation
- Full functionality of the Arduino runtime
Changelog
13 August 2010
- Upgraded project files with the latest AVR-Eclipse, and to use MHV AVR Tools
instead of WinAVR. - __cxa_pure_virtual is not needed with GCC 4.5.1 (included with MHV AVR Tools), removed from tutorial & test programs
- Fix linker flags in tutorial and test programs to use
-Wl,--gc-sections, resulting in smaller binaries (functions that are not
called are not linked in) - New test code - exercise ringbuffer
- New functionality - Realtime clock
- New tutorials - LED Matrix & realtime clock
25 Jul 2010
Added a few simple annotated tutorials: blinking LED, blinking LED
with timer, fading LED with PWM, busy-waiting serial. Also added a
software H bridge which will manipulate naked transistors for H bridge
functionality (with PWM control).
20 June 2010
Added PWM Matrix support (typically used to drive passive LED
matrices), gamma correction routines and a fast sychronous serial
shifter (by my estimates, it should get a byte out faster than the
Arduino runtime can get it's first bit out!). The shifter is untested at
this point, so use it at your own risk.
14 June 2010
Added analogue to digital & PWM libraries. Timer entrypoints have changed, but should continue to work as long as you are using the appropriate macros.
Contributing
Send patches or suggestions to the Makers mailing list, or leave a comment.
| Attachment | Size |
|---|---|
| mhvlib-20100620.tbz | 31.22 KB |
| mhvlib-20100725.tbz | 48.6 KB |
| mhvlib-20100813.7z | 56.76 KB |
Search
Upcoming events
Recent Comments
Member Tweets
geoff_swan
7 hours 9 sec ago
—
Attempted to fix dead imac. Looks like a dead logic card perhaps. Mainboard gets power but doesn't respond to power switch. Or screwdriver.
|
brendam
8 hours 8 min ago
—
Big gum tree just fell down across the road here. Road is blocked, but luckily nothing else damaged.
|
brendam
16 hours 49 min ago
—
database is back...
|
brendam
17 hours 45 min ago
—
upgrading mysql from 5.1.40 to 5.1.50 has fixed not starting at boot, but seems to have lost my databases. oops.
|
dev_dsp
18 hours 39 min ago
—
@sabman sorry, wasn't dumping the stream and it was during the news so not likely to be downloadable. You can always email a request to JJJ.
|
dev_dsp
18 hours 54 min ago
—
The Sydney Pakistan floods @CrisisCamp got a decently long segment in the JJJ news. Said they were "hacking" on tools to help build maps!
|
dev_dsp
19 hours 10 min ago
—
finally worked out a set of values for an RC filter to get rid of the fluro tube interference on the LDR. 100uf & 100ohm for those wondering
|
brendam
19 hours 57 min ago
—
@bytetime I'm going to do some programming on my twitter archiver.
|
RobertWinkel
20 hours 12 min ago
—
s/if/of/
|
brendam
20 hours 17 min ago
—
@bytetime You are welcome to drop in, we will be here until sometime in the afternoon. Just 3 of us so far, but a few more expected.
|
- 1 of 384
- ››





