Teensy-LC Beta Testing

PaulStoffregen

Well-known member
Please use this thread for reporting successes, failures, and any patches or fixes discovered in beta testing Teensy-LC. For general discussion (anything that isn't a specific technical report or issue), please post on the main Teensy-LC announcement.

Before soldering pins or wires, please test your Teensy-LC to verify it can upload code and print to the Arduino Serial Monitor.

Often hardware product beta tests are done under nondisclosure agreements. Arduino does this for their new products. For Teensy-LC, we're trying it fully open in public view. Please use good judgement when choosing language to discuss bugs, especially issues likely to be fully resolved before we officially release Teensy-LC in March.


EDIT: Version 1.21 is officially released.


Many libraries have already been ported/patched. Please use the copies from the installers above, not copies from the website.

Here's my testing list for Teensy-LC. As more testing is done, and as anyone suggests more things in need of testing, this message will be edited to update the list.

Code:
digitalWrite                    ok
digitalRead                     ok
pinMode INPUT                   ok
pinMode INPUT_PULLUP            ok
pinMode OUTPUT                  ok
analogRead(num)                 ok
analogRead(A*)                  ok
analogRead(38) temperature      ok
analogRead(40) bandgap ref      ok
analogRead noise level            - #221
analogReference INTERNAL        ok
analogReference EXTERNAL        ok
analogReadResolution            ok
analogWrite                     ok
analogWriteResolution           ok
analogWriteFrequency            ok
analogWrite DAC                 ok
IntervalTimer                   ok
tone, noTone                    ok
delay                           ok
delayMicroseconds               ok
millis                          ok
micros                          ok
elapsedMillis                   ok
elapsedMicros                   ok
attachInterrupt                 ok
pulseIn                         ok - but requires pinMode - msg #53
shiftIn
shiftOut
Serial1                         ok
Serial2                         ok
Serial3                         ok
Serial1.transmitterEnable(pin)  ok
Serial2.transmitterEnable(pin)  ok
Serial3.transmitterEnable(pin)  ok
touchRead                       ok
DMAChannel                      ? - initial test look good - needs a lot more testing
AVR emu: PORT                   ok
AVR emu: PIN                    ok
AVR emu: DDR                    ok
AVR emu: SPI registers          quick test looks good
AVR emu: SREG
AVR emu: EIMSK
AVR eeprom_read_byte            ok  (bootloader tries not to erase the EEPROM data)
AVR eeprom_read_word                 possible issue with interrupts, msg 100-102
AVR eeprom_read_dword
AVR eeprom_read_block
AVR eeprom_write_byte           ok
AVR eeprom_write_word
AVR eeprom_write_dword
AVR eeprom_write_block
portOutputRegister
portInputRegister
portModeRegister
pgm_read_byte
pgm_read_word
pgm_read_dword                    -- see #139
random

(crash during auto-reboot)      -- #206
(pauses during upload)          -- #221

Keyboard.print                  ok
Mouse.move                      ok
usbMIDI.sendNoteOn

Serial.print (USB Serial)       ok
Serial.print (USB HID)          ok

Wire                            ok  (tested with SSD1306 display)
Wire slave mode                 ok
Wire1
i2c_t3                            -- #195, #204
SPI                             ok
SPI1                               - see #171
SPI.setCLK(14)                  fail - see #258-260
SPI.setMISO()
SPI.setMOSI()
SD                              ok - listfiles tested
Ethernet W5100 chip             ok - Webclient and UdpNtpClient tested
Ethernet W5200 chip             ok - Webclient and UdpNtpClient tested
EEPROM
Firmata                         ok - tested StandardFirmata with firmata_test, quick test only
LiquidCrystal
LiquidCrystalFast
Servo                           ok - msg #53
Encoder                         ok - TwoKnobs tested
Keypad                          ok - HelloKeypad & MultiKey tested
SoftwareSerial                  works only if pins are a hardware serial port
Stepper                         ok
PS2Keyboard                     ok
OneWire                         ok - temperature example tested
IRremote                        ok
TinyGPS                         ok - needed updated to version 13, from Mikal Hart's website
Bounce                          ok
AccelStepper
SoftPWM                         ok
ShiftPWM                        fail - doesn't compile, needs porting
Time                            looks good - still need to test GPS & NTP sync examples
TimeAlarms                      ok
Metro                           ok
TimerOne                        ok
TimerThree                      ok
FreqMeasure                     ok
FreqCount                       ok
NeoPixel                        ok
ILI9341_t3                      fail - depends on Teensy 3.x DSPI registers
OctoWS2811                      fail - requires Teensy 3.x DMA - examples use too much RAM
Audio                           fail - depends on Cortex-M4 instructions
FTOLED
Adafruit_CC3000                 ok - buildtest (with SSID+pass) tested
Adafruit_ILI9340                ok
Adafruit_ILI9341                ok
Adafruit_nRF8001
Adafruit_RA8875                 ok - ran textmode and ts_calibration
Adafruit_SSD1306 I2C 128x32     ok
Adafruit_SSD1306 I2C 128x64
Adafruit_SSD1306 SPI 128x32     ok
Adafruit_SSD1306 SPI 128x64
Adafruit_ST7735                 ok?
Adafruit_STMPE610
Adafruit_VS1053                 fail - works with 24 MHz, fails with 48 MHz
AltSoftSerial                   fail - needs timer defs
Artnet                          ok - #200
CapacitiveSensor                fail - needs I/O register defs
DmxSimple                       fail - depends on DWT timer, not present on Cortex-M0+
DogLcd                          ok
DS1307RTC                       ok
Entropy                         ok - msg #53
FastLED                           - looking good, lib updated needed in Teensyduino, #220, #212
FlexiTimer2                     ok
FrequencyTimer2                 fail - used CMT timer, not present in this chip
ks0108                          fail - this library needs C++ boolean = bool update
LedControl                      ok
LedDisplay                      fail - most works, but writeCharacters fails (also on Teensy 3.1)
MIDI
MsTimer2                        ok
NewPing
OSC
Ping                            ok
PulsePosition                   ok
PWMServo                        fail - needs timer defs
RadioHead
SPIFlash
ST7565                          ok
Tlc5940                         fail - needs defs for hardware
UTFT                            fail - needs cpu define, maybe other work?
UTouch
VirtualWire
x10
OpenGLCD                        ok
SdFat
ledRings                        ok - msg #53
FastCRC



Other stuff to investigate:

SoftPWM's SoftPWM_LEDHead_Random_Blink crashes with unsupported pins - why?  Is this simply a bug in SoftPWM?

Does SPI.transfer(buffer, size) work?  Does it achieve 100% SPI bus utilization?

IRremote gets messed up by Robot libraries - time for a patch in the java code to ignore them!
 
Last edited:
Wow, I can't believe how much stuff you've already tested!

The DAC register structure looks pretty close. Here's a self-contained proof-of-concept (virtual testing til the LC arrives) of DAC, untested but compiles

Code:
// dac hack til in core
#define VREF 3.3

#define DAC0_DAT0L      (*(volatile uint8_t  *)0x4003F000)
#define DAC0_C0         (*(volatile uint8_t  *)0x4003F021)
#define DAC_C0_DACEN            0x80   
#define DAC_C0_DACRFS           0x40 

void writeDAC0(int val)
{
	int analog_reference_internal = 0;
        uint8_t res = 12;   // analog_write_res;
        if (res < 12) {
            val <<= 12 - res;
        } else if (res > 12) {
            val >>= res - 12;
        }

    SIM_SCGC6 |= 0x80000000;
    if (analog_reference_internal) {
        DAC0_C0 = DAC_C0_DACEN;  // 1.2V ref is DACREF_1
    } else {
        DAC0_C0 = DAC_C0_DACEN | DAC_C0_DACRFS; // 3.3V VDDA is DACREF_2
    }
    if (val < 0) val = 0;  // TODO: saturate instruction?
    else if (val > 4095) val = 4095;
    *(int16_t *)&(DAC0_DAT0L) = val;
}

void setup() {
	Serial.begin(9600);
	  analogReadResolution(16);
	  analogReadAveraging(32);
}

void loop() {
  int i, sensorValue,k;
  float v;
  char str[80];

  for (i=0; i< 4096; i+=40) {
    writeDAC0(i);
    sensorValue = analogRead(A0);
    v= VREF * sensorValue/65536.;
    k = sensorValue>>4;
    sprintf(str,"%d %.3f %d %d",i,v,k,sensorValue);
    Serial.println(str);
    delay(1000);
  }
}
 
I added dummy RTC functions, since we're not supporting the useless on-chip RTC.

Time & TimeAlarms seem to work, but I only tested the "serial" examples. The NTP and GPS sync should probably still be tested.
 
I've added the definitions for DMA and the DAC.

curious why you are using volatile uint16_t * e.g.
#define DMA_SAR0 (*(volatile uint16_t *)0x40008100)

older kinetis.h entries were
#define DMA_TCD2_SADDR (*(volatile const void * volatile *)0x40009040)
 
Last edited:
curious why you are using volatile uint16_t * e.g.
#define DMA_SAR0 (*(volatile uint16_t *)0x40008100)

Opps, that was a silly mistake. Good catch, Thanks! :)

