PDA

View Full Version : Teensyduino 1.49 Beta #4



Paul
12-27-2019, 01:41 PM
Teensyduino 1.49 Beta #4

Here is a fourth beta test for Teensyduino 1.49.



EDIT: links removed, please use 1.49-beta5 (https://forum.pjrc.com/threads/59030-Teensyduino-1-49-Beta-5)



Changes since Teensyduino 1.49-beta3 (https://forum.pjrc.com/threads/58707-Teensyduino-1-49-Beta-3)

Audio fix simultaneous input & output on I2S2
Audio allow larger queue & delay effect on Teensy 4.0
FastLED updated to allow WS2812Serial driver on Teensy 4.0 (KurtE)
PulsePosition support for Teensy 4.0 (mjs513)
TimerOne & TimerThree updates & fixes for Teensy 4.0 timers
Update ADC library (pedvide)
Update RA8875 for Teensy 4.0 (mjs513)
Add QuadTimer library (mjs513)
Add FlexCAN_T4 (tonton81)
Add ILI9488_t3 (mjs513)
Port ssd1351 to Teensy 4.0 (KurtE)
Port SoftPWM to Teensy 4.0
Add ADC_ETC definitions to imxrt.h (KurtE)
Adjust Wire library pin drive strenth on Teensy 4.0
Optimize Ethernet CS on Teensy 4.0 (Remo Jongeneelen)
Include stdbool.h - needed by Temboo library
Fix micros() non-monotonic output on Teensy 4.0 with slow CPU speeds
Optimize micros() on Teensy 4.0
ST7735_t3 & WS2812Serial minor cleanup

mjs513
12-27-2019, 02:23 PM
@Paul

Loaded up Beta4 with no problem on my Win10x64 Home Edition PC.

Did some quick tests with the BNO080 and getting the sketches to run properly without hanging is a little flaky. Let me explain since it seems to be sketch dependent:
Example15-RawReadings: ran on first upload
Example4-Magnetometer: hung on first load but ran when after I hit the program button again
Example1-RotationVector: hung when I first did it and wouldn't start up no matter what, but since I as I am writing this and retesting the sketches in this order it ran after I loaded the previous 2 examples.
Example10-PrintPacket: hung on first load, hit pgm again and still hung. I then removed the USB Cable, let sit a minute powered off, and replugged usb back into PC still hung, but then I hit the reset button and it started working
Example13-Timestamp: hung on load and had to power off and on, then it ran

Ok that's about it for now. Have Dr's appointment so will play more later

KurtE
12-27-2019, 03:52 PM
@Paul @mjs513 - Installed Win10 64 bit, Arduino 1.8.10...


BNO080 testing. Using Sparkfun sensor connected to my FRDM T4 castellated test board, with sensor connected using QWIIC connector:
18556

Pardon the messy desk.

BNO080 - Example 15 Ran no problem.

Then tried Example 1 and it uploaded and ran twice...


BNO080 Read Example

Rotation vector enabled

Output in form i, j, k, real, accuracy

0.00,0.00,0.00,0.00,0.00,

0.00,0.00,0.00,0.00,0.00,

-0.13,0.15,-0.47,0.86,0.79,

-0.13,0.15,-0.47,0.86,0.79,

-0.13,0.15,-0.47,0.86,0.79,

-0.13,0.15,-0.47,0.86,0.79,
...

Example 2 hangs... All it outputs is:

BNO080 Read Example


Now to debug some... First a few more debug messages to see where it is not returning from...

UPDATE:

Note: It hangs in the IMU.begin.

void setup()
{
while (!Serial && millis() < 5000) ;
Serial.begin(9600);
Serial.println();
Serial.println("BNO080 Read Example");

Wire.begin();

myIMU.begin();
Serial.println("BNO080 After myIMU.begin"); Serial.flush();

Wire.setClock(400000); //Increase I2C data rate to 400kHz

myIMU.enableAccelerometer(50); //Send data update every 50ms

Serial.println(F("Accelerometer enabled"));
Serial.println(F("Output in form x, y, z, in m/s^2"));
}
EDIT: However if I power it off and then back on, it runs this example

KurtE
12-27-2019, 04:55 PM
Update: Again it appears to be a startup/reset type issue, with Wire and/or BNO080...

Example I ran a couple of tests again and then tried to reprogram again with Example 2 and it hung...

Logic analyzer capture showed:
Setup to write 96 ACK,
Writes: 0x5 0x00 0x01 0x00 0x01 <All with ACKs returned>
a 50ms delay
Setup to read 97 Ack:
0x13, 0x00, 0x03 0xdf - Ack's on first 3 nack on last.

Then a Read 0x97 <NAK> and that was the final thing that happened...

Which by sources gets us to BNO080::softReset

void BNO080::softReset(void)
{
shtpData[0] = 1; //Reset

//Attempt to start communication with sensor
sendPacket(CHANNEL_EXECUTABLE, 1); //Transmit packet on channel 1, 1 byte

//Read all incoming data and flush it
delay(50);
while (receivePacket() == true)
;
delay(50);
while (receivePacket() == true)
;
}

First sendPacket is the reset command.
Which is:

05 packet length low
00 packet lenth high
01 Channel 1
00 Sequence number
01 Reset command



We are hanging in the receivePacket loop. Which (removed the SPI stuff for message)

boolean BNO080::receivePacket(void)
{
{
_i2cPort->requestFrom((uint8_t)_deviceAddress, (uint8_t)4); //Ask for four bytes to find out how much data we need to read
if (waitForI2C() == false)
return (false); //Error

//Get the first four bytes, aka the packet header
uint8_t packetLSB = _i2cPort->read();
uint8_t packetMSB = _i2cPort->read();
uint8_t channelNumber = _i2cPort->read();
uint8_t sequenceNumber = _i2cPort->read(); //Not sure if we need to store this or not

//Store the header info.
shtpHeader[0] = packetLSB;
shtpHeader[1] = packetMSB;
shtpHeader[2] = channelNumber;
shtpHeader[3] = sequenceNumber;

//Calculate the number of data bytes in this packet
int16_t dataLength = ((uint16_t)packetMSB << 8 | packetLSB);
dataLength &= ~(1 << 15); //Clear the MSbit.
//This bit indicates if this package is a continuation of the last. Ignore it for now.
//TODO catch this as an error and exit
if (dataLength == 0)
{
//Packet is empty
return (false); //All done
}
dataLength -= 4; //Remove the header bytes from the data count

getData(dataLength);
}

return (true); //We're done!
}

So it is asking Wire for 4 bytes, and received: 0x13, 0x00, 0x03 0xdf

Data length is: 0x0013 or 19 bytes. We then call getData...


boolean BNO080::getData(uint16_t bytesRemaining)
{
uint16_t dataSpot = 0; //Start at the beginning of shtpData array

//Setup a series of chunked 32 byte reads
while (bytesRemaining > 0)
{
uint16_t numberOfBytesToRead = bytesRemaining;
if (numberOfBytesToRead > (I2C_BUFFER_LENGTH - 4))
numberOfBytesToRead = (I2C_BUFFER_LENGTH - 4);

_i2cPort->requestFrom((uint8_t)_deviceAddress, (uint8_t)(numberOfBytesToRead + 4));
if (waitForI2C() == false)
return (0); //Error

//The first four bytes are header bytes and are throw away
_i2cPort->read();
_i2cPort->read();
_i2cPort->read();
_i2cPort->read();

for (uint8_t x = 0; x < numberOfBytesToRead; x++)
{
uint8_t incoming = _i2cPort->read();
if (dataSpot < MAX_PACKET_SIZE)
{
shtpData[dataSpot++] = incoming; //Store data into the shtpData array
}
else
{
//Do nothing with the data
}
}

bytesRemaining -= numberOfBytesToRead;
}
return (true); //Done!
}

And we get a NAK and then do recover... Now to debug what happens in getData...

Should we continue on this thread or back to another BNO specific one?

EDIT: my guess is more work needed in: requestFrom function...

Like probably needing to handle NAK, plus I saw it hang with SCL HIGH and SDA LOW and just sit there...

mjs513
12-27-2019, 05:25 PM
@KUrtE

Just got back from the Eye Doctor - with all the drops in the eyes everything is blurry.

But think maybe we should move the BNO080 issues to its own thread: https://forum.pjrc.com/threads/58268-Sparkfun-BNO080-Teensy-3-6-gt-gt-4-0?highlight=bno080. What about in that thread.

defragster
12-27-2019, 06:57 PM
Did 1.49b4 download install Win 10.pro all well - no system interference or install trouble.
> micros() update looks good at right at 24 MHz and 600 MHz
> running SSD1306 at default 100KHz and 4MHz works on T4

Manu
01-01-2020, 01:58 PM
Hi,

ADC seem to have a problem with T4. Pedvide updated his repository yesterday to fix the issue.

thanks,
Manu

mjs513
01-01-2020, 02:02 PM
@Manu

Yep. The old version of ADC was only designed on T3.x versions of the Teensy. The Update that Pedvide incorporated in to ADC library the other day allows it to run on not only the T3.x but also on the T4. The updated library will probably be incorporated into the next release of Teensyduino.

NuWaveIT
01-04-2020, 02:07 AM
I know I'm a little late, but thanks for getting the USB stuff added to the Teensy 4.0. Works great, had to adjust my code because the T4 is so friggen fast!

joi
01-04-2020, 07:12 PM
Ok, Teensy 4.0 teensyduino 1.49 beta4 analogRead problem:

I'm reading the wiper of a 100k pot with the ends connected to ground and +3.3V respectively with no analog filtering.


const int ANALOG_PIN = A1;

void setup() {
analogReadResolution(12);
Serial.begin(38400);
}

void loop() {

while (usbMIDI.read()) { } // read & ignore incoming messages


float value = (float)analogRead(ANALOG_PIN);

usbMIDI.sendControlChange(32, value / 32, 1);
Serial.print(value);
Serial.print('\n');

delay(5);
}

There seems to be a discontinuity around the 50% mark, but its not the same going up and going down:
Serial plot of the data

18648

For reference the same sketch on Teensy 3.0 with the same wiring and same potentiometer:

18649

Just turning the pot up and down repeatedly with a little pause at either end trying to move it smoothly.

KurtE
01-07-2020, 04:21 PM
@Paul,
I noticed that Cut and paste works slightly differently if I use Teensy Serial port



USB Host Testing

960

*** Device HID1 1241:1177 - connected ***
*** HID Device Mouse1 1241:1177 - connected ***
Mouse: buttons = 0, mouseX = 0, mouseY = 0, wheel = 0, wheelH = 0

Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0

Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0

Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0

Mouse: buttons = 0, mouseX = 0, mouseY = -2, wheel = 0, wheelH = 0



versus, choosing the serial port (not part of the Teensy section:


USB Host Testing
960
*** Device HID1 1241:1177 - connected ***
*** HID Device Mouse1 1241:1177 - connected ***
Mouse: buttons = 0, mouseX = 0, mouseY = 0, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 1, mouseY = -1, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 1, mouseY = -1, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 1, mouseY = 0, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 1, mouseY = 0, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 1, mouseY = 0, wheel = 0, wheelH = 0
Mouse: buttons = 0, mouseX = 0, mouseY = -1, wheel = 0, wheelH = 0


Notice the Teensy Ports version puts in blank lines...

PhilippeA
01-09-2020, 06:41 AM
Hello,

Il moved from Teensy LC to Teensy 4.0. Using I2C and fastled with Teensy Loader 1.49-beta 4.
I am pretty sure that I have still a problem of interruption during FastLED.show();
My code works, when I2C transmission does not occur during fast.ledshow, but I2C is fuzzy when transmissions occur during fastled.show

The Teensy 4.0 is a slave, a rapsberry being the master


Hope It is clear that that you can help fixing…

Philippe



#include <Arduino.h>
#include <i2c_driver.h>
#include "imx_rt1060/imx_rt1060_i2c_driver.h"

#include "FastLED.h"

….
init :
….
LEDS.addLeds<NUM_STRIPS,WS2812,LED_RUBAN_PIN,GRB>(leds,MAX_LED_NB);


function that makes the problem
// Tache Mise à jour des leds
#define TACHE_LED_AFICH 2
int func_led_affich (int tache_num, byte data1, byte data2)
{
// la liaison I2C n'accroche pas avec show non synchronisé car show n'est pas compatible des interruptions
//if ((status_teensy_i2c ==2)|| (RASPBERRY ==0))
// {
// ti = millis();
FastLED.show();

// Serial.print (" hsh:");Serial.println (millis () - (long) ti);
// }

return (0);
}

PaulStoffregen
01-09-2020, 06:58 AM
Notice the Teensy Ports version puts in blank lines...

I've seen that too, but so far mostly ignored it. It's now on my list of low priority bugs.

There's also strangeness with horizontal scroll position after printing very long lines.

Will probably wait until Arduino 1.8.11 to do any more work on the Java code.

PaulStoffregen
01-09-2020, 07:02 AM
Hope It is clear that that you can help fixing…

Looks like you're using FastLED's default WS2812 driver, which interferes with interrupts.

The solution is to use WS2812Serial. It's a drop-in replacement, just using another include and define before you include FastLED.h, and then replace WS2812 with WS2812SERIAL in "addLeds". For an example, click File > Examples > WS2812Serial > FastLED_Cylon.

PhilippeA
01-09-2020, 09:52 PM
Hello,

Sorry, the example (FastLED Cylon Example, using Non-Blocking WS2812Serial) does not compile:



C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Phil\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Phil\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Phil\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt= o2std,keys=en-us -ide-version=10810 -build-path C:\Users\Phil\AppData\Local\Temp\arduino_build_153 094 -warnings=default -build-cache C:\Users\Phil\AppData\Local\Temp\arduino_cache_606 397 -verbose C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master\examples\FastLED_Cylon\FastLED_Cylon.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Phil\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Phil\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Phil\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt= o2std,keys=en-us -ide-version=10810 -build-path C:\Users\Phil\AppData\Local\Temp\arduino_build_153 094 -warnings=default -build-cache C:\Users\Phil\AppData\Local\Temp\arduino_cache_606 397 -verbose C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master\examples\FastLED_Cylon\FastLED_Cylon.ino
Using board 'teensy40' from platform in folder: C:\Program
Using core 'teensy4' from platform in folder: C:\Program
Detecting libraries used...
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o nul
Alternatives for WS2812Serial.h: [WS2812Serial-master]
ResolveLibrary(WS2812Serial.h)
-> candidates: [WS2812Serial-master]
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o nul
Alternatives for FastLED.h: [FastLED-master@3.3.2]
ResolveLibrary(FastLED.h)
-> candidates: [FastLED-master@3.3.2]
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o nul
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\WS 2812Serial-master\\WS2812Serial.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\FastLED.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\bitswap.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\colorpalettes.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\colorutils.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\hsv2rgb.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\lib8tion.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\noise.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\platforms.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\power_mgt.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\Documents\\Arduino\\libraries\\Fa stLED-master\\wiring.cpp" -o nul
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI\\SPI.cpp" -o nul
Generating function prototypes...
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\preproc\\ctags_target_for_gcc_minus_e.c pp"
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\preproc\\ctags_target_for_gcc_minus_e.c pp"
Compilation du croquis...
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/precompile_helper" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094/pch/Arduino.h" -o "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094/pch/Arduino.h.gch"
"C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=149 -DARDUINO=10810 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bu ild_153094/pch" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teen sy4" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\W S2812Serial-master" "-IC:\\Users\\Phil\\Documents\\Arduino\\libraries\\F astLED-master" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\libraries\\ SPI" "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp" -o "C:\\Users\\Phil\\AppData\\Local\\Temp\\arduino_bui ld_153094\\sketch\\FastLED_Cylon.ino.cpp.o"
In file included from C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master\examples\FastLED_Cylon\FastLED_Cylon.ino:5: 0:

C:\Users\Phil\Documents\Arduino\libraries\FastLED-master/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.002

# pragma message "FastLED version 3.003.002"

^

In file included from C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master\examples\FastLED_Cylon\FastLED_Cylon.ino:5: 0:

C:\Users\Phil\Documents\Arduino\libraries\FastLED-master/FastLED.h: In static member function 'static CLEDController& CFastLED::addLeds(CRGB*, int, int)':

C:\Users\Phil\Documents\Arduino\libraries\FastLED-master/FastLED.h:393:10: error: 'CWS2812SerialController' does not name a type

static CWS2812SerialController<DATA_PIN,RGB_ORDER> controller;

^

C:\Users\Phil\Documents\Arduino\libraries\FastLED-master/FastLED.h:394:19: error: 'controller' was not declared in this scope

return addLeds(&controller, data, nLedsOrOffset, nLedsIfOffset);

^

Plusieurs bibliothèque trouvées pour "WS2812Serial.h"
Utilisé : C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master
Plusieurs bibliothèque trouvées pour "FastLED.h"
Utilisé : C:\Users\Phil\Documents\Arduino\libraries\FastLED-master
Plusieurs bibliothèque trouvées pour "SPI.h"
Utilisé : C:\Program
Utilisation de la bibliothèque WS2812Serial-master prise dans le dossier : C:\Users\Phil\Documents\Arduino\libraries\WS2812Se rial-master (legacy)
Utilisation de la bibliothèque FastLED-master version 3.3.2 dans le dossier: C:\Users\Phil\Documents\Arduino\libraries\FastLED-master
Utilisation de la bibliothèque SPI version 1.0 dans le dossier: C:\Program Files
Erreur de compilation pour la carte Teensy 4.0

KurtE
01-09-2020, 11:27 PM
I am not sure which version of FastLED you have. I think Paul is picking up one I fixed to work with it and have an Outstanding PR: https://github.com/KurtE/FastLED/commit/1b32d0316ad790fdd178bca02f1af71c0ce15ef8

You simply need to edit one file and sort of duplicate some files included in it to match those done for T3.6 and the like.

PhilippeA
01-10-2020, 06:56 AM
I am not sure which version of FastLED you have. I think Paul is picking up one I fixed to work with it and have an Outstanding PR: https://github.com/KurtE/FastLED/commit/1b32d0316ad790fdd178bca02f1af71c0ce15ef8

You simply need to edit one file and sort of duplicate some files included in it to match those done for T3.6 and the like.


First thank you for quick answer (faster than me)

I think I understand better.
Right now it is compiling but I have to make soldering on Teensy 4 to match the possible pin.
But I am not at the end of my problem.
Let me explain a bit more the whole project:
I will do a led "show" in my garden using lets say 40 strips of RGB leds totalizing 15000 leds that are spreaded all over my garden (1000m2). Each strip can be composed of several strips that are combined in virtual strips so that I can outpast the 5 m length (and have simpler wiring). Thus in fact the 40 strips could be actually 60 physical strips.
At the global system., each led is controled by its geographical position in a show is done in global. The update rate is 50 Hz
The 40 teensy 4.0 will be located close to the strips exchanging by differential IC2 to a rapsberry that conduct the shows.
The solution which is working (in developement) for the Teensy 4.0 is to have a cycle of 10 ms of I2C transfert + strip computation then 10 ms of parallel output the the strips leds.
Another solution is to use non blocking transfert to led strip. I was not aware before this Morning that parallel output and non blocking were not compatible using fastled. I may consider the OctoWS2811 Library (I have to mix FASTLED function (e.g. math) with OctoWS2211 or simpler for me, is to have 2 or 3 strip in parallel using WS2812Serial: Let's say one on pin 8 plus 1 on pin 14 ?. If it works it would be the most promising as if I dream:
- The interrupts will still work
- the transfert on the 2 strips will be done in parallel (without using much CPU)

Did I understand well , and is this will work ?

Regards
Philippe (from France)

KurtE
01-10-2020, 01:44 PM
Hopefully someone who uses this stuff can better answer. I have only done done minimal stuff, like test out a 8 or so run of some Adafruit ring of neopixels. The fix was to simply copy the T3.5/6 fixes into the T4. I verified it worked for the small case.

So hopefully some one who does the larger runs and the like can answer any additional questions.

joi
01-11-2020, 12:45 PM
When using Pedros ADC library I don't see the step in the readings.

adc->setAveraging(32); // set number of averages
adc->setResolution(16); // set bits of resolution

adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_LOW_ SPEED); // change the conversion speed
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::MED_SPEED); // change the sampling speed

KurtE
01-11-2020, 07:13 PM
When using Pedros ADC library I don't see the step in the readings.

adc->setAveraging(32); // set number of averages
adc->setResolution(16); // set bits of resolution

adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_LOW_ SPEED); // change the conversion speed
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::MED_SPEED); // change the sampling speed

