I’ve been investigating using my Minimus AVR units for a number of projects, so here is a post with how I got going using the minimus AVR unit with the Arduino IDE.

The Minimus AVR is a USB connected microcontroller, which uses the ATMEL 90USB192 microcontroller. This has 16kB of memory (I have a number of version 1’s, the new version has 32kB of memory).

They have been used by people who mod games consoles, to upload new bootloaders and things like that. They retail for around £8, which is pretty good for a USB connected microcontroller. We ordered 100 of these for Nottingham hackspace and I have had a few sitting on my desk for over a year now. It was time to do something with them…

I wanted to be able to easily upload simple code to them, even better if I could use the Arduino IDE (which I have already written quite a bit of code for). I found this google group post and followed the instructions from Spencer Owen and Joe Duckhouse (Cheers!). Edit: Also check out Spencer’s own blog post which contains all of this info. There was also a load of info from the folk at Reading Hackspace, available here.

Spencers instructions were (direct quote):

Setup
  • Download Arduino IDE 1.0.3 from arduino.cc and extract to my Documents directory
  • Download and install Teensyduino 1.11 from http://www.pjrc.com/teensy/td_download.html (pointing it at the Arduino directory when prompted)
  • Download and install FLIP 3.4.7 from http://www.atmel.com/tools/FLIP.aspx
  • Plug in a Minimus and you’ll see it’s an unrecognized device in device manager.  Update driver, pointing it at C:\Program Files (x86)\Atmel\Flip 3.4.7\usb  (and saying yes when prompted)
  • In FLIP, go to Device > Select > AT90USB162
Programming
  • In Arduino IDE, select Tools > Board >Teensy 1.0
  • Write your sketch.  I used the Blink sketch, changing it LED pin to 6 for red LED, or 5 for blue LED (note that high is off, and low is on for onboard LEDs)
  • Click upload and it will compile then pop up with the Teensy program with button to ‘open HEX file’  Click this and drag it to desktop.  Then cancel out of Teensy prog.
  • Open Flip.
  • Plug in Minimus.
  • To put Minimus in programming mode, push reset, push HWB, release reset, release HWB (sounds complicated, but just roll your finger over the buttons!)
  • Load the .hex file from desktop
  • Select communication USB [open]
  • Run the operations flow (erase, program, verify)
  • Program the device
  • Reset Minimus to put it back in to run mode
Hope this helps others 🙂
Spencer

So I followed these instructions. The first stumbling point was that Ardunio version 1.0.5 was not supported, so I used a previous version of the Arduino IDE 1.0.4, which is the latest version to be supported.

Flip (which stands for Flexible In-system Programmer) installed fine.

I found I could not connect to the Minimus when I plugged it in, but I found that I needed to select ‘Communications’ -> ‘USB’, as is mentioned later in Spencers post.

I converted the ‘Blink’ example. Following the instructions to the letter and it all worked perfectly!

Projects

There were three main projects I wanted to try:
  1. Using the minimus AVR to display numbers on my 7-segment LED display units
  2. Using the minimus AVR to read in analogue values
  3. Using the minimus AVR as a USB-Serial port

Pin-out for Minimus

I needed to know the pin-out for the minimus and how it compared with the Arduino Uno. Luckily it was already available on the Nottinghack Wiki, here.

Also here is a diagram of the pin outs (from Bob Clough).

alt

Displaying data on 7-segment LED displays

To run the 7-segement LED boards, I needed three ditigal lines. I used the example test code. I wired the 7-segment display to pins 0 (Latch) ,1 (Clock) and 4 (Data), which related to Arduino pins 0,1 and 4, which made things easy.

I wired this up and uploaded the code and presto! It worked straight away (although the video I took to prove this was lost with a broken phone…).

Minimus AVR and analogue values

One problem with the Minimus AVR is that it is only digital – it has no analogue to digital converter. I wanted to read in a temperature.

This could be done using a thermistor, but I would need an analogue input. I could use an Analogue to Digital converter, but they cost money and I did not have one to hand.

I decided to cheat slightly and use the Dallas 1-wire temperature sensors that I have been using. These are digital devices, so no analogue pin is required. I attached a DS18D20 to PB0 on the Minimus, with pins 1 and 3 grounded and data pin 2 connected for parasitic power mode using a 4.7K pull up resistor, as shown here.

The 1-wire library is available for the Teensy within the examples, so will also work with the Minimus AVR. I opened up the example: Examples -> OneWire -> DS18x20_Temperature. I changed the pin number for the one I had connected.

Uploading this it seemed to work, but I could not see to output data as it was being streamed over the serial port, which led me to

Minimus AVR to output serial data

To perform testing I wanted to be able to output data as a serial stream and monitor it using a Serial-USB converter.

The Serial.Begin() command works to send serial data down the USB port. This is not what I wanted.
I wanted data to be streamed down an external Serial Port to be read by a Serial to USB converter
Following the advice here I set up a Hardware Serial Port. This needs to be specifically se up as a Uart using HardwareSerial. Here is the basic example code:

This code worked correctly to stream “This is a test” over the hardware serial port using pins PD2 and PD3, as shown on the diagram above.

Now I had all the code in place to easily use the minimus AVR with Arduino code I have already written. This created a very cheap and easy development platform, the only issue compared to a ‘normal’ arduino is the lack of analogue inputs.

The final project was a temperature sensor which can be used to monitor the temperature of liquids, specifically the coolant water for a laser cutter. I will write that up as a specific project when I have finished the prototype.

3 responses to “Minimus AVR and Arduino IDE

  1. I’ve tried following your instructions but cannot get Teensyduino 1.11. The only available version is 1.20 which works with Arduino IDE 1.0.6

    I installed both of these but in Arduino IDE I cannot find the board Teensy 1.0 – it looks like this board selection has been removed. Do you have any new ideas on how to program the Minimus AVR? Or do you know where an older version of the Teensyduino software would be located?

    Thanks.

  2. Hi David,
    This comment on the instructable I wrote might help you:

    http://www.instructables.com/id/Using-Minimus-AVR-with-Arduino-IDE/?comments=all#CB2STXFI4SCSPAO

    Seems like you must use the older versions of Arduino IDE (like 1.0.4) and TeensyDuino (version 1.14).

    Regards,

    Matt

    Quoting David Bent:I’ve tried following your instructions but cannot get Teensyduino 1.11. The only available version is 1.20 which works with Arduino IDE 1.0.6

    I installed both of these but in Arduino IDE I cannot find the board Teensy 1.0 – it looks like this board selection has been removed. Do you have any new ideas on how to program the Minimus AVR? Or do you know where an older version of the Teensyduino software would be located?

    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *