Other Software Development
(Read 1 time)
Oct 18, 2011, 11:12 pm
I've been working for a year or so now on a runtime for AVR microcontrollers, called MHVLib. It has been built in Eclipse (although I also include Makefiles so that you can work with the editor of your choice), and has been developed with code speed & compactness in mind.
For example, one of the early projects I developed using MHVLib was a BLDC controller, which I wrote in both Arduino and MHVLib. The controller took a value from a serial port, and generated a servo signal to run a BLDC helicopter motor (driving the spindle on my CNC mill
). The Arduino version took (at the time) 11,900 bytes of flash, and 500 bytes of RAM, while the MHVLib version took 5930 bytes of flash and 177 bytes of RAM, to do the same job.
The latest version of MHVLib is moving towards an event driven model, which is awesome for battery driven projects, as the microcontroller can go into a low power sleep, waking up only when there is work to be done.
Here is what we have at the moment:
Serial (both busy-waiting and asynchronous)
Analogue to digital
Gamma correction - calculate on the fly, or lookup tables (recommended)
Fast synchronous serial shifter
Software H Bridge for driving naked transistors (with PWM support)
Realtime Clock & event triggering
Debouncing (detect button presses, as well as held buttons)
Software PWM Matrix (for passive LED matrices)
HT1632 based LED matrix displays such as the Sure Electronics DE-DP105 (search for 0832 led matrix on Ebay)
HD44780 & compatible LCD character displays
Software controlled voltage regulator
Power Saving (via AVR LibC)
Voltage Regulator (buck/boost controller)
USB Keyboard emulation (via V-USB)
Documentation is also online:
For full details & to download the library, please check the project page:
Nov 09, 2011, 12:43 pm
Add VUSB console, allows text output from V-USB devices (such as the MHVBoard) over USB. Requires Paul Stoffregen's HID Listen program to receive the output.
Extended Device_TX with new methods that utilise dynamic memory: printf(), and write(Xint(8|16|32)_t). The following classes inherit from Device_TX and will be able to use the new methods:
MHV_Display* (all display classes)
MHV_HardwareSerial (serial port driver)
MHV_VusbConsole (USB console mentioned above)
MHV_VusbTypist (USB Keyboard driver with Device_TX support)