I am not sure what you mean by the don't see the step in the readings?

I do know that he is sort of reducing some of the apis at the module level. to where you may have to change calls like this to something like:
adc->adc0->setAveraging(32);
adc->adc1->setAveraging(32);

That is if the functions have an optional which ADC to use argument he is removing some of those apis and have you instead call using the actual underlying sub-object...

PhilippeA
01-12-2020, 02:14 PM
Hopefully someone who uses this stuff can better answer. I have only done done minimal stuff, like test out a 8 or so run of some Adafruit ring of neopixels. The fix was to simply copy the T3.5/6 fixes into the T4. I verified it worked for the small case.

So hopefully some one who does the larger runs and the like can answer any additional questions.

Not a problem...I have not tested now since I am working on other topics on the projet.

joi
01-15-2020, 09:24 AM
The step when reading the same pin with the same pot on it with analogRead.

See the graphs from my earlier post, there is as step or a jump in the readings around the 50% which is not the same going up or going down - that step is not present when running the same sketch with the same pot and wiring from teensy 3.0.

The step is not there if I use the ADC library to read the pin, only with analogRead.

defragster
01-15-2020, 10:04 AM
The step when reading the same pin with the same pot on it with analogRead.

See the graphs from my earlier post, there is as step or a jump in the readings around the 50% which is not the same going up or going down - that step is not present when running the same sketch with the same pot and wiring from teensy 3.0.

