Teensy notes

From Tronche's wiki
Jump to: navigation, search

The teensy 3 is a powerful Cortex M4 (Kinetis K20) based, breadboard-friendly development board, and my board of choice when I need more power than with an Arduino-like MCU.

Using both DACs

There are two DACs on the Teensy 3.1+. We can get what pin's on what from teensyduino analog.c:

#elif defined(__MK20DX256__)
static const uint8_t channel2sc1a[] = {
        5, 14, 8, 9, 13, 12, 6, 7, 15, 4,
        0, 19, 3, 19+128, 26, 18+128, 23,
        5+192, 5+128, 4+128, 6+128, 7+128, 4+192
        channel = channel2sc1a[index];
#if defined(__MK20DX256__)
        if (channel & 0x80) goto beginADC1;

So in short, channel2sc1a is indexed by the (analog) pin number. If the number is bigger than 128, it's on the second ADC. I counted for you, these are pins A13, A15, A17, A18, A19, A20 (and A21 A22 ?). Unfortunately, the pins on the 2nd dac are located on the bottom of the board, not mapped on the through-hole pins.

Personal tools