MT-DB-U4
User Guide
●
The upper end of the analog measurement range can be changed using the
analogReference() function.
●
Reset: Bring this line LOW to reset the microcontroller.
Using Arduino with MattairTech USB boards
Because of the similarities with the Arduino Leonardo, please read
http://arduino.cc/en/Guide/ArduinoLeonardo
first.
Within the Arduino IDE Tools menu, select the appropriate MattairTech board, Frequency/Voltage,
Processor, Communications setting, and COM port. There are 2 Frequency/Voltage configurations for
each board, 16MHz(5V) and 8MHz(3.3V). You may select 8MHz even if using 5V. When operating at
3.3V, you should select 8MHz. Operating at 16MHz at 3.3V is out of spec, but should work fine at
room temperatures. Be sure to select the Communications setting that matches your sketch (by
default, this is CDC_ONLY). This is important.
Note that some example sketches indicate the use of pins using the naming convention D2, D3, etc.
These are Arduino digital pins, not to be confused with port D pins. Most MattairTech USB AVR
boards are printed with both port pin names as well as sequential numbers indicating the Arduino pin
number. You may use the 'A' or 'D' prefixes, but they are simply aliased to the arduino pin number (ie:
A2 = D2 = 2).
There are several libraries included with Arduino. Some of these need simple changes to work with
MattairTech boards. Usually, only pin mappings need to be changed.
Serial Monitor
To print to the Serial Monitor over USB, use 'Serial'. Serial points to SerialUSB (Serial1 is a UART).
Unlike most Arduino boards (ie. Uno), USB AVR based boards do not automatically reset when the
serial monitor is opened. To see what your sketch outputs to the serial monitor from the beginning, the
sketch must wait for the SerialUSB port to open first. Add the following to setup():
while (!Serial) ;
Remember that if the sketch needs to run without SerialUSB connected, another approach must be
used. You can also reset the board manually with the Reset button if you wish to restart your sketch.
However, pressing the Reset button will reset the AVR chip, which in turn will reset USB
communication. This interruption means that if the serial monitor is open, it will be necessary to close
and reopen it to restart communication.
Updated Tone.cpp
Tone.cpp now supports multiple simultaneous tone generation (one tone per timer). The MTDBU6
currently supports up to 4 simultaneous tones using timers 3, 1, 2, and 0 if not using the RTC,
otherwise, timers 3, 1, and 0 are used for 3 tones. The MTDBU4 currently supports up to 3
simultaneous tones using timers 3, 1, and 0. A future release may support a fourth tone from timer 4.
December 30, 2015
18
http://www.mattairtech.com/