https://github.com/PaulStoffregen/cores/commit/b16bebff2e597b0a83a6c24c536268cec3a9e630

Porting the DMA stuff is probably going to be a big job. My hope is to switch most of the DMA-based libraries from writing the TCD structure to calling the hardware-neutral functions of DMAChannel.h. That's why I designed DMAChannel months ago... so when this day came, we could have a nice API that doesn't require putting hardware registers into libraries. Well, I guess I'd imagined getting OctoWS2811 and parts of Audio switched over by now, but then everything always takes much longer than anticipated!

Anyway, my plan for next week is going to be working on DMAChannel.h and Audio's ADC and DAC objects.

First, I want to get IRremote working, and take a shot at fixing the serial monitor bugs I added in 1.21-test2. It'd be really nice to get 1.21-test4 out this weekend, with all these fixes.
 
The NTP and GPS sync should probably still be tested.

I think I will be able to run NTP/GPS crystal checks this evening :D I'm assuming LC is using same crystal as other teensy's, 15 ppm NDK NX3225SA-16, and might get to the Time library as well ...
 
Last edited:
I tested many more of the library and updated the list for which work and which fail.

Re: PulsePosition fails -- locks up

looking at ref manuals, looks like to clear TPM/FTM TOF on LC, you have to write a 1. on teensy 3's, just need to read SC register.

