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. You can review your sampling rate and your need...

    You can review your sampling rate and your need for low frequency resolution to use less memory. Or go to something like a Raspberry Pi Zero.
  2. Whoops, I meant USB 3.0 port (on the PC end), not...

    Whoops, I meant USB 3.0 port (on the PC end), not USB-C.
  3. So if I connect the teensy to a USB-C port, then...

    So if I connect the teensy to a USB-C port, then there is at least .6A available for HATs and .3A for the teensy? With no need to cut the jumper on the teensy?
  4. Replies
    3
    Views
    148

    Yes, but I encourage your to measure how much...

    Yes, but I encourage your to measure how much yourself.
  5. Nice, I see it also has a power supply.

    Nice, I see it also has a power supply.
  6. Replies
    4
    Views
    166

    I'd time stamp all the values and store them in a...

    I'd time stamp all the values and store them in a FIFO buffer. Then it's easy to go through the FIFO and do any comparisons you want.
  7. I just tried it and it worked well. Much faster...

    I just tried it and it worked well. Much faster and passed all tests. But probably not fast enough for Dirk.
  8. Posting 10 examples of input and expected output...

    Posting 10 examples of input and expected output would be enough.

    Here is a int16_t table lookup that compiles and works in the Arduino environment. But in your case, a formula may be a better...
  9. Replies
    2
    Views
    187

    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.
  10. > 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....
  11. 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?
  12. 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...
  13. 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.
  14. Replies
    233
    Views
    24,959

    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...
  15. Replies
    233
    Views
    24,959

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

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

    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...
  18. Replies
    7
    Views
    313

    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?
  19. 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...
  20. Replies
    27
    Views
    536

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

    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?
  22. > 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.
  23. Replies
    8
    Views
    3,364

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

    What is the fastest rate (words/sec) that DMA can output?
  24. 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...
  25. 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.
  26. Replies
    15
    Views
    275

    I'd check with volt and ohm meters.

    I'd check with volt and ohm meters.
  27. Replies
    7
    Views
    293

    My version is here: ...

    My version is here:

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

    Thanks. I see similar here:

    http://ww1.microchip.com/downloads/cn/AppNotes/cn586761.pdf
  29. 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?
  30. 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...
  31. 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?
  32. Replies
    4
    Views
    170

    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...
  33. 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?
  34. 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
  35. Replies
    7
    Views
    246

    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.
  36. Replies
    7
    Views
    246

    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:
    ...
  37. Replies
    7
    Views
    246

    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
  38. Replies
    9
    Views
    382

    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...
  39. 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?
  40. Replies
    12
    Views
    614

    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.
  41. Replies
    12
    Views
    614

    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...
  42. Replies
    12
    Views
    614

    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...
  43. Replies
    12
    Views
    614

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

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

    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.
  47. 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).
  48. > 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".
  49. > 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.
  50. Replies
    6
    Views
    211

    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.
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4