sumotoy
Well-known member
Times are in microseconds
Code:T3.2@120mhz K66@180mhz NXP 3396 285 madgwick 223 7 mahony 125 3
Impressive!!!!!!!!!!!
Am I missed the trick to get the serial working at 180Mhz or have to use Serial1?
Last edited:
Times are in microseconds
Code:T3.2@120mhz K66@180mhz NXP 3396 285 madgwick 223 7 mahony 125 3
BUG
The RNG register addresses in kinetis.h did NOT work! I used the register addresses from my MBED K64F tests, and then RNG worked
these worked
#define RNG_CR (*(volatile uint32_t *)0x40029000) // RNGA Control Register
#define RNG_SR (*(volatile uint32_t *)0x40029004) // RNGA Status Register
#define RNG_ER (*(volatile uint32_t *)0x40029008) // RNGA Entropy Register
#define RNG_OR (*(volatile uint32_t *)0x4002900C) // RNGA Output Register
Are the filters using the "0x5f3759df" fast inverse square root? Maybe that speed-for-accuracy optimization can be omitted on the K66.
Computing 5000 inverse square roots using the normal sqrtf() function took 1139 microseconds.
Computing 5000 inverse square roots using the fast qsqrtf() function took 972 microseconds.
maximum absolute error with fast sqrt was: 0.000000029802322
and occurred when computing qsqrtf(13.292902946472167).
normal sqrt was 1.1718 times slower
Impressive!!!!!!!!!!!
Am I missed the trick to get the serial working at 180Mhz or have to use Serial1?
@Paul, did you test the audioshield ? Mine are all soldered to Teensys :-(
Yeah, meYes, they are Paul's version with invSqrt() and 2 iterations. somone had a benchmark comparing invSqrt and 1/sqrt, here is a run on k66 @180mhz
#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
#elif defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
#elif defined(KINETISK) // Teensy 3.0 & 3.1/2 3.4 3.5
I had that question too (with added FLASH? or RAM?). I have one here unpinned.
digitalWrite
digitalRead
pinMode INPUT
pinMode INPUT_PULLUP
pinMode OUTPUT
analogRead(num)
analogRead(A*)
analogRead(38) temperature
analogRead(40) bandgap ref
analogRead noise level
analogReference INTERNAL
analogReference EXTERNAL
analogReadResolution
analogWrite
analogWriteResolution
analogWriteFrequency
analogWrite DAC
IntervalTimer
tone, noTone
delay
delayMicroseconds
millis
micros
elapsedMillis
elapsedMicros
attachInterrupt
pulseIn
shiftIn
shiftOut
Serial1
Serial2
Serial3
Serial1.transmitterEnable(pin)
Serial2.transmitterEnable(pin)
Serial3.transmitterEnable(pin)
touchRead
DMAChannel
AVR emu: PORT
AVR emu: PIN
AVR emu: DDR
AVR emu: SPI registers
AVR emu: SREG
AVR emu: EIMSK
AVR eeprom_read_byte
AVR eeprom_read_word
AVR eeprom_read_dword
AVR eeprom_read_block
AVR eeprom_write_byte
AVR eeprom_write_word
AVR eeprom_write_dword
AVR eeprom_write_block
portOutputRegister
portInputRegister
portModeRegister
pgm_read_byte
pgm_read_word
pgm_read_dword
random
Keyboard.print
Mouse.move
usbMIDI.sendNoteOn
Serial.print (USB Serial)
Serial.print (USB HID)
Wire
Wire slave mode
Wire1
i2c_t3
SPI
SPI1
SPI.setCLK(14)
SPI.setMISO()
SPI.setMOSI()
SD
Ethernet W5100 chip
Ethernet W5200 chip
EEPROM
Firmata
LiquidCrystal
LiquidCrystalFast
Servo
Encoder
Keypad
SoftwareSerial
Stepper
PS2Keyboard
OneWire
IRremote
TinyGPS
Bounce
AccelStepper
SoftPWM
ShiftPWM
Time
TimeAlarms
Metro
TimerOne
TimerThree
FreqMeasure
FreqCount
NeoPixel
ILI9341_t3
OctoWS2811
Audio
FTOLED
Adafruit_CC3000
Adafruit_ILI9340
Adafruit_ILI9341
Adafruit_nRF8001
Adafruit_RA8875
Adafruit_SSD1306 I2C 128x32
Adafruit_SSD1306 I2C 128x64
Adafruit_SSD1306 SPI 128x32
Adafruit_SSD1306 SPI 128x64
Adafruit_ST7735
Adafruit_STMPE610
Adafruit_VS1053
AltSoftSerial
Artnet
CapacitiveSensor
DmxSimple
DogLcd
DS1307RTC
Entropy
FastLED
FlexiTimer2
FrequencyTimer2
ks0108
LedControl
LedDisplay
MIDI
MsTimer2
NewPing
OSC
Ping
PulsePosition
PWMServo
RadioHead
SPIFlash
ST7565
Tlc5940
UTFT
UTouch
VirtualWire
x10
OpenGLCD
SdFat
ledRings
FastCRC
F_CPU = 180000000 Hz
1/F_CPU = 0.0056 us
The next tests are runtime compensated for overhead
nop : 0.006 us
avr gcc I/O : 0.066 us
Arduino digitalRead : 0.084 us
Arduino digitalWrite : 0.117 us
pinMode : 0.192 us
multiply volatile byte : 0.039 us
divide volatile byte : 0.049 us
multiply volatile integer : 0.033 us
divide volatile integer : 0.039 us
multiply volatile long : 0.034 us
multiply single float : 0.044 us
divide single float : 0.109 us
multiply double float : 0.329 us
divide double float : 5.499 us
itoa() : 0.274 us
ltoa() : 1.199 us
dtostrf() : 16.949 us
random() : 0.224 us
y |= (1<<x) with volatile : 0.027 us
bitSet() with volatile : 0.028 us
analogReference() : 0.933 us
analogRead() : 7.149 us
analogWrite() PWM : 0.709 us
delay(1) : 999.999 us
Thanks, i added the shields and adaptor boards and put the list in Post #3.Not sure if this helps (taken from the LC thread https://forum.pjrc.com/threads/27689-Teensy-LC-Beta-Testing?p=63652&viewfull=1#post63652)
IRremote:
I think IRremote will work with addition of the K66 (and K64) conditionals in IRremoteInt.h probably in the zip file described in
https://www.pjrc.com/teensy/td_libs_IRremote.html
but Paul also has an out-of-date? repository at https://github.com/PaulStoffregen/Arduino-IRremote
and then there is the master repository https://github.com/z3t0/Arduino-IRremote
@Ben : your list of things to test includes Serial1 ... Serial3, but this device also includes Serial4 and Serial5 (?) At least, the TX/RX pins for 5 serial ports are listed on the pinout.
Fyi - I have started to hack up the Core3 files to try to add these two usarts...@Ben : your list of things to test includes Serial1 ... Serial3, but this device also includes Serial4 and Serial5 (?) At least, the TX/RX pins for 5 serial ports are listed on the pinout.
Never mind'ish, I see the "ugly hack" in analog.c
Code:#if defined(__MK64FX512__) || defined(__MK66FX1M0__) // ugly hack for now... #define __MK20DX256__ #endif
Though K66/K64 don't have VREFOUT, but have bandgap on AD27 and need to set PMC_REGSC[BGBE] like LC
EDIT: I was wrong, K66 does have VREF output, ADC1/AD18, just like teensy 3
void setup() {
// put your setup code here, to run once:
delay(1000);
Serial.begin(115200);
delay(1000);
Serial3.begin(115200);
Serial4.begin(115200);
Serial5.begin(115200);
pinMode(13, OUTPUT);
delay(1000);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
Serial.println("Printing to Serial3");
Serial3.println("Hello World 3");
Serial.println("Printing to Serial4");
Serial4.println("Hello World 4");
Serial.println("Printing to Serial5");
Serial5.println("Hello World 5");
digitalWrite(13, LOW);
delay(500);
}