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 very likely). So, your...
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 .pio/build/whatever_board_you_are_compiling_for....
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"
# else
# ...
@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 Arduino never sees the...
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 compiler call? Maybe...
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 time ago I summarized...
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 128. (see here:...
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 the CPU to that of the...
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 in the ISR might...
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 time slice,...
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 long as you can live...
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 construction time it simply...
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 library to the Project...
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 compiles without an...
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 declare functions and...
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 extended to fit the...
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...
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 application I'd require that...
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 :-)
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.
A quick calculation gives the following formulas for the...
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 the system.
I moved...
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 detects an A/B pattern...
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.
It will use...
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 detects.
Might...
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 which might handle...
Here you go :-)
A few links:
Repo: https://github.com/luni64/EncoderTool
Documentation: https://github.com/luni64/EncoderTool/blob/master/Documentation/Overview.md
Schematics:...
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 upload one of th...
Just had a look at Octopart. There are plenty at "unsusal" suppliers. https://octopart.com/search?q=mcp23S17¤cy=USD&specs=0&in_stock_only=1 (click on "show all" below the standard distributor list)
Sure, something like this should work (untested, first value will be wrong)
#include "Arduino.h"
#include "EncoderTool.h"
using namespace EncoderTool;
Encoder spindleEnc;
IntervalTimer speedTimer;
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). If you want to use...
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 magically follow your...
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 more than the number of...
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 :-)
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 both strategies :-). As...
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 will probably find...
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?
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 to prevent partial...
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 time ago I was...
I just saw that you are using the depricated Timer API. You should have got a corresponding warning from the compiler!
Instead of
Timer t1(GPT1);
say
PeriodicTimer t1(GPT1);
If you tell me where you have problems to understand it I can try to explain. Your code basically does the same but a bit more verbose.
You can use both GPT1 or GPT2. Setting it to 150MHz will certainly improve...
Not a good idea to ask the same question in two threads....
see here: https://forum.pjrc.com/threads/59112-TeensyTimerTool?p=305466&viewfull=1#post305466 for an answer
Your code is a bit convoluted. The problems you get are probably due to the short period and the relatively (to the calling period) long blocking in the callbacks.
I'd do something like this:
#include...