The step is not there if I use the ADC library to read the pin, only with analogRead.

With Teensduino 1.49 released - if this reproduces on that version like in post #10 - this would be worthy of a new thread perhaps with notes and observations summarized there for investigation.

Very good the ADC updated for T_4.0 doesn't show the problems!

PaulStoffregen
01-15-2020, 10:15 AM
The step when reading the same pin with the same pot on it with analogRead.

Try adding this at the beginning of setup()?


pinMode(A1, INPUT_DISABLE);

Does it help?

KurtE
01-15-2020, 02:51 PM
@joi @PaulStoffregen, As mentioned, it may be worthy of a new thread if it is still an issue. I reread some of it and my guess is there is a difference in how reading directly with analogRead versus now with ADC...

For the heck of it, you might try printing out some debug information... And try to see where the differences may be:
That is with a stripped down version of your code (minus MIDI)

const int ANALOG_PIN = A1;

void setup() {
pinMode(ANALOG_PIN, INPUT_DISABLE);
analogReadResolution(12);
// analogReadAveraging(32);
Serial.begin(38400);
int analog_value = analogRead(ANALOG_PIN);
Serial.printf("CFG:%x, GC:%x, HC0:%x, R0:%x\n", ADC1_CFG, ADC1_GC, ADC1_HC0, ADC1_R0);
}

