Cross post from:
Hey Teensy coders. This Monday FastLED is planning on changing the default WS2812 driver from the previous default one to Kurt Funderburg amazing ObjectFLED driver.
In case you don't know, this is the spiritual successor to...
On Arduino's attachInterrupt() documentation page, there is example code. Just scroll down to find it. Maybe trying to run that example might help? Of course, edit the interruptPin number!
That example needs a LED. Pin 13 should be the LED on...
I can confirm the EEPROM emulation within the core library does indeed do wear leveling. For small data like 64 bits, you can expect the wear leveling to multiply the underlying 100K endurance by a factor of 256 to 512.
Extremely unlikely to...
Duplicate questions do not help. This only annoys people who might try to help. This new question also lacks the info which was found on the first one, so anyone trying to help has to start back at the beginning without the benefit of that...
While adding the missing DP83825 chip could theoretically work, as a practical matter the odds of success are low even using the very best equipment. The 4 tiny pads on the 4 corners are particularly challenging to solder. If any sort of...
Even if the changes are "trivial", please copy the complete program here, so I or anyone else can copy it into Arduino IDE and get the same errors.
Please understand, over and over when I try to help but I have to alter a program, usually I do...
We're much better at helping with compiler errors when we can reproduce the error. Maybe tell us specifically which libraries to install and which example program to open, or give us a copy of the program you're compiling if it's not any of the...
I don't know anything about these software libraries it uses, like "systemIO". Can't help with that.
Using the normal Arduino functions, you would use the attachInterrupt function.
But is it really (Arduino) pin 0 on Teensy? I saw this in the...
Looks like this product is based on MicroMod Teensy. Quick search turned up this website, but I couldn't find a schematic or hardware reference that tells what Teensy pin "DIN0" really is.
If I found the wrong thing and you really have...
Which hardware is used depends on which input and output features you use.
You can find specific documentation for each input and output in the design tool. Just click on the feature you want and its documentation appears on the right side...
Looked at your code. Took some time because you have many Windows-only style pathnames. Please use forward slash, so we non-Windows users can help you without this time-consuming step!
The fix for your problem is exactly as Defragster said...
For expansion, I'd recommend using the USB host port, normally used with this cable. If you connect a powered USB hub, you should be able to plug in at least 4 more Teensy 4.0 or 4.1, and theoretically perhaps many more.
Teensy supports USB MIDI...
The one gotcha with FlexIO is the very fast default clock speed isn't good for slow baud rates (almost anything under 115200).
See this MIDI example for how to best configure FlexIO so you get accurate MIDI baud rate.
Kurt's extra pinout diagram is the easiest way to see which pins can be used with FlexIO.
https://forum.pjrc.com/index.php?threads/teensy-4-1-where-do-i-connect-to-use-third-spi.66144/#post-268934
Looks like 24 more pins not conflicting with...
Confirm BUILTIN_SDCARD will not conflict with pins 11, 12, 13. On Teensy 4.1 it uses pins 42-47.
If you're only storing a small amount of data, you could also use LittleFS_Program which doesn't require adding a SD card or any other hardware...
You need const when using PROGMEM.
If your weightsFlash[] array is actually initialized by a different .cpp or .ino file, but you want to give access to it without creating a duplicate (and conflicting) copy, use "extern const float...
Looking at your code on github (which I'll admit, I have so far not tried compiling or running), I'm pretty sure the problem is at line 514.
if (!SD.begin(4)) {
Serial.println("Error reading SD card. Using default configuration v12");
}...
Neither of the programs you showed actually compile if copied into Arduino IDE. Even the simple one, if the missing "void" is added on setup, still does not compile because "sw3" is undefined.
However, this simple program does compile.
void...
When Teensy runs at 600 MHz, most of the peripherals clock at 150 MHz. So the PWM and other timers which can create waveforms tend to be able to only give you integer division of 150 MHz. You could easily get 37.5 MHz, but not 40 MHz with the...
Yes, please send a pull request for IMXRT_USDHC_t in imxrt.h. At least putting that into 1.60 should make this easier to maintain.
Changes in SdFat and SD less certain for now...
Sure, just write or print the same data to all 3, like this
Serial1.write(myArray, sizeof(myArray));
Serial2.write(myArray, sizeof(myArray));
Serial3.write(myArray, sizeof(myArray));
Each port has a transmit buffer in memory, so your writes go...
Sadly, the internal ADC can't sample that fast. No amount of DMA or software trickery can compensate for the fact the analog input circuitry just isn't anywhere near cable of 10 Msamples/sec.
SD using SDIO protocol on the built in SD socket uses 50 MHz clock.
SD over SPI defaults to 16 MHz, but you can configure slower or faster speed. Slower clock is (probably) more forgiving of lengthy wiring.
Adding series resistors on the...
USB devices want 5 volt power. Most can work with as low as 4 volts. Some even work if you give them only 3.3V, but that's not recommended.
The main issue is what happens if your USB device draws too much current. This is actually 2 different...
Have you tried it on Teensy 4 yet?
Quick look inside the code seems to be using the avrlibc eeprom functions, which we support on all Teensy models.
There could of course be some sort of problem I didn't see with only a quick look at the code...
If you're not familiar with USB host vs device mode, here's a copy of the USB 2.0 spec. (you can also get it for free at usb.org if you dig deep...)
https://www.pjrc.com/teensy/beta/usb20.pdf
Start on page 15 (the 43rd page in the PDF). This...
No, that definitely will not work.
Teensy's main USB port only supports USB device mode. It can only communicate with a USB host. It can't possibly communicate with another USB device. For that, you must use Teensy's USB host port.
Yes...
"Access is denied" usually means some other program has opened this COM port. Windows only allows 1 program to open the port. If something else on your PC is using it, then Arduino IDE can't also open it, which means it can't send the request...
That's good info.
Maybe the problem could be lessened using "Channel preemption". The 3 DMA channels used for LED output would be able preempt the audio DMA (if configured some way). Audio should not be nearly as urgent because sample rate is...
About the T0H timing, I really believe you could go with no more than 300ns. Many different WS2812 products have been sold over the years, and many different datasheets with varying (sometimes non-nonsensical or contradictory) specs have been...
My blind guess is other libraries using DMA may be adding about 90ns latency. If so, you should see the WS2812Capture stats show different min & max timing while Audio is running.
I have an idea how this might be improved (maybe) but first step...
Glad you found it. :)
Maybe this would be a good moment to mention the WS2812Capture library I recently started. It's meant to capture WS2812 waveforms and analyze the actual timing. If you have another Teensy handy (and time to connect some...
I've not written this sort of gaming code, so this is just guesswork...
Maybe a first (relatively easy) way to investigate might involve compiling that Arduboy code with small changes to increase the map size, while watching the memory usage...
Just to confirm, I've added this to my list of issues to investigate. Can't make any promises of time frame when I'll get to it, but it definitely is on my list so I won't forget even if this forum thread becomes inactive.
Not turning on the...
These ref manual pages are mostly about which chips can be in which memory regions.
Cache config isn't covered anywhere (as far as I know) in NXP's reference manual, since it come from the ARM MPU.
Each FlexSPI can theoretically connect up to 4 memory chips. See Figure 27-2 on page 1604 in the reference manual.
Teensy 4.1 physically has wiring to connect only 1 chip (the main program memory) to FlexSPI1, and 2 chips (the bottom side QSPI...
Yup, #include just includes the contents of another file, as if you had typed it all. Simple stuff really.
Except things can get complicated quickly if you include that same header file from multiple .cpp / .ino files. Then it is the same as...
It's pretty close, but a couple small issues. You want PROGMEM on the array holding the actual const data, so it doesn't consume any RAM1 memory. In setup() where you call memcpy, use sizeof() because memcpy wants the actual number of bytes...
To do this, you would need to create your own PCB design using the T4 bootloader chip.
13 of the 55 possible GPIO pins are quite inconvenient to access, so you might want to target use of only 42 for your prototype.
For those last 13, the SD...