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

Search:

Type: Posts; User: jonr

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    75

    Take a hundred or so samples and then take the...

    Take a hundred or so samples and then take the median of them. This will help.
  2. Replies
    19
    Views
    525

    It's a good reminder that NOPs are not a good way...

    It's a good reminder that NOPs are not a good way to add delay to a program.
  3. More important than firmware is a nice T4 add-on...

    More important than firmware is a nice T4 add-on board that attaches cleanly without wires. But I'd favor the ESP32 or maybe the ESP32-S2.
  4. Replies
    84
    Views
    17,841

    Here is the Teensy 4 version. Several people...

    Here is the Teensy 4 version. Several people have used it.
  5. Haven't tested it, but supposedly: ...

    Haven't tested it, but supposedly:

    pinMode(pin, INPUT_PULLDOWN);
  6. Replies
    12
    Views
    535

    > Teensy's processor gets pretty warm In my...

    > Teensy's processor gets pretty warm

    In my opinion, the default CPU speed for the T4 should be lower. Rarely do people need 600 Mhz and saving even small amounts of energy is a good habit. A...
  7. Replies
    3
    Views
    188

    You could also add a few lines to sumTrigger() so...

    You could also add a few lines to sumTrigger() so that if isn't hasn't been 1 ms since the last switch, do nothing.
  8. For the record, here is what tests out fastest...

    For the record, here is what tests out fastest for me when I make use of the return value.


    #define IMXRT_GPIO6_DIRECT (*(volatile uint32_t *)0x42000000)

    // rearrange 16 GPIO6 pin inputs...
  9. defragster: what do you get if you make some...

    defragster: what do you get if you make some use of the return values (as I did earlier with total +=)? I'm suspicious that the compiler is optimizing away required code and that 15ns isn't real.
  10. As a good reminder that it seldom makes sense to...

    As a good reminder that it seldom makes sense to try to outsmart the compiler, here is the fastest version yet (15 ns). Also note how clear and simple it is.


    inline uint32_t test3()
    {
    ...
  11. My code is based on response #3 and the following...

    My code is based on response #3 and the following (all from GPIO6):

    #define CORE_PIN1_BIT 2
    #define CORE_PIN0_BIT 3

    #define CORE_PIN24_BIT 12
    #define...
  12. Just a wrapper to get a time: #define...

    Just a wrapper to get a time:



    #define IMXRT_GPIO6_DIRECT (*(volatile uint32_t *)0x42000000)

    void setup()
    {
    Serial.begin(115200);
    delay(2000);
  13. As written (for all 16 bits from GPIO6), I...

    As written (for all 16 bits from GPIO6), I measure < 25 ns with a for loop around it. At 600 mhz.

    Caution: the code has never been tested for correctness.
  14. Interesting - modified to allow some parallel...

    Interesting - modified to allow some parallel operation, I confirmed that this is 7% faster than the code in #18:


    inline uint32_t test3()
    {
    register uint32_t data = IMXRT_GPIO6_DIRECT;
    ...
  15. It would be somewhat faster to use only a single...

    It would be somewhat faster to use only a single read of GPIO6 (vs 7, 9 and 6 twice). It also looks to be much faster without "data" being volatile. About like this for pins 0-1 and 14-27 on GPIO6...
  16. I can tell you that on an unconnected T4, the...

    I can tell you that on an unconnected T4, the interrupt (correctly) never happens. What ADC chip are you using?

    I'd review this https://forum.pjrc.com/threads/57654-Teensy-4-Interrupt-problems ...
  17. You have a typo here: _A[11]), Admittedly,...

    You have a typo here: _A[11]),

    Admittedly, a hard one to spot unless you watch warnings.
  18. Buy a thermocouple module (about $5) and then...

    Buy a thermocouple module (about $5) and then connect it via SPI. Find a library that supports it.
  19. If you are doing intermittent data collection,...

    If you are doing intermittent data collection, you can read and store GPIO6 very quickly and then do the slower process of repacking the bits later.

    Looks like it would take 5 mask/shift/OR...
  20. Replies
    12
    Views
    404

    My version: const String Old[] = {"Red",...

    My version:



    const String Old[] = {"Red", "Green", "Blue"};
    String New[10]; // caution: fixed size

    void setup() {
    Serial.begin(115200);
    while (!Serial);
  21. Replies
    42
    Views
    1,977

    You may be able to program your board with the...

    You may be able to program your board with the programmer built into the MIMXRT1060_EVK. Design files are available.

    The PE Micro Multilink should also work.
  22. Replies
    2
    Views
    217

    You can search for "OTA" to find discussion of...

    You can search for "OTA" to find discussion of software to allow firmware updates over other channels.
  23. Strip the line numbers, #define NO_CONFIG_H and...

    Strip the line numbers, #define NO_CONFIG_H and include it in your program. It worked when I tried it.
  24. You could use this instead: ...

    You could use this instead:

    https://rsync.samba.org/doxygen/head/snprintf_8c-source.html
  25. Replies
    73
    Views
    2,340

    > use delay functions as simple delay as it...

    > use delay functions as simple delay as it changes based on CPU Speed

    For me, delay() is correct independent of CPU speed.
  26. Replies
    20
    Views
    436

    It's better, but I'd adopt a general rule that...

    It's better, but I'd adopt a general rule that you always put a via to ground as close as possible to every decoupling capacitor (see C9). And every separate Vdd pin has a nearby (as in trace...
  27. Replies
    20
    Views
    436

    In my Kicad, those points are connected (through...

    In my Kicad, those points are connected (through the pin 6 area) and it passes DRC. But you could check the gerbers to verify. Do add more ground vias - think small loops and short, low...
  28. Replies
    20
    Views
    436

    Also, the MKL04 doesn't have a decoupling...

    Also, the MKL04 doesn't have a decoupling capacitor anywhere close.
  29. Replies
    1
    Views
    110

    An external ADC could be more flexible about...

    An external ADC could be more flexible about voltage, higher resolution, faster and/or quieter.
  30. Replies
    14
    Views
    456

    As far as I know, teensy analog inputs have ESD...

    As far as I know, teensy analog inputs have ESD diodes to Vdd and Vss that make them +/- 12V safe if they have enough series resistance. Even more so at lower voltages (as Paul's circuit does).
    ...
  31. Replies
    20
    Views
    436

    You do have some other traces running under your...

    You do have some other traces running under your crystal trace. How important is it that USB lines be the same length (or maybe they are)? I believe in decoupling capacitors as tight as possible,...
  32. Replies
    11
    Views
    569

    Would be great to see the ESP32 as a common,...

    Would be great to see the ESP32 as a common, easy, well integrated teensy peripheral.

    I have a derivative of blackketter's teensy/ESP32-module board coming soon. If you are in the US, I'll send...
  33. Replies
    20
    Views
    436

    I'd post all of the related files (now and then...

    I'd post all of the related files (now and then again when it's working - to help others). Nothing obvious to me. Use a known good, simple as possible program (eg, blinks LED). Make sure D+/D-...
  34. It depends on the resistor values. They can have...

    It depends on the resistor values. They can have a negligible effect.

    You may be able to create your own power supply and not depend on the teensys for power.
  35. Look into using ballast resistors.

    Look into using ballast resistors.
  36. Thread: Teensy Chip Sets

    by jonr
    Replies
    1
    Views
    99

    Yes, various people (including me) have done it. ...

    Yes, various people (including me) have done it. But don't do it unless volumes are high. Some info here:

    https://www.pjrc.com/store/ic_mkl02.html
  37. Does it work with the blink example program and...

    Does it work with the blink example program and nothing connected to it?
  38. Replies
    201
    Views
    5,906

    In the past, I've found it useful to set up the...

    In the past, I've found it useful to set up the ADC to continually (as fast as possible) DMA a value into a single location. Then just read that location whenever your code needs an analog read. ...
  39. Replies
    201
    Views
    5,906

    Interesting, I can't get anything close to the

    Interesting, I can't get anything close to the < 1 usec conversions that I thought were possible. More like 2.5 usec per conversion, about teensy 3.2 speed.
  40. Thread: ADC schematic T4

    by jonr
    Replies
    3
    Views
    208

    Keep ADC input resistance below 4K ohms. You...

    Keep ADC input resistance below 4K ohms. You can put a 0.01 F capacitor on the input pin to reduce noise (but it effects bandwidth unless you go down to more like 40 ohms).
  41. Replies
    84
    Views
    17,841

    I added a rtcboot based version of "reboot()" to...

    I added a rtcboot based version of "reboot()" to the flasher4 code. Seems to work.

    Would be interesting to see some testing of the RT1060 watchdog features. Not clear to me that the teensy4 is a...
  42. Replies
    84
    Views
    17,841

    Yes, there is a need for a simple reboot() in the...

    Yes, there is a need for a simple reboot() in the standard libraries. A reboot is a valid response to some software detected errors.

    Locking up is often a dangerous action and a MCU should be...
  43. Replies
    84
    Views
    17,841

    Interesting, this line will put a T4 into a state...

    Interesting, this line will put a T4 into a state where the reset button won't work - only a power cycle fixes it.

    SNVS_LPCR |= (1 << 6) ; // turn off power
  44. My preference is that teensys be small and...

    My preference is that teensys be small and inexpensive. Make a long breakout board for people who want to use lots of pins on a breadboard and make add-on boards for SD card, WIFI, etc. Double...
  45. Replies
    84
    Views
    17,841

    A couple of alpha testers verified that the...

    A couple of alpha testers verified that the teensy 4 firmware loader works. But some minor issues remain (like how does one get a teensy 4 to do a full reset from software?).
  46. Replies
    17
    Views
    327

    You could put volatile on every variable used in...

    You could put volatile on every variable used in the ISR. Whoops - I missed that Kurt already pointed out this issue in #10.
  47. Replies
    201
    Views
    5,906

    Looks like there is some kind of bug. The first...

    Looks like there is some kind of bug. The first time it hits 4 the time is 36. The second time it is 279.


    Quick and dirty T4 Analog Read stuff
    1> 4 2 10 : 2 3 10 : 1 3 5 : 1 2 5
    2> 1 2 10 :...
  48. Replies
    201
    Views
    5,906

    I checked and verified that...

    I checked and verified that analogReadAveraging(3) will speed things up. The result with analogRead() was 5 usec per sample.

    With the right code, I'd expect < 1 usec per sample and 2x faster...
  49. Replies
    6
    Views
    304

    You could tighten up that polling code to be a...

    You could tighten up that polling code to be a little faster. I think a reliable < 50 ns is possible.

    > if I can not "accelerate" one of the methods, I won't be able to catch an external...
  50. Replies
    201
    Views
    5,906

    > I am trying to sample a 15 MHz sine wave You...

    > I am trying to sample a 15 MHz sine wave

    You will need to use an external ADC with parallel output. Or an external track and hold with periodic sampling.
Results 1 to 50 of 334
Page 1 of 7 1 2 3 4