that will be important if you use FTM for IRremote
 
Last edited:
Ok this is follow up to the github pull request which I thought would be better to be discussed here. Basically talking about the startup code and TeensyLC PLL.

Is the PLL configured and running at 16,8,4,2 MHz, I don't see in the mk20dx128.c startup code where the PLL is activated at those F_CPU's? It looks like the clocks are setup the same for the Teensy3.x and TeensyLC at those speeds. Or is this something that has not been tested yet, it seems that only 24, 48 MHz has only been tested? If not I'm willing to tackle this.
 
Or is this something that has not been tested yet, it seems that only 24, 48 MHz has only been tested? If not I'm willing to tackle this.

Exactly, only 24 & 48 MHz have been tested so far. Absolutely no work has been done with any other speed. It's be great if you could look into those. I won't be able to do much anytime soon, since I'm focused on getting functionality like IRremote and DMAChannel.h ported, and fixing bugs like the serial monitor issue.
 
teensy LC arrives. plugged it in and is happily blinking ... onward!

WARNING beta teensy LC test results 1.0.6/1.21-test3

here are some results for speedTest (teensy 3.1 3.0 LC)
https://github.com/manitou48/teensy3/blob/master/LCperf.txt
NOTE: LC does not have hardware divide

power with hacked USB cable LED off/on
LC 17.38/20.22ma @ 48mhz (hacked USB cable), 14.64/17.5 @ 24mhz (beta: bootloader at full power)
teensy 3.0 @96mhz 24.36/27.3 ma @48mhz 20.42/23.38m
teensy 3.1 @96mhz 38.1/41.1 2/4/15 @48mhz 28.35/31.29
duff's low power lib did not compile (TBD)

check LC crystal drift against NTP stratum 0 server: 13 ppm
also checked crystal with GPS pps to LC: 13ppm
also see https://github.com/manitou48/crystals/blob/master/crystals.txt

LC unconnected SPI speed (1000 byte transfer)
10mbs (megabits/sec) at default speed and transaction request of 24000000 and 12000000
3.5mbs at 4000000
(things to await/try SPI + FIFO, SPI + DMA, is SPI1 faster ?)

simple DMA sketch for memcpy32() and memset32() seemed to have worked.

FFT 1000 doubles -- not enough RAM

LC beta computational performance numbers at
https://github.com/manitou48/DUEZoo/blob/master/perf.txt
includes fibonacci, linpack(mflops), aes, md5

i was able to read teensy MAC address MAC: 04:E9:E5:00:07: D9

if I click "no scroll" on monitor window in fast scrolling data, IDE locks up-- have to ctrl-z kill it...

.... more to come
 
Last edited:
power with hacked USB cable LED off/on
LC 17.38/20.22ma @ 48mhz (hacked USB cable), 14.64/17.5 @ 24mhz
teensy 3.0 @96mhz 24.36/27.3 ma @48mhz 20.42/23.38m
teensy 3.1 @96mhz 38.1/41.1 2/4/15 @48mhz 28.35/31.29
duff's low power lib did not compile

I have hacked copy that complies but the digital pins and tsi need to be worked on but from what I've looked at so far I think going into LLS sleep (deepSleep) should be the same but I can't say for sure yet, no board until tomorrow.
 
I have hacked copy that complies but the digital pins and tsi need to be worked on but from what I've looked at so far I think going into LLS sleep (deepSleep) should be the same but I can't say for sure yet, no board until tomorrow.

duff, do you have a github site? I often worry I don't have the latest zip file ... thanks
 
I should mention some bad news on beta testing low power. The bootloader chip on these first 10 beta boards remains in full speed mode 100% of the time. I'm going to enable sleep detection, like the Mini54 does on Teensy 3.1, but that feature didn't make these first 10 beta boards.

When posting current measurements, please keep in mind we're doing this beta test in public view. Power benchmarks done now, on these 10 beta test boards, will not be representative of what people will see in the final product.
 
Back
Top