void loop() {

float value = (float)analogRead(ANALOG_PIN);
Serial.print(value);
Serial.print('\n');

delay(100);
}
And I see some of the initial setup like:

CFG:7bb, GC:20, HC0:8, R0:809
2056.00
2050.00
2057.00
2059.00
2056.00
2056.00

Have you tried setting ReadAveraging? That changes config, like:


CFG:c7bb, GC:20, HC0:8, R0:807

With a hacked up version of ADC readPin (removed reading from ADC_1 (ADC2)...
Part of setup for it looks like:

///// ADC0 ////
adc->setAveraging(16); // set number of averages
adc->setResolution(12); // set bits of resolution
adc->setConversionSpeed(ADC_CONVERSION_SPEED::VERY_LOW_ SPEED); // change the conversion speed
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::MED_SPEED); // change the sampling speed

int value1 = adc->adc0->analogRead(readPin);
Serial.printf("CFG:%x, GC:%x, HC0:%x, R0:%x\n", ADC1_CFG, ADC1_GC, ADC1_HC0, ADC1_R0);


CFG:180f9, GC:20, HC0:8, R0:808
Pin: 15, ADC0 value: 1.6568498168

Pin: 15, ADC0 value: 1.6560439560

Pin: 15, ADC0 value: 1.6568498168

