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. Replies
    15
    Views
    429

    I have not much experience with MIDI. Just...

    I have not much experience with MIDI. Just wondering if it is OK to send those messages every 10ms? The encoder library will generate a lot of fast up/down counts if the encoder bounces (which is...
  2. Replies
    3
    Views
    168

    As Kurt mentioned the usual way is to use...

    As Kurt mentioned the usual way is to use objdump.exe.

    Here an example using PlatformIO:
    After compiling, go to the vsCode terminal and cd to your build directory cd...
  3. Of course you can. No restrictions on pins.

    Of course you can. No restrictions on pins.
  4. Thread: TeensyTimerTool

    by luni
    Replies
    333
    Views
    56,178

    Sorry, the TimerTool does not implement any PWM...

    Sorry, the TimerTool does not implement any PWM functionality. However, the features of the 32bit GPT timers look promising for this.

    Yes
  5. Yes, __has_include works nicely for the standard...

    Yes, __has_include works nicely for the standard use case (I'm using it for the TeensyTimerTool)



    #if defined __has_include
    # if __has_include("optional.h")
    # include "optional.h"...
  6. @Kurt, I don't know if you read #4. I also...

    @Kurt, I don't know if you read #4.
    I also thought that this is an Arduino issue first, but it turned out (see Edit in #4) that GCC is simply ignoring the #include after the __has_include. Thus...
  7. Question is what does "is using SD library"...

    Question is what does "is using SD library" actually mean? IMHO, the only thing you can detect with __has_include is, if the build sytem added the corresponding -Ipath/to/the/lib directives to the...
  8. Your xyz.h looks broken. #ifndef _XYZ_H_ #...

    Your xyz.h looks broken.


    #ifndef _XYZ_H_
    # define MTP_Storage_H
    # if defined(__has_include) && __has_include(<SD.h>)
    # pragma message " __has_include(<SD.h>"
    # include...
  9. Replies
    10
    Views
    233

    @BriComp: Yes the link is into the user wiki ...

    @BriComp: Yes the link is into the user wiki

    @Robber: Yes you can atomically copy a uint32_t on the 32bit ARM Teensies. No need to disable interrupts
  10. Replies
    10
    Views
    233

    Google is much better than the forum search. If,...

    Google is much better than the forum search. If, for example, you search for this:
    site:forum.pjrc.com joepasquariello after:2022-01-01
    you'll get all your forum posts from this year.

    Some...
  11. Good to hear that it works for you now. Have fun...

    Good to hear that it works for you now. Have fun with the TimerTool
  12. Makes sense. Did you try increasing the priority...

    Makes sense. Did you try increasing the priority of the timer interrupt?



    Also makes sense. If you look at the TimerTool config file you see that the TMR runs with the default prescaler of...
  13. Probably not. Due to the architecture of the chip...

    Probably not. Due to the architecture of the chip the internal busses need some time to sync data. This adds some waiting time at the end of the ISR. The larger the difference of the frequency of...
  14. Just a guess without testing: Per default the PIT...

    Just a guess without testing: Per default the PIT runs at 24MHz only. This can generate some relatively large bus sync waiting times. So 1MHz interrupt rate together with your relatively large code...
  15. Thread: TeensyStep Help

    by luni
    Replies
    2
    Views
    108

    I'm afraid you can't do this with the current...

    I'm afraid you can't do this with the current library but tweaking it a bit could help:

    I don't know anything about micro_ros but it looks like timer interrupts are handled without waiting for a...
  16. Wow, running Freecad on the RPI! Didn't know that...

    Wow, running Freecad on the RPI! Didn't know that the RPI is that fast by now... I use onshape for mech design. It runs in the browser (no installation required) and is quite state of the art. As...
  17. Replies
    20
    Views
    368

    Interesting. Using the constructor fixed it for...

    Interesting. Using the constructor fixed it for the shown example. Can you post a more complete example using your struct showing the effect?
  18. Replies
    20
    Views
    368

    Wild guess: Can it be that your object of S lives...

    Wild guess: Can it be that your object of S lives in DMAMEM (e.g. new/malloc). This memory is not initialized. Since the ShortName will be assigned the address of SomethingWithALongName at...
  19. Yes it is, and it is not necessary. As already...

    Yes it is, and it is not necessary. As already written in #6 all you need to do is to place
    #include "Arduino.h" in the very first line of your main.cpp.

    Additionally, add the USBHost_t3.6...
  20. I just realized that the code you posted is your...

    I just realized that the code you posted is your complete application. All you need to do is adding an #include "Arduino.h" at top of the file and adding the USB Host library to the project. It then...
  21. Did you include "arduino.h" in main.cpp?...

    Did you include "arduino.h" in main.cpp? VisualTeensy is using plain cpp and does nothing behind your back (as one of its design goals). I.e., you need to include "Arduino.h", you need to forward...
  22. Thread: EncoderTool

    by luni
    Replies
    6
    Views
    414

    I did a draft of a Encoder Matrix Proto board....

    I did a draft of a Encoder Matrix Proto board. The idea is that one can start developing without the tedious wiring of a lot of encoders. After development the board can be easily cut or broken or...
  23. I just had a look at the library code. You can...

    I just had a look at the library code. You can simply attach a nullptr to remove the callback.
    I.e.:



    SpindleEnc.attachCallback(onEncoderChanged); // attaches onEncoderChanged to SpindleEnc...
  24. Are you sure that you want to change the pitch...

    Are you sure that you want to change the pitch while the spindle rotates? Thinking of the noise the breaking thread tool makes gives me goose bumps :-))

    Seriously;

    In your controlling...
  25. Replies
    40
    Views
    725

    See also here...

    See also here https://forum.pjrc.com/threads/70264-EncoderTool?p=306250&viewfull=1#post306250 for a proposal to read out 190 encoders with one Teensy, without additional hardware :-)
  26. Thread: EncoderTool

    by luni
    Replies
    6
    Views
    414

    I was thinking of a simple shift register, but...

    I was thinking of a simple shift register, but then I thought why bother with external parts, when a Teensy can directly read out the matrix even faster.

    28413

    A quick calculation gives the...
  27. That was easy ;-) You print the current...

    That was easy ;-)
    You print the current position in the encoder callback. At high encoder speeds the printing is not yet done when it tries to invoke the callback again. This will basically lock...
  28. Thanks, I'll have a closer look later. So, I'll...

    Thanks, I'll have a closer look later. So, I'll disable the touchdisplay stuff, attach EncSim to pin 0/1 and see if it crashes at about 200kHz right?
  29. The Error_Callback is a left over from...

    The Error_Callback is a left over from development and it not working anymore. I'll remove the leftover code in the next update. The error callback was invoked whenever the internal state machine...
  30. Feel free to post your program or a link to it...

    Feel free to post your program or a link to it for a review. My experience is that you can stare for days at some code and don't find a bug while someone else with fresh eyes might see it in minutes....
  31. There is not much syntax to understand. A simple...

    There is not much syntax to understand. A simple "spindleEnc.setValue(0);" should reset the counter. What exactly doesn't work?
  32. I thought you are interested if the spindle...

    I thought you are interested if the spindle encoder code looses counts? So the stepper shouldn't be an issue for the test right? Just check if the encSim count equals the spindle counts your program...
  33. Thread: EncoderTool

    by luni
    Replies
    6
    Views
    414

    Inspired by this...

    Inspired by this https://forum.pjrc.com/threads/70233-Using-Teensy-for-big-MIDI-control-surface and the apparent lack of 23S17 IO Expanders I was thinking of yet another encoder multiplexing scheme...
  34. I can reproduce that. Looks like the binary has...

    I can reproduce that. Looks like the binary has some issues. Can you try the attached file? The procedure you described is perfectly OK.
  35. Thread: EncoderTool

    by luni
    Replies
    6
    Views
    414

    EncoderTool

    Here you go :-)

    A few links:

    Repo: https://github.com/luni64/EncoderTool
    Documentation: https://github.com/luni64/EncoderTool/blob/master/Documentation/Overview.md
    Schematics:...
  36. Oh, both variables c0 and c1 need to be int32_t...

    Oh, both variables c0 and c1 need to be int32_t not uint32_t. Sorry for the confusion (never post untested code :-))



    Great, if it works just stick with it.




    Take a second Teensy and...
  37. Replies
    40
    Views
    725

    Just had a look at Octopart. There are plenty at...

    Just had a look at Octopart. There are plenty at "unsusal" suppliers. https://octopart.com/search?q=mcp23S17&currency=USD&specs=0&in_stock_only=1 (click on "show all" below the standard distributor...
  38. Sure, something like this should work (untested,...

    Sure, something like this should work (untested, first value will be wrong)



    #include "Arduino.h"
    #include "EncoderTool.h"

    using namespace EncoderTool;

    Encoder spindleEnc;
  39. Replies
    40
    Views
    725

    Oh, that's bad. I assume you checked all the...

    Oh, that's bad. I assume you checked all the usual sources... Just saw RSComponents has 3 on Stock but a MOQ of 5 :-))
  40. Replies
    40
    Views
    725

    Your'e welcome. Make sure to get a MCP23S17...

    Your'e welcome.
    Make sure to get a MCP23S17 which is the SPI version. The MCP23017 are I2C which is slower.
  41. Replies
    40
    Views
    725

    Here an example how to use a MCP23S17 to read out...

    Here an example how to use a MCP23S17 to read out encoders with the EncoderTool (working example here: https://github.com/luni64/EncoderTool/tree/master/examples/2_multiplexing/multiplexed_MCP23S17)....
  42. The nice thing about this approach is, the whole...

    The nice thing about this approach is, the whole thing runs completely in the background. Your foreground code can do whatever it wants, as long as it doesn't disable interrupts your leadscrew will...
  43. If you don't find a possibility to do non...

    If you don't find a possibility to do non blocking writes to the display you might consider a different approach:

    If you can assure that the number of encoder counts per spindle rev is always...
  44. Replies
    40
    Views
    725

    Yes, I just looked through my stock of bought but...

    Yes, I just looked through my stock of bought but never used parts and found a couple of 23S017. Starting to rain here. So, extending the EncoderTool might be a nice weekend project :-)
  45. Replies
    40
    Views
    725

    Discussions about encoder readout strategies seem...

    Discussions about encoder readout strategies seem to always end up like windows vs. linux discussions :-)

    I'm the author of the EncoderTool library which, to avoid those discussions, supports...
  46. Replies
    4
    Views
    125

    Thanks for the shout out but the TimerTool only...

    Thanks for the shout out but the TimerTool only uses the timing functions, counting is a different thing. I recommend manitous collection of snippets https://github.com/manitou48/teensy4 instead. You...
  47. Thread: TeensyTimerTool

    by luni
    Replies
    333
    Views
    56,178

    Thanks, I'll have a look. But this will take some...

    Thanks, I'll have a look. But this will take some time (working on another project currently...)
    Quick Idea, can you change the GPT1/GPT2 to PIT and see if it works then?
  48. Replies
    7
    Views
    135

    Thats nice indeed :-)

    Thats nice indeed :-)
  49. Thread: TeensyTimerTool

    by luni
    Replies
    333
    Views
    56,178

    setPeriod changes the period immediately. I.e.,...

    setPeriod changes the period immediately. I.e., it will end the current period and restart the timer with the new period. setNextPeriod is supposed to set a new period after the current one is done...
  50. Thread: TeensyTimerTool

    by luni
    Replies
    333
    Views
    56,178

    Ups, thought I had changed them all. Thanks for...

    Ups, thought I had changed them all. Thanks for spotting this.

    You change the period by t1.setPeriod(...)


    Great, hope you show the progress here. At least I'd be very interested.

    Long...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4