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.02 seconds.

  1. Agreed, 400kHz interrupt frequency is borderline....

    Agreed, 400kHz interrupt frequency is borderline. Just a quick idea: do you actually need the high resolution for normal turning with feed? Maybe you can readout the encoder for threading only and...
  2. Couldn't you simply get a higher resolution...

    Couldn't you simply get a higher resolution encoder?
  3. Replies
    0
    Views
    47

    Trigger Crash Report

    Is it possible to trigger a crash generating a crashreport with some information to display? I have an application which would normally throw an exception. Doing a 'controlled' crash with some...
  4. Sorry was caught in an endless meeting... You...

    Sorry was caught in an endless meeting...

    You can set the count mode in the begin function of the encoder. It defaults to countMode::quarter which is the usual setting for mechanical encoders. ...
  5. Do you mean that it ended up with wrong counts...

    Do you mean that it ended up with wrong counts (shouldn't happen) or did it rapidly count up/down on the disturbances (I would expect that). Using it in countMode::Half or countMode::quarter should...
  6. Replies
    96
    Views
    2,147

    I, personally don't like suppressing warnings by...

    I, personally don't like suppressing warnings by default.

    For the use case you mentioned (stubs for future coding), I'd simply declare the objects as [[maybe_unused]] to get rid of the warning...
  7. Got it going, I simply copied the TY stuff from a...

    Got it going, I simply copied the TY stuff from a platform.txt from an old installation to the new platform.txt in the folder you gave. Need to close the IDE, delete the folder "arduino-ide" in...
  8. Did anyone try to integrate the...

    Did anyone try to integrate the tyTools/tyCommander in the IDE2?
  9. Replies
    96
    Views
    2,147

    [[maybe_unused]] char x[128]; Works in a...

    [[maybe_unused]] char x[128];

    Works in a simple test function
  10. Thread: TeensyTimerTool

    by luni
    Replies
    354
    Views
    60,305

    I just published a new release of the...

    I just published a new release of the TeensyTimerTool (v1.0.1) .

    Two main changes:
    To be compatible with the new toolchain (1.58beta) I needed to remove the capability to enter timer periods in...
  11. Replies
    2
    Views
    139

    :-) know that feeling... My solution is to use...

    :-) know that feeling...

    My solution is to use the TyTools https://github.com/Koromix/tytools for uploading and monitoring.
    Here one of my platformio.ini files (windows, changing for other OS...
  12. Replies
    34
    Views
    843

    There is some news on this: I meanwhile found...

    There is some news on this:
    I meanwhile found some very interesting code in a (german) c++ forum...
  13. Replies
    9
    Views
    271

    Great, to use it more efficiently it might be...

    Great, to use it more efficiently it might be good to know that you can reserve more than one slot


    using callbackHelper_t = CallbackHelper<void(void), 10>;


    would give you 10 slots for...
  14. Replies
    9
    Views
    271

    I meanwhile switched attachInterruptEx from...

    I meanwhile switched attachInterruptEx from std::function to the CallbackHelper as well. As expected, it reduces the memory footprint massively. @Paul, unfortunately my scope is way to slow to do...
  15. Understandable...

    Understandable...
  16. Great, I'll give it a try later.

    Great, I'll give it a try later.
  17. If I compile with using std=gnu++17 instead of...

    If I compile with using std=gnu++17 instead of the standard gnu++14, Arduino.h clashes with <chrono>. Including "Arduino.h" after <chrono> fixes this. I assume the clash is related to #defining...
  18. relocation truncated

    As mentioned some 1.5 years ago in the 1.54 beta thread (https://forum.pjrc.com/threads/66357-Teensyduino-1-54-Beta-7?p=274861&viewfull=1#post274861) there is an issue compiling the following simple...
  19. Replies
    9
    Views
    271

    I also had a lot of failures and super...

    I also had a lot of failures and super complicated code until I slowly understood how that stuff works. At the end it shrank down to just a few lines to get this amazing flexibility. But that's the...
  20. Replies
    9
    Views
    271

    CallbackHelper - fun with modern callbacks

    Inspired by this Thread https://forum.pjrc.com/threads/70986-Lightweight-C-callbacks, I tried how difficult it would be to implement a more modern callback API for hardware interrupts and user...
  21. That's great. Any chance you'd switch to gnu++17...

    That's great. Any chance you'd switch to gnu++17 as well?
  22. Replies
    34
    Views
    843

    @PaulStoffregen In case you are still interested:...

    @PaulStoffregen In case you are still interested: I meanwhile got capturing lambdas going as well without using std::function or dynamic memory of course :-). Looks like everything possible for...
  23. Replies
    34
    Views
    843

    It is both, best to give it a try. IIRC the LC is...

    It is both, best to give it a try. IIRC the LC is using nanoLib instead of newLib which brings down the memory requirements significantly
  24. To get an impression how fast digitalWriteFast is...

    To get an impression how fast digitalWriteFast is on a Teensy 4.x have a look here:

    https://forum.pjrc.com/threads/57185-Teensy-4-0-Bitbang-FAST?p=212236&viewfull=1#post212236
  25. Replies
    34
    Views
    843

    I didn't expect much performance penalty but only...

    I didn't expect much performance penalty but only 6 cycles is impressive. It also includes the additional indirection introduced by attachInteruptEx which adds a relay function which then calls the...
  26. Replies
    34
    Views
    843

    Sure, I don't propose to do this on the normal...

    Sure, I don't propose to do this on the normal attachInterrupt. But in case someone needs it one can just use attachInterruptEx(). It peacefully coexists with the standard version.

    Did you find...
  27. Replies
    34
    Views
    843

    To use captured lambdas attachInterupt would need...

    To use captured lambdas attachInterupt would need to have a std::function API. Fortunately this is not difficult to achieve. Copy the attached files to your sketch folder then this will work as...
  28. Replies
    34
    Views
    843

    I spent some time working out a proof of concept...

    I spent some time working out a proof of concept for a callback system fulfilling the requirements given in #1.



    avoiding heap allocation
    ability to call C functions
    static C++ functions...
  29. Replies
    34
    Views
    843

    Actually it is quite simple. The sequence...

    Actually it is quite simple. The sequence []{/*someCode;*/} instructs the compiler to generate a function for you, which takes no paramter, returns void, using the function body given in the braces...
  30. Replies
    34
    Views
    843

    Maybe I misunderstood, but wouldn't that be...

    Maybe I misunderstood, but wouldn't that be attachInterruptVector?

    If so, this should work out of the box:

    attachInterruptVector(IRQ_CSI,[]{OV7670.IRQHandler();});

    Addendum
    Or, if...
  31. Replies
    32
    Views
    452

    I remember seeing that error some time ago under...

    I remember seeing that error some time ago under completely different conditions (tested a newer toolchain). I don't know if it helps or if my observation is even related, but at that time I tracked...
  32. Replies
    34
    Views
    843

    Unfortunately (AFAIK) a free standing...

    Unfortunately (AFAIK) a free standing "my_inst.hello" (without following paranthesesis) is not a legal construct at all (would be nice but it isn't). Here some explanations and results of my trials...
  33. Replies
    34
    Views
    843

    That can't work for a non static member function...

    That can't work for a non static member function since the function invoking the callback needs to know the instance on which it shall invoke the member function. So, you need to pass that...
  34. Replies
    34
    Views
    843

    Yes, whatever you invent, at the end you need to...

    Yes, whatever you invent, at the end you need to pass a pointer to the instance somehow. However, std::function makes this very simple. Here an example which shows how to embedd a callback-provider...
  35. Replies
    34
    Views
    843

    I'm using std::function in the TimerTool and...

    I'm using std::function in the TimerTool and (modulo some teething troubles) it works without issues. The good thing is of course that it is compatible to the usual void(cb*)() callbacks. I'm sure...
  36. Replies
    12
    Views
    370

    Great! Another step to modern c++ compatibility...

    Great! Another step to modern c++ compatibility :-) I gave it a quick try, works out of the box.

    Here some demo code showing how to use it.


    #include "Arduino.h"
    #include <chrono>

    //...
  37. Replies
    12
    Views
    370

    If you are interested in std::chrono stuff you...

    If you are interested in std::chrono stuff you can see here https://github.com/TeensyUser/doc/wiki/Durations-Timepoints-and-Clocks how to use the basic building blocks and here...
  38. You're welcome. Let me know if you need some...

    You're welcome. Let me know if you need some support after you got the basic examples running.
  39. Did you try some of the library examples to check...

    Did you try some of the library examples to check if the hardware is working? E.g. the HelloStepper.ino? Does it work as intended? Always good to start from some firm ground...


    Documentation is...
  40. Replies
    8
    Views
    226

    See here...

    See here https://github.com/luni64/EncoderTool/tree/master/Resources/Extras for a few multiplexing examples using the EncoderTool. Corresponding code is in the examples folder
  41. Replies
    6
    Views
    390

    Maybe this helps? ...

    Maybe this helps? https://github.com/TeensyUser/doc/wiki/Raw-HID
  42. Replies
    8
    Views
    226

    You can give this...

    You can give this https://github.com/luni64/EncoderTool a try. It should be able to read your encoders. You can use both strategies (interrupt or polled) with the lib. I prefer the polled approach.
  43. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    1,017

    Just tested it, my setup needs some 200ns delay...

    Just tested it, my setup needs some 200ns delay to get a stable readout.

    Here the test code I used to read out the 3x5 encoder-array shown in #6.


    #include "Arduino.h"
    #include...
  44. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    1,017

    Yes, I tested it. Works nicely. However, the...

    Yes, I tested it. Works nicely.
    However, the board from the GitHub repo has a missing GND connection (need to fix that some time...).
    If you are using a T4.x make sure to wait some time after...
  45. Replies
    9
    Views
    250

    @defragster: nice test. I was wondering why the...

    @defragster: nice test. I was wondering why the lag time is so huge and had a look at the Teensyduino pin interrupt handler. Looks like there is only one pin interrupt for all pins. Therefore the pin...
  46. Thread: TeensyTimerTool

    by luni
    Replies
    354
    Views
    60,305

    As mentioned above, the setPeriod functionality...

    As mentioned above, the setPeriod functionality does not seem to work as intended (at least during my very first tests it didn't stop the period but did the same as SetNextPeriod()). I'll have a...
  47. Thread: TeensyTimerTool

    by luni
    Replies
    354
    Views
    60,305

    It is supposed to do the second. However, as...

    It is supposed to do the second.

    However, as joepasquariello mentioned, those functions are currently not implemented for the FTM timers. As a first fix I implemented the setNextPeriod() function...
  48. Thread: TeensyTimerTool

    by luni
    Replies
    354
    Views
    60,305

    SetPeriod is supposed to change the period of a...

    SetPeriod is supposed to change the period of a running timer, i.e. it is supposed to end the current period and start again with the new period (updatePeriod might have been a better name...)...
  49. Can you do a pull request for the missing file?

    Can you do a pull request for the missing file?
  50. https://github.com/luni64/TeensyStep4 Still...

    https://github.com/luni64/TeensyStep4

    Still quite sketchy but works in principle.
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4