So it may be interesting to experiment some with the different CFG values and see if we need to change some of the equivalent values for conversion speed and sampling speed?

joi
01-15-2020, 07:44 PM
Try adding this at the beginning of setup()?


pinMode(A1, INPUT_DISABLE);

Does it help?

This did the trick indeed! Thank you Paul.

j.

bicycleguy
01-16-2020, 05:13 PM
This did the trick indeed! Thank you Paul.

j.

Could someone explain why this works. Should the library have set this?

thanks

defragster
01-16-2020, 07:14 PM
Could someone explain why this works. Should the library have set this?

thanks

Assuming Paul had an idea to know to suggest this and follow-up is coming. Perhaps a change to be made in pin setup in analog read usage so it just works ...

Deleted User
01-16-2020, 08:18 PM
The modification of analog input pin like INPUT_DISABLE, INPUT_PULLUP, etc. before reading should remain possible, because sometimes it may be useful to read a low impedance signal with a pullup attached, for instance to detect a signal failure caused by a crackling potentiometer or a broken connection, etc., while having the easy option to detach the pullup in software so get the best reading.
To define a fixed default behavior would waste this feature altogether and require additional circuits or freaky coding in such use cases.

defragster
01-16-2020, 09:05 PM
Could someone explain why this works. Should the library have set this?

thanks

Looking at INPUT_DISABLE it changes the hysteresis handling of the pin. That explains why it was resistant to change mid-value as shown in post #10 (https://forum.pjrc.com/threads/58817-Teensyduino-1-49-Beta-4?p=225486&viewfull=1#post225486)


} else { // INPUT_DISABLE
*(p->pad) = IOMUXC_PAD_DSE(7) | IOMUXC_PAD_HYS;

Something about this passed before - perhaps in the beta - Paul knows … how it gets applied will be forthcoming ...