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

Search:

Type: Posts; User: luni

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    24
    Views
    231

    I see two problems. For the T4 all 4 PIT...

    I see two problems.


    For the T4 all 4 PIT timers run on one module (the T3.x had one module for each timer). That means, if you change clock or whatever, this affects all other interval timers...
  2. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Yes, I originally didn't like the dummy version...

    Yes, I originally didn't like the dummy version because it generated a warning. The unused fixes that. The version with unused is somehow more informative but looks clumsy. I think I stay with your...
  3. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    @Frank: No warning @Kurt: Thanks, didn't know...

    @Frank: No warning
    @Kurt: Thanks, didn't know the unused attribute. Generates exactly the same code



    72c: blx r1
    callback();
    //regs->CSCTRL;
    ...
  4. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    You win. Looks good. 72c: blx r1 ...

    You win. Looks good.



    72c: blx r1
    callback();
    regs->CSCTRL; // = regs->CSCTRL;
    72e: ldr.w r3, [r4, #-4]
    732: ldrh r3, [r3, #20]
  5. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Doesn't that get optimized away? Even when...

    Doesn't that get optimized away? Even when volatile? I'll have a look at the assembly...
  6. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    @Frank: Do you think the last line in the code...

    @Frank: Do you think the last line in the code below is enough for " to read the interrupt flag again, after resetting it."? (Don't want to introduce a dummy, where the compiler complains about not...
  7. Replies
    172
    Views
    31,133

    Wouldn't that only work if you can guarantee that...

    Wouldn't that only work if you can guarantee that the config header is ALWAYS included before the library header? Can get quite messy when you have a large lib with a lot of mutually dependent...
  8. Replies
    172
    Views
    31,133

    Here the worked out config pattern (files...

    Here the worked out config pattern (files attached)

    main sketch:



    #include "config.h"

    void setup()
    {
  9. Replies
    172
    Views
    31,133

    Thanks a lot. Hope I didn't start an argument...

    Thanks a lot. Hope I didn't start an argument about build systems with my remark...


    I fully agree, I also try to avoid this but sometimes its difficult. I recently stumbled over the...
  10. Replies
    172
    Views
    31,133

    Thanks, I have my libs local to the project...

    Thanks, I have my libs local to the project anyway, so that should be no issue. It shows SdFat V2.0.0-beta.7 is this the right one?
  11. Replies
    172
    Views
    31,133

    Just tried it with a T3.6. and the built in SD...

    Just tried it with a T3.6. and the built in SD slot, VisualTeensy & current clone of TD-core

    - Installed SDFatBeta
    - had to rename the sdfat.h to sdfat-beta.h in the SDFat.
    - in MTP_config.h I...
  12. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Fixed this and added information on how to use...

    Fixed this and added information on how to use the error handling system to the readme (https://github.com/luni64/TeensyTimerTool#error-handling)
  13. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Sorry, the usual issue with filenames not case...

    Sorry, the usual issue with filenames not case sensitive in Windows.... I'll fix that later today. Let me know if there are more of those bugs :-)
  14. Replies
    24
    Views
    231

    Here the results for the TMR/QUAD @150MHz ...

    Here the results for the TMR/QUAD @150MHz



    reload MHz Ás
    200 0.75 1.33
    100 1.5 0.67
    50 3 0.33
    25 3.86 0.26
    10 4.03 0.25
  15. Replies
    24
    Views
    231

    Changing that to 150MHz would be great for me if...

    Changing that to 150MHz would be great for me if it doesn't have other effects. The GPTs are also running on 24Mhz... However you can write more thight code since they have a seperate interrupt. I...
  16. Replies
    24
    Views
    231

    @Kurt: here the link to the beta thread when...

    @Kurt: here the link to the beta thread when Frank did experiments with the changed clock https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=196569&viewfull=1#post196569 Might be...
  17. Replies
    24
    Views
    231

    No, it is done for the IMXRT. It is pretty...

    No, it is done for the IMXRT. It is pretty efficient now. I don't think that you can get much more out of it without changing the clock.

    Did another experiment to quickly check the load. With 4...
  18. Replies
    24
    Views
    231

    I also did some experiments. Changed the code...

    I also did some experiments.
    Changed the code in intervaltimer to ignore the limit and printout the calculated ldval. Get the following



    LDVAL measured period
    1 0.5
    11 0.5
    21 ...
  19. Replies
    24
    Views
    231

    I'm afraid simply setting a smaller reload value...

    I'm afraid simply setting a smaller reload value won't help. Here a link to some discussions about that issue ...
  20. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Thanks! Originally I thought enabling more...

    Thanks!



    Originally I thought enabling more than 1MHz would be a good idea, but did you ever look at the load this will generate? Last time I checked I got this result (4 PITs)


    f:100.0 kHz...
  21. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Read that multicore is the main use case for it....

    Read that multicore is the main use case for it. Wondering if in that case fiddling around on machine instruction level is a good idea? Probably better to use proven higher level approaches like...
  22. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Checked it with 32ms which should give a even...

    Checked it with 32ms which should give a even tick count. It still creeps a little bit. I found that the calculated reload ticks are off by one, fixed it, now it gives exactly the right frequency....
  23. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Regarding the "creeping" count with TMR and TCK ...

    Regarding the "creeping" count with TMR and TCK


    The GPT uses the 24Mhz clock which gives exactly 600'000 ticks per 25ms
    The TMR uses 150MHz with a 1/128 prescaler -> 25'000 * (150.0 /...
  24. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Cool, just did some tests on your code as well....

    Cool, just did some tests on your code as well. To be honest I don't understand how you use the ldrex/strex (but that is probably my ignorance) From what I understood from stackexchange you'd use it...
  25. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Thanks! Unfortunately I didn't find a way to...

    Thanks!

    Unfortunately I didn't find a way to check if a timer module is in use. If you have some idea how to identify a used timer I could try to implement it. But at least I tried to only touch...
  26. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Yes, but beware, looking at the STL code with...

    Yes, but beware, looking at the STL code with unprotected eyes may cause serious injury as they say :-))
  27. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    TMR & std::atomic 833188 TMR &...

    TMR & std::atomic 833188
    TMR & disabled interrupts 1153647

    GPT & disabled interrupts 1153644
    GPT & std::atomic 833184

    Direct Register version ...
  28. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    @mjs513: The example in #41 uses a tight while(1)...

    @mjs513: The example in #41 uses a tight while(1) loop to increment the counter. This will be much quicker of course than doing it in loop. To compare performance it might be best to do the tests...
  29. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Yes, that seems to be very useful. Would be...

    Yes, that seems to be very useful. Would be interesting to see if there is a performance penalty. Good thing is that it works locally and doesn't stop the whole interrupt system if it needs to wait...
  30. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    I would say, you should not attempt to do a non...

    I would say, you should not attempt to do a non atomic change of a variable in the main code when you access the same variable in an ISR. Disabling interrupts or using an 'atomic variable' (see #41)...
  31. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    While reading up what that __LDREXW is supposed...

    While reading up what that __LDREXW is supposed to do (__LDREXW seems to be made for multitasking stuff?), I stumbled over the standard c++ 'atomic' header which seems to be more suitable. With this...
  32. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    So, since this is sorted out, here the...

    So, since this is sorted out, here the TeensyTimerTool way to do it. (more or less back to #3 where the discussion started).
    Tested it for TCK, TMR1 and GPT1, works without issues now.


    ...
  33. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    You probably meant to say 'The problem is the...

    You probably meant to say 'The problem is the non-atomic INCREMENT... in the while

    Because, fortunately, this seems to be the reason. The problem is not the ISR at all, it does what it is supposed...
  34. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Can confirm this (err... no... sometimes it...

    Can confirm this (err... no... sometimes it helps, sometimes not

    I give up for today and get me some beer :-)
  35. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Here the disassembly of the isr. Doesn't look...

    Here the disassembly of the isr. Doesn't look suspicious at a first glance...



    void isr()
    {
    TMR1_CSCTRL0 &= ~TMR_CSCTRL_TCF1; // clear the timer flag
    60: ldr r2, [pc, #28] ; (80...
  36. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    I'll check tomorrow, I stumbled over this when...

    I'll check tomorrow, I stumbled over this when adding the dsb, didn't do a lot of experiments with dsb on the others.
  37. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Yes :-) just tried it. Did we find a bug in the...

    Yes :-) just tried it. Did we find a bug in the Chip? What about that ARM addendum you mentioned in the morning?
  38. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    .. commenting out all eventtimer stuff and...

    .. commenting out all eventtimer stuff and removing it from systick also didn't work...


    Edit: also compiling with gcc-arm-none-eabi-9-2019-q4 doesn't change anything
  39. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Unfortunately, adding dsb does not work reliably....

    Unfortunately, adding dsb does not work reliably. By resetting or power cycling the board a few times it can be brought into the same state as without the dsb. To exclude any bugs in TeensyTimerTool...
  40. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Looks like you use an old Teesyduino. A couple of...

    Looks like you use an old Teesyduino. A couple of those CCM_CCGR1_... defines changed names in the current version.


    Just checked the IntervalTimer, looks like it doesn't implement a DSB at the...
  41. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Thanks, still needs some work....

    Thanks, still needs some work....
  42. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Currently the Tick Timer has a hard wired...

    Currently the Tick Timer has a hard wired override of yield(). (see Teensy/TCK/TCK.cpp, line12 if you want to play) That of course needs to be configurable in the future.


    Why? Get the same...
  43. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Silly me... now it gives consistent results :-)

    Silly me... now it gives consistent results :-)
  44. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Here the result for the good old IntervalTimer ...

    Here the result for the good old IntervalTimer



    unsigned loopCnt = 0;

    void callback()
    {
    Serial.print("loop()/sec=");
    Serial.print(loopCnt);
  45. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    Found time to add some more timers for T3.0 -...

    Found time to add some more timers for T3.0 - T3.6. to the TeensyTimerTool. So, currently the library supports the following hard- and software timers.


    T4.0: GPT1-GPT2(2 x 32bit channel...
  46. .... or set it up to exclude the build folders....

    .... or set it up to exclude the build folders. (Which is a good idea in any case)

    Anyway, I still don't see why you want to torture the compiler when Gibbedy has already shown in #4 that there...
  47. I assume that the preprocessor has a hard time...

    I assume that the preprocessor has a hard time generating those 160000 lines of code. Any reason why you don't pack one 'multiExe100' into a large for loop? The overhead for the loop can definitely...
  48. Found some time to try your sketch with a T3.2...

    Found some time to try your sketch with a T3.2 and a T-LC. It works in both cases without problems. I don't observe any restarts and it stays responsive 'for ever'
  49. Thread: TeensyTimerTool

    by luni
    Replies
    81
    Views
    1,049

    TeensyTimerTool

    TeensyTimerTool - Easy to use interface to the Teensy Timers

    I just published TeensyTimerTool on GitHub https://github.com/luni64/TeensyTimerTool. The library provides an easy to use interface to...
  50. My gut feeling is that it has nothing to do with...

    My gut feeling is that it has nothing to do with serial. To me this looks like some buffer overruns or similar. Depending on adding / removing parts of the code they will generate issues or not. But...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4