Looks like CAN XL was only released in 2022, later than iMXRT1062, so probably not? The quote below is from the iMXRT1062 reference manual. No mention of CAN XL.
The FlexCAN module is a full implementation of the CAN protocol specification, the...
Example program LoopBack in the PulsePosition library builds with no errors for me for T4.1. I'm using Arduino 1.8.19 and TeensyDuino 1.59 on Windows 7 (but Paul always recommends 10+).
Please tell us which Teensy, IDE, TeensyDuino, platform...
Not sure what "controller.h" is, so I can't try to build the project, and maybe this is C++ syntax I'm not familiar with, but line 59 below looks wrong to me.
Pot *POTS[] {&PO1};
Pot *POTS[] defines a variable named POTS that is an array of...
The other thread seems to say that 132 MHz works, so I would just try it, and if it works, use it. I don't think you can damage the board or the PSRAM by raising that clock frequency. If you're curious, you can try running the PSRAM test program...
Here is a library for using MPU9250 with Teensy. You can find several threads on this forum about using this library if you google "Teensy MPU9250"
https://github.com/bolderflight/MPU9250
Here is the code from startup.c in TD 1.59. It uses (5) and (3) to set the clock to 88 MHz. I think this means that CLK_SEL(3) provides a clock of 440 MHz, and the (5) means 440/5 = 88.
CCM_CBCMR = (CCM_CBCMR &...
I had recently wanted to reset EEPROM in a T4.1 for a similar reason, but within my application. The code shown below does that using functions in eeprom.c and runs in a little under one second, but keep in mind it is not equivalent to the full...
No idea what you're doing. My point was that QNEthernet is supported and NativeEthernet not so much. You may also want to try building your simple program in the Arduino IDE. There have been many posts here where PIO tools configuration/settings...
Perhaps the "loader utility" that is contained in the 2nd part of the EHEX file is not needed when the update is done via FlasherX, i.e. from within an application that has already passed the "security barrier"? I know so little about the locked...
See the github link below for a method (FlasherX) to update firmware on Teensy 4.1 via UART. In my case, the UART connection to T4.1 is from a PC host, but you could use the same method to update firmware in one T4.1 from another T4.1, and since...
The program below will generate phase-shifted 1-MHz PWM on pins 2 and 3, which are channels A and B of the same SubModule on FlexPWM4. You can read about phase-shifted PWM in Chapter 55 of the iMXRT1062 reference manual. What the program does is...
One way is to get a USB microSD card reader for your PC, copy files onto an SD that way, and then insert the SD card into your T4.1 socket. If you want to transfer directly to the SD on T4.1, search for "MTP" on this forum. That stands for "Mass...
I read the section on EHEX files a couple of times. It's pretty amazing that Paul provides all of this information, and I hope he won't mind answering another question.
With a standard HEX file, FlasherX writes the new firmware to the flash base...
For an application as large as yours, I think buffering in PSRAM would be the fastest. I did a test, and the time to read SD and write to PSRAM is 5 seconds (compare to 20 to write to a flash buffer). The reduction of 15 seconds corresponds...
I tested with an application a bit over 2MB, and I get 20 seconds to read from SD and write to the flash buffer, and 57 seconds for flash_move(). Less than your 73 seconds, and I don't know why, but still on the order of 1 minute. I tried...
Oh, okay. My applications are pretty small, so I think of the flash write as fast. Or perhaps I should say that I think of the slow part as being the parsing of the hex file and writing to the flash buffer. Once that is done, I think of the copy...
If you store two images (hex files) on SD, each with the capability of switching to the other, whichever one is running could load the other with these steps: (1) read image from SD and write it to a flash buffer above the active image, (2) call...
1.8.5 sounds like a version of Arduino IDE, not of TeensyDuino. The latest TeensyDuino is 1.59, just released last week. Arduino 1.8.5 goes back quite a ways, so it might be a good idea to update to the latest (Arduino 1.8.19 and TeensyDuino 1.59).
The PWM clock frequency for T4 is 150 MHz (F_CPU/4), so at 4 MHz you have ~38 clocks per period and at 10 MHz you have 15 clocks. That's enough resolution to get pretty close to your desired offsets of 1/4, 1/2, 3/4 period. See section 55 of the...
You have two threads. One thread is executing loop() and the other is executing updateDisplay(). Both are calling Serial.print(), and because that is not re-entrant, it's likely to crash your program. One solution is to print only from one...
If you're not familiar with elapsedMillis, it's a clever little class that encapsulates the commonly-used paradigm of reading millis(), comparing to a start value, etc. Each access to "ms" implies a read of millis() and a calculation of the...
Getting speed from the encoder is really easy if you use the QuadEncoder library per the link in your post. You just call enc.Read() at the interval you want, and do the calculation. Here is a T4.x example that assumes encoder A and B signals are...
@luni, I figured out what I was doing wrong and fixed it, and I opened an issue on your EncSim repository that explains how I modified your IntervalTimerEx for compatibility with TD 1.59
Code and static variables go into RAM1, and that's where you have the overflow. On the other hand, almost all of your RAM2 is available, so an easy fix is to add the DMAMEM keyword for some of the statically defined variables, or allocate them...
@luni, I'm using TD 1.59b6 and trying to build an old sketch that uses your EncSim library. I'm getting errors in IntervalTimerEx that I think are associated with your changes to IntervalTimer. It looks like IntervalTimerEx.h and cpp need...
You don't say what how many SPI devices or what type, but assuming there are at least 3, Teensy 4.0 has 3 x SPI, so you could at least triple your throughput by using them all.
Have you tried the library below that uses the T4.x quadrature hardware? That's a much better solution for your project. At 1700 rpm, you'll have 1700/60 * 8000 = ~226K interrupts/sec. The T4.0 can do that, but the library below can provide a...
It is not necessary for each FreqMeasureMulti to be on a separate FlexPWM, but you should pick pins for FreqMeasureMulti that are on different FlexPWM than those you use for PWM. I'm forgetting the terminology, but a single FlexPWM has 12 output...
You're telling the compiler that you want RingBuf to be stored in a different location from the rest of the class data member. If you want the RingBuf to be in DMAMEM, you'll have to either put the entire class in DMAMEM (not sure that works), or...
Not to get in the way of your progress, but I'm curious if someone can summarize or just comment on what you've learned about the relative speed of SDRAM to TCM, RAM, PSRAM?
Yes, only loop() will be blocked. What I'm saying is that if you want to avoid those occasional long blocking times of 40+ ms, there is an easy way to do it.
SdFat is blocking for both read and write. There is a fairly recent thread where someone modified SdFat to do non-blocking reads, but not writes. There is a way, though, to limit blocking times to 5-6 us and avoid the very long blocking times of...
You can't recreate source code from what is stored in the Teensy. but the Arduino build process does save something very close to your original source code. If your sketch was named MySketch.ino, search your disk for "MySketch.cpp", or perhaps...
Have you looked at the library below? It seems to be pretty well documented and there are examples of sending byte-oriented messages to a LIN slave. You should be able to translate the STM32 example into function calls for the Teensy library...
If you're willing to try one more thing, try the line below, which avoids the integer division and truncation of (RPMSum / RPMCount).
WRPM = (60.0f / PICKUPS) * RPMCount * RPM.countToFrequency(RPMSum);