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. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    907

    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...
  2. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    907

    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...
  3. Replies
    9
    Views
    160

    @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...
  4. Thread: TeensyTimerTool

    by luni
    Replies
    352
    Views
    59,408

    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...
  5. Thread: TeensyTimerTool

    by luni
    Replies
    352
    Views
    59,408

    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...
  6. Thread: TeensyTimerTool

    by luni
    Replies
    352
    Views
    59,408

    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...)...
  7. Can you do a pull request for the missing file?

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

    https://github.com/luni64/TeensyStep4

    Still quite sketchy but works in principle.
  9. Thinking a bit out of the box: You said you can't...

    Thinking a bit out of the box: You said you can't use the primary USB since you need that for uploading / debugging. So, what about using a simple USB switch like this:
    ...
  10. @KurtE does the solution you posted actually work...

    @KurtE does the solution you posted actually work with the secondary USB port?
  11. Since you are new here, it is quite difficult to...

    Since you are new here, it is quite difficult to judge your experience and knowledge with that stuff. This might lead to frustrating or unsatisfying answers. But believe me, usually the guys here are...
  12. 30MB will probably take about 2-3 minutes at...

    30MB will probably take about 2-3 minutes at 2MBaud that is not very convenient indeed.


    I don't think Kurts solution will reprogram the usb host as usb slave but maybe I misunderstood it. Here...
  13. I'd start with a simple serial connection and see...

    I'd start with a simple serial connection and see if that is fast enough. Might be that the SD card is the bottle neck anyway. How large are the files you need to transmit?
    Using the USB Host is...
  14. If I understand correctly, you want to transfer...

    If I understand correctly, you want to transfer data from the RPi to the Teensy. RPi and Teensy are connected to a PC for programming / debugging.

    If so, I'd do something like this:

    29007
    ...
  15. Replies
    6
    Views
    282

    Update is an internal function. As thebigg...

    Update is an internal function. As thebigg mentioned in #2, you can simply use write(pos) to set the current encoder value. Doesn't that work?

    Library Documentation:...
  16. Thread: TeensyTimerTool

    by luni
    Replies
    352
    Views
    59,408

    See here...

    See here https://github.com/luni64/TeensyTimerTool/wiki/Basic-Usage#finding-out-the-maximum-timer-period for information how to find out the max supported timer period for the various hard/software...
  17. Replies
    15
    Views
    660

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

    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...
  19. Of course you can. No restrictions on pins.

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

    by luni
    Replies
    352
    Views
    59,408

    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
  21. 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"...
  22. @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...
  23. 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...
  24. 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...
  25. Replies
    10
    Views
    372

    @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
  26. Replies
    10
    Views
    372

    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...
  27. 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
  28. 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...
  29. 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...
  30. 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...
  31. Thread: TeensyStep Help

    by luni
    Replies
    3
    Views
    210

    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...
  32. 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...
  33. Replies
    20
    Views
    579

    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?
  34. Replies
    20
    Views
    579

    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...
  35. 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...
  36. 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...
  37. 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...
  38. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    907

    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...
  39. 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...
  40. 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...
  41. Replies
    40
    Views
    1,136

    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 :-)
  42. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    907

    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...
  43. 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...
  44. 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?
  45. 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...
  46. 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....
  47. 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?
  48. 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...
  49. Thread: EncoderTool

    by luni
    Replies
    11
    Views
    907

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