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
    228
    Views
    24,079

    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...
  2. Replies
    4
    Views
    143

    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.
  3. Replies
    27
    Views
    440

    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...
  4. Replies
    7
    Views
    254

    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?
  5. 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...
  6. Replies
    27
    Views
    440

    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...
  7. Replies
    27
    Views
    440

    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?
  8. > 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.
  9. Replies
    8
    Views
    3,318

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

    What is the fastest rate (words/sec) that DMA can output?
  10. 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...
  11. 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.
  12. Replies
    15
    Views
    224

    I'd check with volt and ohm meters.

    I'd check with volt and ohm meters.
  13. Replies
    7
    Views
    278

    My version is here: ...

    My version is here:

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

    Thanks. I see similar here:

    http://ww1.microchip.com/downloads/cn/AppNotes/cn586761.pdf
  15. 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?
  16. 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...
  17. 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?
  18. Replies
    4
    Views
    156

    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...
  19. 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?
  20. 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
  21. Replies
    7
    Views
    234

    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.
  22. Replies
    7
    Views
    234

    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:
    ...
  23. Replies
    7
    Views
    234

    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
  24. Replies
    9
    Views
    346

    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...
  25. 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?
  26. Replies
    12
    Views
    577

    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.
  27. Replies
    12
    Views
    577

    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...
  28. Replies
    12
    Views
    577

    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...
  29. Replies
    12
    Views
    577

    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...
  30. 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;
    ...
  31. Don't use high input impedance. As I recall, the...

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

    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.
  33. 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).
  34. > 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".
  35. > 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.
  36. Replies
    6
    Views
    189

    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.
  37. +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?
  38. Replies
    10
    Views
    290

    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...
  39. Replies
    9
    Views
    256

    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.
  40. Yes, turn on file->preferences->verbose output ...

    Yes, turn on file->preferences->verbose output and post all of it.
  41. 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.
  42. Replies
    6
    Views
    148

    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.
  43. Replies
    6
    Views
    148

    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.
  44. Replies
    6
    Views
    148

    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.
  45. Replies
    50
    Views
    783

    Note that T3.1 has a choice of internal or...

    Note that T3.1 has a choice of internal or external voltage reference. Which one to use depends on the input signal being absolute or ratiometric.

    No doubt that 32 counts of offset error can make...
  46. Replies
    50
    Views
    783

    So we conclude what I said in #2 - try median and...

    So we conclude what I said in #2 - try median and mean to see what works better for you?


    Here is more flexible trimmed mean code. I recommend it - it allows one to adjust from mean to median...
  47. Replies
    50
    Views
    783

    Would be interesting to know if the analog...

    Would be interesting to know if the analog comparator on the teensy could be used to implement a dual-slope integrating ADC that outperformed the built-in ADC (at low speeds).
  48. Replies
    50
    Views
    783

    > At regular intervals, you could sample the two...

    > At regular intervals, you could sample the two reference channels and use them for a two-point calibration ...

    Even before every sample. Your thinking is similar to a lock-in amplifier, which...
  49. Replies
    50
    Views
    783

    Here is some "trimmed mean" code that often does...

    Here is some "trimmed mean" code that often does better than either median or mean.


    int compare_u16(const void *cmp1, const void *cmp2)
    {
    // Need to cast the void *
    const uint16_t a =...
  50. Replies
    50
    Views
    783

    > Depends what you mean by 16 bit performance ......

    > Depends what you mean by 16 bit performance ...

    Exactly. For some uses, a teensy can be similar to a good external 16 bit converter if you over sample by 4000x. In other ways, no amount of...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4