Search results

  1. J

    Teensy 3.2 SPI speed decreasing over time

    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; // radians angle = fmodf( angle, PI * 2.0 ); // fractional...
  2. J

    teensy4.0 pcb design file

    According to this fairly recent (Jan 2023) thread, there are no actual schematic or PCB files.
  3. J

    Teensyduino 1.59 Released

    In post #1 of this thread you will find download links for TeensyDuino installers. You just run the installer and follow the prompts.
  4. J

    Queuing or communication between thread

    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 queue element being of type *void. If you look at...
  5. J

    Serial Communication From Teensy 4.1 to Firebeetle 2 ESP32-E, and then to App

    [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 why that isn't working? If the error message...
  6. J

    SysCall::halt() doesn't compile on Teensy 4.1 after upgrading from Teensyduino 1.57 to 1.59

    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 program, but it's hard to see why you would do this in...
  7. J

    SysCall::halt() doesn't compile on Teensy 4.1 after upgrading from Teensyduino 1.57 to 1.59

    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?
  8. J

    short circuit somewhere killing all my teensies?

    Not a hardware guy, but are you powering stuff via the Teensy?
  9. J

    Glitches when using EXTMEM circular buffer for USB Host writes and reads by SD Driver

    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. Increasing the clock to 133 MHz allowed it to work...
  10. J

    Hello, I'm using PWM_DynamicFreq.ino for generating 2 different frequency

    Not sure exactly what you mean, but you can use delayMicroseconds() or delayNanoseconds()
  11. J

    Hello, I'm using PWM_DynamicFreq.ino for generating 2 different frequency

    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 cycle=50 #include "Teensy_PWM.h" #define pinToUse...
  12. J

    Hello, I'm using PWM_DynamicFreq.ino for generating 2 different frequency

    Do you mean you are setting duty cycle = 0 for 1-10 ms between frequency changes? Please show your code.
  13. J

    Hello, I'm using PWM_DynamicFreq.ino for generating 2 different frequency

    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.
  14. J

    Can Teensy 4.1 bit stream at 480Mbps with USB 2?

    Do you mean averaging groups of four consecutive 12-bit values? To say "four consecutive bits" is incorrect and confusing.
  15. J

    In Need of Teensy 4.1 Data Transfer Debug Help

    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 increasing USB_BUFFER_SIZE for better efficiency. I also...
  16. J

    Sampling voltage with Teensy 4.1

    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 that each call to analogRead(pin) returns an...
  17. J

    Is there a faster alternative to Serial1.write? (4.1)

    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 Serial2.write(), compute the delta and print to USB...
  18. J

    Is there a faster alternative to Serial1.write? (4.1)

    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 priorities of the UART interrupts. When you say...
  19. J

    Teensy 4.0 communication with JUCE

    No idea what JUCE is, or what you want to communicate, but I googled "juce teensy" and found a couple of links
  20. J

    Bug in Pedivide ADC library function

    (flipflop++ % 1) should be (flipflop++ % 2)
  21. J

    DAC80501 Help

    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 "data_byte" to "data_word"...
  22. J

    Adding "Real-time Systems" Custom USB-Type

    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.
  23. J

    Teensy 4.1 Flight Computer

    Yes, if you can use an SD card, that's a simpler way to start. I recommend you look at SdFat library example programs, particularly TeensySdioLogger.
  24. J

    Teensy 4.1 Flight Computer

    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 (bytes/sec), and then decide you long you need to be able to...
  25. J

    Teensy 4.1 Flight Computer

    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 compatible with the other things you want to do. You...
  26. J

    Failing Teensy 4.1 uploads from Raspberry Pi 4B

    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.
  27. J

    CAN XL in Teensy 4.1

    Probably you should look at the CAN examples and read the manual. Lots of good info there.
  28. J

    CAN XL in Teensy 4.1

    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 CAN with Flexible Data rate (CAN FD) protocol...
  29. J

    Loop Back Error -

    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, etc.? I'm guessing you have not specified your...
  30. J

    Compilation errors in this sketch

    Maybe provide the link to the video? The sketch doesn't look like it's intended for T4.1
  31. J

    Another newbee

    Thanks, Shawn. I had a feeling it might be.
  32. J

    Another newbee

    If you provide the full project someone can help you.
  33. J

    Another newbee

    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 pointers to items of type Pot. What is inside the...
  34. J

    Teensy 4.1 Software Reset Code

    Do you mean TyCommander is working for you on Windows, or is this also for Ubuntu?
  35. J

    Help Understanding This Code . . .

    Thanks for that clarification, Paul. It's nice that one can try the higher speed without modifying any core files.
  36. J

    Help Understanding This Code . . .

    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 with various clock frequencies.
  37. J

    actuator controlling by mpu9250 using quaternions techniques

    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"
  38. J

    Help Understanding This Code . . .

    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 & ~(CCM_CBCMR_FLEXSPI2_PODF_MASK |...
  39. J

    Teensy 4.1 - Reset EEPROM / Empty EEPROM values

    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 flash erase Paul described. This only erases the 63...
  40. J

    Teensy 4.1: can't get combined UDP/TCP server to work (now with example code)

    I was referring to your question about SD, which I could not answer.
  41. J

    Teensy 4.1: can't get combined UDP/TCP server to work (now with example code)

    Whatever issue you're having, your best bet for getting help here is to create a small test program that shows the issue and builds in Arduino IDE.
  42. J

    Teensy 4.1: can't get combined UDP/TCP server to work (now with example code)

    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 were different from Arduino and possibly incorrect.
  43. J

    Teensy 4.1: can't get combined UDP/TCP server to work (now with example code)

    You might want to try QNEthernet instead of NativeEthernet, which is no longer supported.
  44. J

    EHEX has EOF twice in the file - Confuses FlasherX

    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 teensy and security features that I'm really just...
  45. J

    How to get one Teensy to program others

    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 T4.1 has 8 x UART, you could have one T4.1 update...
  46. J

    Multi PWM with Phase Delay Teensy 4.1

    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 use the standard Teensy/Arduino calls to set up...
  47. J

    Teensy 4.1 temperature range?

    0 to 95C. Industrial grade of the same part is -40 to 105C
  48. J

    Teensy 4.1 "dual boot" capability?

    Thanks for documenting the startup logic. That's all new to me.
  49. J

    How to use the general purpose timer (GPT) output conpare interrupt

    Thanks for taking the time to post your working sketch.
  50. J

    Transferring files from PC to SD card

    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 Transfer Protocol" (I think), and it lets you...