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
    32
    Views
    374

    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...
  2. 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;
  3. Replies
    32
    Views
    374

    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 :-))
  4. Replies
    32
    Views
    374

    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.
  5. Replies
    32
    Views
    374

    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)....
  6. 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...
  7. 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...
  8. Replies
    32
    Views
    374

    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 :-)
  9. Replies
    32
    Views
    374

    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...
  10. Replies
    4
    Views
    103

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

    by luni
    Replies
    331
    Views
    55,112

    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?
  12. Replies
    7
    Views
    108

    Thats nice indeed :-)

    Thats nice indeed :-)
  13. Thread: TeensyTimerTool

    by luni
    Replies
    331
    Views
    55,112

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

    by luni
    Replies
    331
    Views
    55,112

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

    by luni
    Replies
    331
    Views
    55,112

    I just saw that you are using the depricated...

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

    by luni
    Replies
    331
    Views
    55,112

    If you tell me where you have problems to...

    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...
  17. Replies
    7
    Views
    108

    Either one as long as you stick to it :-)

    Either one as long as you stick to it :-)
  18. Replies
    7
    Views
    108

    Not a good idea to ask the same question in two...

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

    by luni
    Replies
    331
    Views
    55,112

    Your code is a bit convoluted. The problems you...

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

    by luni
    Replies
    331
    Views
    55,112

    Whatever timer you use, the drift will always be...

    Whatever timer you use, the drift will always be the drift of the corresponding crystal (IIRC: ~20ppm). If you need less you might be better off with a clock module like this one...
  21. Replies
    7
    Views
    126

    Ah, that makes sense. Let me know if you need...

    Ah, that makes sense.
    Let me know if you need further support with TeensyStep
  22. Replies
    7
    Views
    126

    As mentioned in #2 you must not call a move...

    As mentioned in #2 you must not call a move command while the motor is still moving. The code in #1 calls moveAsync every 2 seconds regardless if the motor moves or not. -> the movement will be...
  23. Replies
    7
    Views
    126

    It is running from a timer interrupt. I.e., the...

    It is running from a timer interrupt. I.e., the moveAsync() sets up all parameters for the movement and starts a timer which generates the pulses, adjusts the timing as needed and keeps track of the...
  24. Replies
    7
    Views
    126

    moveAsync is not blocking (hence the name). In...

    moveAsync is not blocking (hence the name). In loop you call moveAsync every 2 seconds, i.e. you call moveAsync while the motor still runs which will mess up the controller. Try using...
  25. Replies
    6
    Views
    148

    Looks like you are using a stock gcc compiler....

    Looks like you are using a stock gcc compiler. Teensyduino expects some math libs copied into the gcc folders. See here...
  26. Thread: TeensyTimerTool

    by luni
    Replies
    331
    Views
    55,112

    Please test and let me know if it works for you...

    Please test and let me know if it works for you before I push it to the master branch.


    As defragster mentioned, all TCK timers (TCK, TCK64, TCK_RTC) run from yield. Anyway, I never had issues ...
  27. Thread: TeensyTimerTool

    by luni
    Replies
    331
    Views
    55,112

    Pushed a test version to the RemainingTime...

    Pushed a test version to the RemainingTime branch. Here a usage example:



    #include "TeensyTimerTool.h"
    using namespace TeensyTimerTool;

    OneShotTimer t1(TCK64);

    volatile bool start = true;
  28. Thread: TeensyTimerTool

    by luni
    Replies
    331
    Views
    55,112

    Currently not but I can have a look later this...

    Currently not but I can have a look later this weekend. There is no FTM64 did you mean TCK64?
  29. Replies
    5
    Views
    211

    Looks like you want a timer interrupt? If so,...

    Looks like you want a timer interrupt? If so, use the IntervalTimer which is the native timer for all ARM Teensies.



    IntervalTimer t1;

    void onTimer()
    {
    ...
  30. Replies
    8
    Views
    223

    I had a closer look at the StreamUtils ...

    I had a closer look at the StreamUtils library which is quite nice. The StringStream is really useful for converting printables like a crashreport to Strings:



    #include "StreamUtils.h"

    void...
  31. Replies
    8
    Views
    223

    Yes, the streamUtils library seems to be an...

    Yes, the streamUtils library seems to be an overkill for this. (However the library looks very interesting for other stuff).

    The code shown in #3 could be done much simpler, unfortunately a bug...
  32. Replies
    8
    Views
    223

    Actually CrashReport derives from Printable not...

    Actually CrashReport derives from Printable not Stream. Anyway, you can easily capture the content of a printable object with the following helper class. The constructor of the StringDumper "prints"...
  33. Try this: Adafruit_SSD1306 dispay[] { ...

    Try this:



    Adafruit_SSD1306 dispay[]
    {
    {SCREEN_WIDTH, SCREEN_HEIGHT, &Wire2, OLED_RESET},
    {SCREEN_WIDTH, SCREEN_HEIGHT, &Wire2, OLED_RESET},
    {SCREEN_WIDTH, SCREEN_HEIGHT,...
  34. I had a look at TimerOne, actually it uses an FTM...

    I had a look at TimerOne, actually it uses an FTM Timer, not an IntervalTimer under the hood. Anyway, the Intervaltimer seems to be a better fit.
  35. TimerOne is a compatibility wrapper around the...

    TimerOne is a compatibility wrapper around the native IntervalTimer. So, unless you need to write code compatible to AVR you'd be better of with an IntervalTimer. This code generates a 50Ás pulse...
  36. Replies
    5
    Views
    157

    Here the link to said 64bit code...

    Here the link to said 64bit code https://github.com/TeensyUser/doc/wiki/Using-the-cycle-counter
  37. Replies
    0
    Views
    127

    List of all instances of a class

    I added a helper class which automatically maintains a list of all currently existing instances of a class to my TeensyHelpers repository.

    Such a thing comes in handy if you design a class which...
  38. Replies
    22
    Views
    2,592

    https://github.com/Koromix/tytools/releases

    https://github.com/Koromix/tytools/releases
  39. Comparing the addresses of the port objects as...

    Comparing the addresses of the port objects as you did is perfectly OK. The only 'drawback' (if at all) is, that it needs to be done at runtime (if the compiler is not able to optimize it away...)
    ...
  40. Replies
    18
    Views
    680

    Reading out encoders and communicating the values...

    Reading out encoders and communicating the values to the PC are two completely different stories. You don't need to add 16 encoders to the 4067, 8 will work just as well. Or you use the 4051 which is...
  41. Replies
    18
    Views
    680

    Using the EncoderTool...

    Using the EncoderTool (https://github.com/luni64/EncoderTool) you can easily multiplex rotary encoders and their pushbuttons which reduces the number of needed digital pins significantly. Here some...
  42. Replies
    2
    Views
    147

    The connection you described in your connection...

    The connection you described in your connection scheme is definitely wrong and can't work. You need to connect the channels A and B to the input pins 1 and 3 and the common pin C to GND. However,...
  43. Replies
    68
    Views
    2,819

    My gut feeling is this will get unstable with 6...

    My gut feeling is this will get unstable with 6 motors. Your 2MHz Manchester stream generates a lot of data which needs to be copied around and analyzed. Plus, there are only 4 HW quadrature decoders...
  44. Replies
    68
    Views
    2,819

    Does anything speak against a simple: void...

    Does anything speak against a simple:


    void setup()
    {
    while (!Serial) {}

    DMAChannel dma;

    // code that sets valReg programmatically here
  45. Replies
    68
    Views
    2,819

    First, I'm no expert in DMA at all so take the...

    First, I'm no expert in DMA at all so take the following information with a grain of salt.
    The DMA (direct memory access) controller is able to copy data from one location to another location using...
  46. Replies
    68
    Views
    2,819

    DMA based decoder

    I just uploaded a DMA based version. The DMA setup is surprisingly simple. Here the relevant code. Full version here...
  47. Replies
    68
    Views
    2,819

    Even 100ns seems strange maybe Paul knows what's...

    Even 100ns seems strange maybe Paul knows what's running there with high priority or disabling interrupts when serial printing.
  48. Replies
    68
    Views
    2,819

    Actually I was thinking the same....

    Actually I was thinking the same. @PaulStoffregen: any idea which high priority (probably prio 0) interrupt runs for about 400-800 Ás? It seems to be related to the CDC interface. But the only USB...
  49. Replies
    68
    Views
    2,819

    Yes, here is the code which makes sure that the...

    Yes, here is the code which makes sure that the frames are read in consecutively...
  50. Replies
    68
    Views
    2,819

    Usually you want to separate the actual code (the...

    Usually you want to separate the actual code (the definition) from the declaration in the header. There are various reasons for that.

    If you have all the code in the header it needs to be...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4