Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: jonr

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    320

    > String it supposed to drop data when it can't...

    > 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...
  2. Replies
    13
    Views
    320

    I did some tests: Looks like "new" with no...

    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...
  3. Replies
    13
    Views
    320

    What is the proper way to detect an out-of-memory...

    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?
  4. Replies
    13
    Views
    320

    +1 on what Paul said. For some cases, the...

    +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...
  5. Replies
    1
    Views
    125

    As I read the spec sheet, anything 3.6-5.5V...

    As I read the spec sheet, anything 3.6-5.5V should be OK.
  6. > connect 3 regular LEDs Of course application...

    > connect 3 regular LEDs

    Of course application matters, but I have found 1mA to be plenty bright for generic indicator LEDs.
  7. Replies
    1
    Views
    95

    Short answer, you should have them. Longer...

    Short answer, you should have them. Longer answer here:

    https://www.silabs.com/documents/public/application-notes/an0046-efm32-usb-hardware-design-guidelines.pdf
  8. Replies
    68
    Views
    1,549

    Changing the while loop would be consistent with...

    Changing the while loop would be consistent with the CMSIS-CORE implementation of SCB_InvalidateDCache_by_Addr(). But IMO, a ">0 multiple of 32" comment is OK.
  9. Replies
    10
    Views
    284

    Non-preemptive threads avoid state machine coding...

    Non-preemptive threads avoid state machine coding and most of the compatibility problems. Unfortunately, that isn't an option in the above library.
  10. The ETA3000 looks reasonable for balancing,...

    The ETA3000 looks reasonable for balancing, although the error can accumulate cell-to-cell. For the record, diyBMS is a completely open design with data from each cell being available to the master.
  11. Replies
    7
    Views
    271

    Here is an example program that adapts audio...

    Here is an example program that adapts audio rate. Not hard to change it to determine rate based on incoming audio.

    25768
  12. Replies
    7
    Views
    271

    > dropouts or glitches because each tries to use...

    > dropouts or glitches because each tries to use a slightly different sample rate

    I have had good results with matching the teensy audio clock to an external clock source. That source can be...
  13. Consider the "diyBMS New cell monitor module...

    Consider the "diyBMS New cell monitor module V4.40". Or a derived design.
  14. Replies
    68
    Views
    1,549

    Paul's comment is pertinent to understanding the...

    Paul's comment is pertinent to understanding the context:

    "Normally arm_dcache_delete() is used before receiving data via DMA or from bus-master peripherals which write to memory. You want to...
  15. Replies
    68
    Views
    1,549

    No, doing nothing is bad - it doesn't delete the...

    No, doing nothing is bad - it doesn't delete the specified address range from the cache and it's not harmless if you neglect to do this. Flush then delete will a) delete from the cache and b) not...
  16. Replies
    68
    Views
    1,549

    With 1024 and 20 as address/size inputs, your...

    With 1024 and 20 as address/size inputs, your code does nothing.
  17. Replies
    68
    Views
    1,549

    As stated in #4, flush before delete is an...

    As stated in #4, flush before delete is an option. If you care about speed, don't flush more than necessary.

    I think Kurt's code would work.
  18. Replies
    68
    Views
    1,549

    No doubt that arm_dcache_delete() is...

    No doubt that arm_dcache_delete() is under-documented and dangerous when misused with non 32 byte aligned buffers. Do you have a better version?

    Off the top of my head:

    if (alignment or size...
  19. Replies
    68
    Views
    1,549

    I believe that it needs 32 byte alignment. If...

    I believe that it needs 32 byte alignment. If so, the code is correct, but arm_dcache_delete() should only be called after a flush or with a 32 byte aligned address pointing to a buffer that is a...
  20. A couple more comments: A switch() statement...

    A couple more comments:

    A switch() statement is often clearer than many if statements.

    You almost always want to code for clarity and maintainability, not speed or minimal lines of code.
  21. > Only the last exception needs special coding: ...

    > Only the last exception needs special coding:

    Pay attention to request 2.
  22. I'd probably a) handle the special cases with...

    I'd probably

    a) handle the special cases with "if"
    b) divide by 30 and switch on or off depending on even or odd
  23. Replies
    7
    Views
    231

    Perhaps more interesting to know if there is any...

    Perhaps more interesting to know if there is any noise or other performance advantage of different analog pins.
  24. Replies
    5
    Views
    212

    > I tried this out, and the noise does not occur....

    > I tried this out, and the noise does not occur. Interesting!

    This suggests that you should use a lower impedance source. Or add capacitance near the teensy pin.
  25. Replies
    5
    Views
    212

    Does it occur when you use the power supply...

    Does it occur when you use the power supply connected directly to the ADC input (no pot)?
  26. With only 1 or 2 microphones, it looks like the...

    With only 1 or 2 microphones, it looks like the clock rate can be 64 x 44100 = 2.8Mhz. Which is generally reported to be reliable with a breadboard.
  27. Looks to be a different layout. But not hard to...

    Looks to be a different layout. But not hard to make a small breakout board for testing.
  28. This is for a different chip, but is it the same...

    This is for a different chip, but is it the same layout?

    https://oshpark.com/shared_projects/GiObJBkm
  29. Also note that you can usually over-sample -...

    Also note that you can usually over-sample - which improves performance.
  30. Does everyone agree with this summary? 1)...

    Does everyone agree with this summary?

    1) dreggory has reported the ICS-52000 working fine at 44.1Khz
    2) others have had problems with some hand wiring and the notwired.co PCB
    3) the clock...
  31. > Teensy with an Adafruit INA219 FeatherWing to...

    > Teensy with an Adafruit INA219 FeatherWing to measure the maximum amps/watts, but I recall there were issues with it

    I expect that with calibration and lookup table corrections, this could...
  32. Replies
    16
    Views
    363

    The compiler can sometimes help. See my comments...

    The compiler can sometimes help. See my comments here:

    https://forum.pjrc.com/threads/67377-Firmware-quality

    If it's a rare but random problem, I wouldn't ignore the issue.

    Be careful with...
  33. Replies
    16
    Views
    363

    > 1 out of thousands of iterations of the same...

    > 1 out of thousands of iterations of the same code?

    Could be a race condition.

    You need a debugger. Is TeensyDebug good enough?
  34. Replies
    10
    Views
    324

    > upcoming= new...

    > upcoming= new bufStruct((commandBuffer.shift()));

    As with malloc(), one should always check that "new" succeeded.
  35. Replies
    5
    Views
    261

    The chances of the zener surviving long enough...

    The chances of the zener surviving long enough would be better with a resistor in series with the polyfuse.
  36. Thread: Linker wastes ram

    by jonr
    Replies
    7
    Views
    433

    This doesn't help? -fno-common -fdata-sections...

    This doesn't help?

    -fno-common -fdata-sections -Wl,--sort-section=alignment
  37. Replies
    10
    Views
    324

    As an exercise, I recommend you do two things: ...

    As an exercise, I recommend you do two things:

    a) explain in words exactly what "moveXY _nextMove = *new moveXY();" does

    b) explain when one should use the "delete" operator
  38. If you only check for button presses in loop(),...

    If you only check for button presses in loop(), there is a good chance that you will miss some entirely. Because people often use substantial delay() or other slow code.
  39. That's what I do. Combined with a gate pullup to...

    That's what I do. Combined with a gate pullup to 5V, it allows a 5V tolerant teensy to control a 5V load with a low side mosfet - even though the teensy itself can't produce 5V.
  40. You could detect multiple triggers by changing...

    You could detect multiple triggers by changing "triggerOccurred" to a counter and printing it in loop().
  41. Also try turning off compiler optimization. ...

    Also try turning off compiler optimization.

    #pragma GCC optimize ("O0")
  42. Replies
    4
    Views
    258

    To the maximum extent possible, use library...

    To the maximum extent possible, use library routines. Like qsort().
  43. Replies
    5
    Views
    298

    Thanks. Looks like a MAX22500E could do TDM...

    Thanks. Looks like a MAX22500E could do TDM audio to about 200m (using cat5 cable).
  44. Replies
    5
    Views
    298

    Does anyone know of a simple 3V single ended to...

    Does anyone know of a simple 3V single ended to long distance differential over cat5 driver module? Probably LVDS or similar.
  45. Mine is off by about 9 ppm. If this is an audio...

    Mine is off by about 9 ppm. If this is an audio application and you have a reference, you can tweak the rate to be exactly correct.
  46. Thread: GPS and DMA

    by jonr
    Replies
    5
    Views
    266

    I assume the teensy is quite busy doing other...

    I assume the teensy is quite busy doing other things? Otherwise, 115 kbps is quite slow and a negligible load on a T4 (no need for DMA).
  47. I tested with a Teensy 4.0, 1.8.15 and 1.54. I...

    I tested with a Teensy 4.0, 1.8.15 and 1.54. I just use the GDB-stub code without its install process.

    Specifically, include "gdbstub.cpp, TeensyDebug.cpp and TeensyDebug.h" in the directory...
  48. Works fine for me with 1.8.15. I'd use this...

    Works fine for me with 1.8.15. I'd use this test program:




    #include "TeensyDebug.h"
    #pragma GCC optimize ("O0")

    // ~/arduino/arduino-*/hardware/tools/arm/bin/arm-none-eabi-gdb...
  49. As luni says, don't expect to see 30 ns and...

    As luni says, don't expect to see 30 ns and shorter pulses when you sample at 500 sps. A decent oscilloscope will work at 30 ns.
  50. Replies
    29
    Views
    1,405

    And for people who think that pointers are needed...

    And for people who think that pointers are needed to speed things up, this takes the same time. And IMO, is clearer and less prone to errors like above.


    for (unsigned i = 0; i < BUFFER_SIZE;...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4