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
    2
    Views
    28

    I would like to see a global flag that is set if...

    I would like to see a global flag that is set if any allocation ever fails.
  2. > values from about 1006.0f to about 2500.0f to...

    > values from about 1006.0f to about 2500.0f to 1-127

    I call this a 1D byte table. You should post the full table that you want to use - typically with more values in any non-linear portions....
  3. Yes. But I think you will find it difficult to...

    Yes. But I think you will find it difficult to figure out. Tell me more about your application and I'll make an example. 1D or 2D? What are the axis values and values in the table?
  4. Some code for 1D and 2D table lookups is here. ...

    Some code for 1D and 2D table lookups is here. You pass it either an X value or X&Y values and it returns an interpolated table value. It was designed so that the tables could be edited by...
  5. If speed isn't an issue, I agree with a curve...

    If speed isn't an issue, I agree with a curve fit. For high speed, I use table look-ups with interpolation. I could dig out that optimized code.
  6. Replies
    233
    Views
    24,810

    For me, a common use would be one core doing ...

    For me, a common use would be one core doing input and calculations and a second core handling high speed asynchronous output. They share a single, atomic ram variable but there is no...
  7. Replies
    233
    Views
    24,810

    As MCUs do more and more, their timing...

    As MCUs do more and more, their timing predictability (and probably code reliability) has been declining. Interrupts, DMA, cache misses, heap use, preemptive threads, etc. So I like the idea of a...
  8. Replies
    4
    Views
    211

    I have a related question - what is the fastest...

    I have a related question - what is the fastest possible clock rate? Ideally for the GPT.
  9. Replies
    27
    Views
    520

    Outputting a clock signal as a 17th bit in the...

    Outputting a clock signal as a 17th bit in the data is a good idea to reduce instruction count. Could delay it and use it with a clock doubler - so a single instruction per DAC output. Or output...
  10. Replies
    7
    Views
    297

    I tried using epoxy to make it stronger but it...

    I tried using epoxy to make it stronger but it ended up causing too many problems. Perhaps a small, never unplugged extender cable to provide strain relief?
  11. With enough time, oversampling and possibly...

    With enough time, oversampling and possibly repetition you might get the results you need from analog integration and then reading with an ADC. A known calibrating pulse just before a real pulse...
  12. Replies
    27
    Views
    520

    Seems clear to me that the plan is for the pulses...

    Seems clear to me that the plan is for the pulses and new parallel data to be continuously and synchronously output at high speed - by the T4. The MCU speed is crystal controlled, so maybe jitter...
  13. Replies
    27
    Views
    520

    With hardware assist, you could reduce it to a...

    With hardware assist, you could reduce it to a single statement (while still creating a pulse). I'm curious - what is the purpose of these very short pulses?
  14. > You mean the MCU's timer or a dedicated IC? ...

    > You mean the MCU's timer or a dedicated IC?

    Either one. The MCU's is better if it can do it.
  15. Replies
    8
    Views
    3,351

    What is the fastest rate (words/sec) that DMA can...

    What is the fastest rate (words/sec) that DMA can output?
  16. While it's great for detecting the occurrence of...

    While it's great for detecting the occurrence of very short pulses, note that it's not what you want to measure a 100 usec wide pulse accurate to 20ns.

    As Mark said, you could use a fast timer...
  17. You use both nano-seconds and micro-seconds, so I...

    You use both nano-seconds and micro-seconds, so I guess the former is the resolution you need. Consider using a teensy 4.0.
  18. Replies
    15
    Views
    267

    I'd check with volt and ohm meters.

    I'd check with volt and ohm meters.
  19. Replies
    7
    Views
    287

    My version is here: ...

    My version is here:

    https://forum.pjrc.com/threads/29105-Sub-Micro-Second-Pulses
  20. Thanks. I see similar here: ...

    Thanks. I see similar here:

    http://ww1.microchip.com/downloads/cn/AppNotes/cn586761.pdf
  21. Is it possible to get ~100 Mbps with ethernet...

    Is it possible to get ~100 Mbps with ethernet without magnetics? For example, can two teensy 4.1s be connected directly with a few inches of wire - rx to tx?
  22. Generically (as in not necessarily a T4/ESP32),...

    Generically (as in not necessarily a T4/ESP32), what is the feasibility of getting higher speed (perhaps 40 mhz), lower overhead (for one end, the other has to do bit-banging) and more flexibility by...
  23. You have checked pins for shorts to 3.3V and...

    You have checked pins for shorts to 3.3V and ground? There is no chance someone used some MKL04s not from PJRC? Decoupling capacitor is positioned correctly?
  24. Replies
    4
    Views
    167

    Seems to me that since the arduino IDE can...

    Seems to me that since the arduino IDE can (usually) cause a program update without a button press, such a feature could be (but isn't) included in the teensy loader.

    You could do updates with the...
  25. Why a pull-up on reset when none of the various...

    Why a pull-up on reset when none of the various examples have one?
  26. There isn't much needed for the PJRC boot loader...

    There isn't much needed for the PJRC boot loader to run. You could post your schematic and PCB layout.

    Also review everything here carefully:

    https://www.pjrc.com/store/ic_mkl02.html
  27. Replies
    7
    Views
    243

    You aren't the first custom teensy designer to...

    You aren't the first custom teensy designer to think that decoupling capacitors can be placed anywhere. Google with "decoupling capacitors pcb placement" should fix this.
  28. Replies
    7
    Views
    243

    I'd use a BOM, crystal layout and decoupling...

    I'd use a BOM, crystal layout and decoupling capacitor layout similar to what is here:

    https://gitlab.com/our-sci/reflectance-spec-PCB

    Or possibly here:
    ...
  29. Replies
    7
    Views
    243

    I'd post your PCB layout too. Crystal and...

    I'd post your PCB layout too. Crystal and decoupling capacitors can be important.

    Also the info here:

    https://www.pjrc.com/store/ic_mkl02.html
  30. Replies
    9
    Views
    373

    If you use 3.3V and the sensor gets unplugged,...

    If you use 3.3V and the sensor gets unplugged, nothing bad happens to the ADC. With higher voltages, the ADC will see the full supply voltage. So you need input protection, with a zener diode...
  31. Possibly the esp32 side has a too small buffer. ...

    Possibly the esp32 side has a too small buffer. Can you reliably send a short ascii string using similar code?
  32. Replies
    12
    Views
    604

    Interesting that the MISRA C coding standard...

    Interesting that the MISRA C coding standard doesn't allow the use of dynamic memory allocation. I believe that JPL/NASA does the same.
  33. Replies
    12
    Views
    604

    There is the gcc option...

    There is the gcc option "-fstack-protector-strong", but not clear what it does on a teensy.

    Linux libraries set a global variable "errno" when a malloc fails, but I don't see similar for...
  34. Replies
    12
    Views
    604

    Sure, we can code up cases that fail and cases...

    Sure, we can code up cases that fail and cases that crash. Given that quietly failing may be worse than crashing, the distinction may not be important.

    Could one use String more safely? I only...
  35. Replies
    12
    Views
    604

    I expect that for 99+% of cases using "small"...

    I expect that for 99+% of cases using "small" Strings, it works well and creates cleaner code with less bugs.

    On the other hand, it's easy to come up with cases that inadvertently fail. For...
  36. I'd do something more like this (not tested): ...

    I'd do something more like this (not tested):


    void loop() {
    elapsedMillis waiting; // "waiting" starts at zero
    while (waiting < 60000) {
    if (analogRead(0) < 1000)
    return;
    ...
  37. Don't use high input impedance. As I recall, the...

    Don't use high input impedance. As I recall, the manual suggests < 4K ohms.
  38. Replies
    9
    Views
    373

    I'd use something more like: 3.3V -> 180 ohm...

    I'd use something more like:

    3.3V -> 180 ohm resistor -> ADC -> sensor -> ground

    Input protection and different values if you are forced to use the 6-24V supply.
  39. Did I miss something (using a TI data sheet)? I...

    Did I miss something (using a TI data sheet)? I don't see a problem with the LM324 - even if Vin exceeds the expected -3.3V to 0V range (except for over voltage to the ADC input).
  40. > saving a floating point op at run time You...

    > saving a floating point op at run time

    You can also leave the expression in the same order and specify the gcc option "-ffast-math".
  41. > v33 =(analogRead(A8) / 1023 * 3.3); I don't...

    > v33 =(analogRead(A8) / 1023 * 3.3);

    I don't know why there is a difference between pins, but add a decimal to 1023 to make it use floating point.
  42. Replies
    6
    Views
    206

    It's non-intuitive, but by using unsigned...

    It's non-intuitive, but by using unsigned arithmetic, the wrap-around issue can be made to go away.
  43. +1 on serial being simple and effective. Would...

    +1 on serial being simple and effective. Would get more complex/interesting if you needed much faster than that. Dual ported static ram?
  44. Replies
    10
    Views
    314

    What does a good multimeter say is correct? ...

    What does a good multimeter say is correct?

    Consider over sampling and a trimmed mean for the ADC value.

    If all else fails, consider calibrating it out. If necessary, with a 4096 entry...
  45. Replies
    9
    Views
    282

    With T4.0, you can read more than 8 bits with a...

    With T4.0, you can read more than 8 bits with a single instruction.
  46. Yes, turn on file->preferences->verbose output ...

    Yes, turn on file->preferences->verbose output and post all of it.
  47. I'd look at turning off interrupts and just...

    I'd look at turning off interrupts and just polling ARM_DWT_CYCCNT to do a variety of tasks with perhaps .1 usec accuracy.
  48. Replies
    6
    Views
    155

    Agreed. My test was with about 1K input...

    Agreed. My test was with about 1K input impedance. NXP suggests < 4K and that input capacitance is 1.3 pF.
  49. Replies
    6
    Views
    155

    I did a test and the impact was a small fraction...

    I did a test and the impact was a small fraction of one count, which is generally lost in the large amounts of noise. I'd wouldn't bother with doing anything.
  50. Replies
    6
    Views
    155

    Looks to me like zero time. But might be worth...

    Looks to me like zero time. But might be worth some tests to see if there is any effect on the values that could be eliminated with more time.
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4