MT-DB-U4
User Guide
The MTDBU2 and MTDBU1 support 2 simultaneous tones using timers 1 and 0. Note that timer 0
has a lower accuracy for tone generation because it is 8bit (timers 3 and 1 are 16bit). Note also that
use of timer 0 temporarily disables the use of delay(), which will return to normal operation once the
tone stops playing. Thus, timer 0 is set with the lowest priority. For example, if generating DTMF tones
on the MTDBU4, timers 3 and 1 will be used. However, the MTDBU2 and MTDBU1 will both use
timer 0 for the second tone. If timer 0 is used, delay() should not be called while timer 0 is generating a
tone. Instead, use _delay_ms(), which is included with avrlibc.
The DTMF_Demo sketch demonstrates usage of Tone.cpp for DTMF generation.
Detailed Memory Usage Output After Compilation
In this release, two programs are run at the end of compilation to provide more detailed memory
usage. This is enabled only when verbose messages for compilation is enabled in the IDE
Preferences. Just above the normal flash usage message, is the output from the size utility. Above the
size utility output is the output from the nm utility. The values on the left are in bytes. The letters stand
for: T(t)=.text, D(d)=.data, B(b)=.bss, and everything else (ie: W) resides in flash (in most cases).
USB Technical Notes
●
Note that USB CDC is required for autoreset into the bootloader to work (otherwise,
manually press reset with jumper installed).
ATmegaxxU4: 832 bytes DPRAM, 1 (control, 64 byte max) + 1 (two banks, 256 byte max) + 5 (two
banks, 64 byte max) endpoints AT90USBxxx6/7: 832 bytes DPRAM, 1 (control, 64 byte max) + 1 (two
banks, 256 byte max) + 5 (two banks, 64 byte max) endpoints
// These are used by the core
#define USB_CONTROL_EP_SIZE 16
#define USB_CONTROL_EP_BANKS 1
#define USB_DEFAULT_EP_SIZE 64
#define USB_DEFAULT_EP_BANKS 2
#define USB_CDC_NOTIFICATION_EP_SIZE 16
#define USB_CDC_NOTIFICATION_EP_BANKS 1
#define USB_CDC_DATA_EP_SIZE 64
#define USB_CDC_DATA_EP_BANKS 2
// These can optionally be used by PluggableUSB libraries
#define USB_HID_EP_SIZE 16
#define USB_HID_EP_BANKS 1
#define USB_MIDI_EP_SIZE 64
#define USB_MIDI_EP_BANKS 2
#define USB_MSD_EP_SIZE 64
#define USB_MSD_EP_BANKS 2
AT90USBxx2: 176 bytes DPRAM, 8 64 byte endpoints, 1 (control) + 2 (one bank) + 2 (two banks)
endpoints ATmegaxxU2: 176 bytes DPRAM, 8 64 byte endpoints, 1 (control) + 2 (one bank) + 2 (two
banks) endpoints
// These are used by the core
December 30, 2015
19
http://www.mattairtech.com/