Arduino and the Minimus32

April 25, 2020 at 12:08 pm (maker, Uncategorized) (, , )

I’ve had some Minimus boards kicking around for, well, since 2012 or so but they kind of lost their interest as I acquired more Arduino-compatible boards of other varieties.  But an application has recently come up that I thought might fit the Minimus so I brushed the dust off my pair of Minimus 32 boards and thought I’d see what the Internet thought about them today.  It turns out not very much – most of the information I found was back around the same time I was originally trying them out.  Can you still buy these?  I’m not entirely sure!

One thing I did find though was some information on a board package for the Arduino IDE, so I had a go at getting it running on my current installation (1.8.12).  Turns out it isn’t too bad these days – as usual thanks to the hard work of others.  Here is what I needed to get it up and running.

Key links:

After adding the following line to my list of board definitions in the Arduino preferences, and restarting the IDE, I was able to search for “minimus” in the board manager and install the package:

At this point I now have a “minimus32” and “minimus16” option to select as a board.

In order to use the Arduino IDE to download and run code, you’ll need to install an Arduino compatible bootloader onto your Minimus 32.

I used an USBasp programmer with the following connections:Minimus 32 Arduino ISP Programming

There was a problem invoking AVRDude however using “burn bootloader” – I got the following error:

java.io.IOException: Cannot run program "{path}/bin/avrdude": CreateProcess error=2, The system cannot find the file specified

Which turned out to be a problem in the platform.txt file which for me could be found here:

  • [USER]AppData\Local\Arduino15\packages\minimus-arduino\hardware\avr\1.0.2\platform.txt

in the section “AVR Uploader/Programmers tools” the following line was required before the tools.avrdude.cnd.path and tools.avrdude.config.path lines:

tools.avrdude.path={runtime.tools.avrdude.path}

On restarting the IDE it was now possible to burn the boot loader successfully. At this point, the Minimus 32 was recognised as a COM port looking like an Arduino Leonardo.

Note that the pin-out for the Minimus 32 is slightly different from the original board – see the diagram from https://github.com/pbrook/minimus-arduino/wiki.

I’ll describe my project in a further post, but for now, many thanks, as always, to Paul Brooks and Kimio Kasaka for putting this stuff together.

Kevin

Permalink Leave a Comment

Programming a MiniMO Synth

April 19, 2020 at 12:03 pm (computers, maker, music, Uncategorized) (, , )

I’ve been playing with a home-grown version of the MiniMO synth as the creator has very kindly put the designs out into the public domain.

But a key issue with programming the ATtiny85 devices used in the synth is incompatibility with the latest versions of the Arduino IDE and the SpenceKonde ATTiny85 core that is now easily installed within it.

Warning: The official advice is still to build using Arduino 1.5.7, so treat all this as unverified and experimental.

I did have a look at this in the past and the issue seems to be one of incompatible timers, that I’ve described before.  The MinoMO uses both timers of the ATTiny85, but by default the core assumes the use of Timer 0 overflow interrupt for the delay/millis function, but several of the programmes for the MiniMO also want to use the overflow interrupt.

Expanding on the solution described in my previous post  – if we are assuming an 8-bit timer then it will overflow at 255, so setting the compare-on-match to 255 should have the same effect, but generate the TIMER0_COMPA_vect interrupt instead (at least for the mode being used here).

However, there is one caveat to all this.  The MiniMO synth code (I’m looking at the DCO code right now) sets the following parameters for Timer 0:

  //Timer Interrupt Generation -timer 0
  TCCR0A = (1 << WGM01) | (1 << WGM00); // fast PWM
  TCCR0B = (1 << CS00);                // no prescale
  TIMSK = (1 << TOIE0);                // Enable Interrupt on overflow

As far as I can see the original use of Timer 0 in the ATTiny Core is Fast PWM but with a prescalar value of 64.  Changing it to no prescale value here means that the “tick” used for the delay and millis functions is now running 64 times faster than previously assumed.

I’m guessing the author had the same issue in the original code though (although presumably with the settings for Timer 1), as in almost all other cases he uses the library function _delay_ms() rather than the Arduino function delay() or millis() – there is one exception – a couple of functions called on power-up prior to changing the timer values, which use the Arduino delay() function.

So from what I can see for the few programmes I’ve used with the MiniMO so far, I believe this is probably the only thing that needs changing if programming your own from the latest Arduino IDE and SpenceKonde ATTiny85 Core.  At least, on manual review of the code so far, I’ve not spotted any potential issues with having delay() and millis() running too fast!  But this isn’t an extensive review, and I repeat, the official advice is still to use an older version!

I don’t have an original MiniMO to compare waveforms to see if all the timing appears correct or not, but so far, I’ve been able to calibrate the frequency of the DCO (required as my ATTiny85 had no pre-set values stored in EEPROM), change waveforms, and see all three frequency ranges.

The fuse settings I used (as detailed by the menus in the SpenceKonde Core for ATTiny85 and then set using “burn bootloader”) were:

  • 8 MHz Internal
  • B.O.D disabled
  • EEPROM not retained (removes calibration data on re-programming)
  • Timer 1 Clock = CPU
  • LTO = Enabled
  • millis = Enabled

Which translates over into the following fuse settings:

  • efuse: 0xFF
  • hfuse: 0xDF
  • lfuse: 0xE2

I’d really like to know if anyone can compare the waveforms and frequencies generated by an original MinoMO DCO with one programmed with the above to see if they are the same.  Either way, for me I have a functioning unit, programmed using a current version of the Arduino IDE and ATTiny85 support and look forward to trying some of the other programmes for it too.

Of course, a massive thanks to Jose of course for putting the designs out there for experimentation like this in the first place.

Kevin

 

Permalink Leave a Comment