Search results

  1. J

    'Over the Air' firmware updates, changes for flashing Teensy 3.5 & 3.6

    > Some of the things I plan to do are: IMO the right way is to implement a Stream class and use the existing code (eg, update_firmware()) without changes. Should be easy once you realize that .available() and .read() are virtual functions that you write to match the input device.
  2. J

    +5V / -5V supply circuit for use with LED driver (driving big LED displays)

    The MAX7221 can supply up to 40ma/segment or anything less than that. The LED can handle 30ma/segment or anything less than that.
  3. J

    +5V / -5V supply circuit for use with LED driver (driving big LED displays)

    Other than the common cathode/anode issue, "can drive" is mostly knowing the current capability vs desired LED current. Do use current control (vs driving with a fixed voltage).
  4. J

    Teensyduino 1.56 Beta #5

    My conclusion is that I'm never going to run arduino on my base machine - ie, I'm going to always run it in a VM.
  5. J

    Arduino 1.8.17

    On top of that DOS attack, there is this - which evidently makes the original flaw worse then expected. https://www.zdnet.com/article/security-firm-blumira-discovers-major-new-log4j-attack-vector/
  6. J

    How Should Teensy Respond if Dynamic Memory Can't be Allocated?

    This still seems like the way to go for doing something predictable when new is used without the recommended '(std::nothrow)' and a null check. Here is code that compiles in new.cpp (but isn't tested). The same should be done for new[]. #include <stdlib.h> #include "new" void* operator...
  7. J

    Arduino 1.8.17

    I don't know if the log4j bug can be exploited via arduino, but I think the safe thing is to assume that it can. So to avoid malicious code running on your computer, it might be wise to upgrade to 1.8.18 arduino and this teensyduino: https://forum.pjrc.com/threads/68972-Teensyduino-1-56-Beta-4
  8. J

    How Should Teensy Respond if Dynamic Memory Can't be Allocated?

    Interesting, it looks like one can independently overload new when used with and without the std::nothrow option. void* operator new(std::size_t size) noexcept { // malloc and abort if it fails } vs void* operator new(std::size_t size, const std::nothrow_t& t) noexcept { //...
  9. J

    How Should Teensy Respond if Dynamic Memory Can't be Allocated?

    > Can use use a #define or template or some other way ... +1 on wanting a way to select between two different versions of new(). If (std::nothrow) isn't specified, then new() should abort on malloc failure. No idea how to do this kind of conditional compilation. If there is no solution, at...
  10. J

    'Over the Air' firmware updates, changes for flashing Teensy 3.5 & 3.6

    Note that the most elegant way to use the FlasherX with a new input device is to implement a minimal Stream class for the device. Then update_firmware() works without any modifications. On the other hand, it's easy to just replace read_ascii_line() with a version that inputs a line from the...
  11. J

    Do I need a Mosfet Driver?

    I only tool a very brief look, but I think a LTC1157 has the right voltage specs and would drive the mosfets for two motors. I didn't check timing - but there might be similar 3.3V, dual gate drivers that are faster.
  12. J

    Do I need a Mosfet Driver?

    For example, a SSM3K56CT has a 1 nC gate charge. Doesn't a teensy pin source and sink current, meaning that the mosfet will turn off about as fast as it turns on with no pull-down resistor?
  13. J

    Do I need a Mosfet Driver?

    IMO, it's worth learning to use LTSpice. It makes things like this easy and is good for visualizing the results.
  14. J

    ADC voltage measurements wrong and jumping on Teensy 4.1

    Last I knew, good teensy ADC practice was pinMode(xx, INPUT_DISABLE) and a low impedance source.
  15. J

    Producing a varying frequency sine wave on DAC output of the Teensy LC

    I used the Paul R swept sine wave method here: https://stackoverflow.com/questions/22597392/generating-swept-sine-waves
  16. J

    PTP (IEEE 1588) Library

    With hardware time stamping, I'd expect excellent performance without a RTOS. PTPv2 is a required part of AES67.
  17. J

    Odd behavior of conditional operator "?" and logical negation "!"

    Once you do anything with undefined behavior, ANY subsequent behavior become legal. Crash, random values, etc.
  18. J

    Teensy 3.6 Parallel Interface with 16 bit ADS8556 ADC 630kSPS

    Consider using a teensy 4.1. Faster CPU and 16 contiguous bits with a single read. I use a different ADC with different handshaking, but run a single channel at 12 Msps. The ADS8558 will convert a little faster. Can you leave CS low all the time? the 32 and 10 delays can maybe be a...
  19. J

    Teensy 3.2 12v Led using mosfet

    When someone talks about red 12v leds, IMO it's likely that there is some current limiting device included in that description.
  20. J

    Teensy 3.2 12v Led using mosfet

    I'd put a 1K resistor in series with the gate. As is, damage might be possible. +1 on using a small logic level mosfet rated for 3.3V VGS.
  21. J

    Jitter free square wave doubler with TeensyTimerTool?

    > interrupt priority set to 0 on INPUT pin. This will jitter occasionally because various things unnecessarily turn *all* interrupts off and then do things for who knows how long. I propose that the highest priority interrupts not be disabled. I *think* this change to imxrt.h would do it...
  22. J

    Could you help me?

    > Can we get higher frequencies? If so, how? thank you You could add a flip-flop clock divider circuit. But I second the recommendation to just use a teensy 4.0.
  23. J

    TeensyPico- Miniaturization of Teensy 4.0 Board - 12x12mm Teensy board as QFN package

    > even if you have 2 sides each Seems to me that with 3D, you could have 4 sides x 144 mm² = 576 mm². Thermally, one could put the IMXRT chip on the top. But it's not clear to me that encapsulation doesn't sometimes improve heat transfer.
  24. J

    Permissible functions in an ISR

    Besides timing and deadlocks, the slightly simplified answer is don't call any non-re-entrant function that might be called from elsewhere. I don't know of a list and non-re-entrant can be hard to spot. And the bugs introduced can be quite rare but severe.
  25. J

    FIR filter with Teensy 4 + audio adapter

    I'd just remove the biquad calls (you don't need filters on top of a convolution filter), but here it is anyway:
  26. J

    questionS about "how to disable a particular interrupt"

    > Define a variable like: volatile bool data_update_in_progress = false; My understanding is that the compiler might re-order code around this, perhaps putting the set to true after your updates. Or maybe not - the 8 numbers are also volatile? This may a generally better declaration for...
  27. J

    questionS about "how to disable a particular interrupt"

    What you are doing should be more common. Ie don't turn off any more interrupts than necessary. Also, don't turn back on interrupts that were off from previous code. Unfortunately, code like this is common: __disable_irq(); ... __enable_irq();
  28. J

    questionS about "how to disable a particular interrupt"

    I think you could use an IntervalTimer and then NVIC_DISABLE_IRQ(my_timer);
  29. J

    Teensy 4.0 clock drift correction

    You could get more accuracy by multiplying millis() by some floating point adjustment value (close to 1.0).
  30. J

    Wierd Analog to Digital Problem with MK20DX256VLH7

    Generic advice - keep simplifying the software until the problem goes away. So in this case, down to a single channel with no averaging.
  31. J

    FIR filter with Teensy 4 + audio adapter

    Here is the code, provided without any support - it will require changes. Your correction impulse response needs to be converted to a C array of floats.
  32. J

    Teensy 4.1 as 16ch 24b/48kHz TDM to Ethernet server PLUS OSC server?

    As much as possible, I'd stick to standard protocols. Like RTP.
  33. J

    Teensy 4.1 white cracks (heat damage?) on PCB at Q1 and U4 is this a known issue?

    Looks like flux residue - which you could clean off with 99% alcohol.
  34. J

    Ideas on a T4 parallel library using FlexIO

    I assume everyone has seen this: https://forum.pjrc.com/threads/66201-Teensy-4-1-How-to-start-using-FlexIO
  35. J

    Ideas on a T4 parallel library using FlexIO

    My application (fast ADC) needs 12 bits of parallel input at about 50 Mhz. I suppose it doesn't matter if the clock signal is generated by the teensy or externally. But it needs to be low jitter. Thanks for working on this.
  36. J

    Ideas on a T4 parallel library using FlexIO

    I'd like to see a FlexIO library that allowed fast input of parallel data with an external clock source.
  37. J

    Direct drive MOSFET (DMG3406L) from Teensy digital pin?

    This should be helpful: https://www.baldengineer.com/low-side-vs-high-side-transistor-switch.html
  38. J

    voltage and current monitering

    If you want individual cell (vs pack) monitoring, then the diyBMSv4 approach is worth looking at.
  39. J

    Is a non-balancing BMS safe if each cell has individual protection?

    Be aware of the effect on total pack capacity. Without active balancing, you are limited by the lowest cell capacity. And by any imbalance.
  40. J

    voltage and current monitering

    An INA230 could be used to measure current with a low side shunt. Maybe it could handle measuring 72V if you added a voltage divider.
  41. J

    Is using a "String" still a bad idea?

    Thanks for the info. So one shouldn't expect teensy Strings to act like a C++ std::string or according to Arduino documentation (where we find "reserve() Returns Nothing"). @bvernham: this adds additional risks to using String in teensy code.
  42. J

    Is using a "String" still a bad idea?

    > you can mitigate much of the risk by using the reserve(size) This leads to how does one safely use reserve()? > reserve(): A bad_alloc exception is thrown if the function needs to allocate storage and fails. But "C++ exceptions and RTTI are not supported on Teensy". I suggest that it's...
  43. J

    Allocating memory with 'new', new(std::nothrow), testing -fcheck-new

    > no one ever checks the return value of new anyway, not even the standard library ... probably better off just enabling exceptions So if one uses a teensy and the standard library, this is the best alternative to (I assume) the default "who-knows-what behavior in out-of-heap and...
  44. J

    Allocating memory with 'new', new(std::nothrow), testing -fcheck-new

    The crash I saw was caused by this same bug.
  45. J

    Is using a "String" still a bad idea?

    > String it supposed to drop data when it can't allocate memory, so you get a proper String variable which is blank. Here is code that eventually drops data but doesn't result in a String variable that is blank. Then much later it crashes (yes, checking S2 for NULL would probably solve this)...
  46. J

    Is using a "String" still a bad idea?

    I did some tests: Looks like "new" with no memory will return NULL which is non-conforming C++. String operations that can't allocate more memory generally quietly fail, with who knows what effect on your program. In some cases, it may crash/reset. The standard solution is exceptions, but...
  47. J

    Is using a "String" still a bad idea?

    What is the proper way to detect an out-of-memory failure of "new" or some std::string related statement (eg, S += "x") in a teensy program?
  48. J

    Is using a "String" still a bad idea?

    +1 on what Paul said. For some cases, the MISRA-C policy of "Dynamic heap memory allocation shall not be used" is best. > the odds are very low, But note that if there is any chance of someone trying to deliberately cause a problem, the odds go way up.
  49. J

    Can Teensy 4.1 run on 4.5V or 4.8V?

    As I read the spec sheet, anything 3.6-5.5V should be OK.
  50. J

    understanding current consumption on the teensy 4.0

    > connect 3 regular LEDs Of course application matters, but I have found 1mA to be plenty bright for generic indicator LEDs.
Back
Top