Nice catch, Paul. I looked at the question and never thought of that issue with sin(). Since he only needs the fractional part, I think the code can be simplified by using fmodf() rather than modff().
float angle = t + 60.0 * 2.0; //...
According to this fairly recent (Jan 2023) thread, there are no actual schematic or PCB files.
https://forum.pjrc.com/index.php?threads/release-of-teensy-4-1-schematic-and-pcb-files.71735/
Instead of TeensyThreads or FreeRTOS, I use a simple cooperative "OS" that I built myself, with mailboxes and queues for inter-task and ISR-to-task communication and this works very well for me. The underlying C queue is shown below, with each...
[Teensy]<---serial--->[ESP32]<---bluetooth--->[PC]
You've got hard-wired serial communication between Teensy and ESP32, and that is working, right? You're trying to get bluetooth communication between ESP32 and your host PC, and you want to know...
The current version of SdFat has sd.initErrorHalt(), which may be what the OP is looking for. Bill's example programs usually have the logic below, and the last line of initErrorHalt() is an infinite loop. I can see doing this in an example...
TD 1.57 had SdFat 2.1.2, the same as 1.59, so perhaps the OP's last successful build was with TD earlier than 1.57?
@paoloboatto, can you show the error message? Is the call to syscall::halt() in your own code, or is it from a library?
I did some tests with a timer ISR writing to a ring buffer in PSRAM at various rates, then reading from the ring buffer and writing to SD in loop(). I found it did not quite run reliably at 8 MB/s with the default 88 MHz FlexSPI2 clock rate...
If "0" means "no signal" for 1 to 10 ms, here is an example that seems to work. It repeats this cycle:
for 10 ms, frequency=1000(Hz) and duty cycle=50(%)
for 5 ms, frequency=1000 and duty cycle=0 (no signal)
for 10 ms, frequency=500 and duty...
If it works okay with a 1-second delay, but not with 10-ms delay, have you tried gradually reducing the value to see where it stops working? There is probably some limit, and you probably can't get too close to a 1-ms delay if you are using 1000 Hz.
On the firmware side, have you tried adding Serial.flush() after your call to Serial.write()? Your USB_BUFFER_SIZE is 64, which is small for USB, and you may have data sitting in USB buffers on the Teensy side. If that helps, I would also...
I can't comment on why your analog inputs might be noisy, but let's assume they are. In that case, doing a single analogRead() once per minute is not going to provide a steady result. You could modify setup() to call analogReadAverageing(32) so...
Try using digitalWriteFast() rather than digitalWrite(). I can't remember the execution times, but it's much faster. I think the least intrusive way to measure execution time is to read the running cycle counter ARM_DWT_CYCCNT before and after...
There are some places in the hardware serial code, including write, where interrupts are disabled briefly. If your timer interrupt is your highest priority, I suggest raising its priority to 0 (highest) as shown below rather than changing the...
No idea what JUCE is, or what you want to communicate, but I googled "juce teensy" and found a couple of links
https://forum.pjrc.com/index.php?threads/juce-teensy-communication.55617/
https://github.com/cutlasses/TeensyJuce
There may be other issues, but your spi_Write function is calling SPI.transfer(data_byte), which sends one byte, but data_byte is type uint16_t, which is two bytes. You at least need to send both bytes of the data value. You might want to rename...
Just a guess, but this may be a reference to a company named Real-Time Systems. Among other things, they make software tools to allow visualization of data from embedded systems.
https://www.real-time-systems.com/
I think only you can estimate or determine your data logging requirements. If you're new to this, you can start by deciding how often you want to log data, and how much you want to log each time. Multiply those and you have a data rate...
If you want to log data to flash, I think it's a good idea to add a flash chip. There may be a lot of space in the on-board flash chip, but when you write or erase the on-board flash, interrupts are disabled, and that constraint may not be...
There have been some threads about download timeouts for large files. Since your trouble is only with RPi, it makes sense to wonder if the timeout logic is somehow different there. Sorry I can't provide specific help, but there is a timeout.
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...