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

  1. In case you are running under Windows you can...

    In case you are running under Windows you can have a look at VisualTeensy . It generates makefiles and all the required *.json files to use vsCode as an IDE. If you don't want to use vsCode you...
  2. Thread: One shot timer

    by luni
    Replies
    8
    Views
    387

    There are always ways to do things :-) ...

    There are always ways to do things :-)

    Originally, the library was designed to use one of the FTMs only -> only one TeensyDelay object would ever exist -> Having a class doesn't make sense -> I...
  3. Here a new release which should improve the first...

    Here a new release which should improve the first startup. It doesn't try to be smart anymore and simply provides a dialog to select an Arduino-folder manually instead. ...
  4. Thread: One shot timer

    by luni
    Replies
    8
    Views
    387

    Glad that it works. Just to make sure:...

    Glad that it works.



    Just to make sure: Did you see the possibility to manually set the prescaler in line 23 of the config? Setting this to small values gives you a sub Ás resolution. However,...
  5. That's true. I'll extend the search range a bit....

    That's true. I'll extend the search range a bit. Might also be good to have a dialog to manually set the Arduino location if it doesn't find one.
  6. Thread: One shot timer

    by luni
    Replies
    8
    Views
    387

    https://github.com/luni64/TeensyDelay might...

    https://github.com/luni64/TeensyDelay
    might work for you.
  7. VisualTeensy upgraded to support Teensy 4 projects

    Here the new release https://github.com/luni64/VisualTeensy/releases/tag/v0.9.7.0

    New features:
    - T4 compatible (tested compiling only so far, need to wait for my T4...)
    - Colored compiler...
  8. Replies
    79
    Views
    8,620

    Sorry, not yet. The timers of the T4 behave...

    Sorry, not yet. The timers of the T4 behave differently from those of the T3s. So, I need to rethink a few concepts to utilize the speed of the T4 which will take some time.
  9. Replies
    3
    Views
    59

    TeensySharp queries the WMI database (see...

    TeensySharp queries the WMI database (see https://en.wikipedia.org/wiki/Windows_Management_Instrumentation) to get the relevant information. Programming is done through the HID interface. ...
  10. Replies
    3
    Views
    59

    This of course depends on the language you are...

    This of course depends on the language you are using on the PC.

    In case of c#, you can have a look at TeensySharp https://github.com/luni64/TeensySharp. It finds the ComPorts and serial numbers of...
  11. Replies
    4
    Views
    98

    Here https://godbolt.org/z/FdhuYq is what gcc...

    Here https://godbolt.org/z/FdhuYq is what gcc makes out of

    int test(int x, int y)
    {
    return x % y;
    }


    Not much to optimize I guess. Anyway, you can change the code in the compiler...
  12. An Octopart search shows plenty of EU...

    An Octopart search shows plenty of EU distributors. https://octopart.com/hfw8r-1ste1lf-amphenol+icc-90335451?r=sp&s=gTtl6o9rSF-hi7xJEviQyw

    E.g. Farnell has 4000 on stock.
  13. I think you got that slightly wrong. As long as...

    I think you got that slightly wrong.
    As long as there is enough buffer the print/write functions copy their stuff to the buffer and return immediately. If there is not enough buffer left, they will...
  14. deleted ------

    deleted ------
  15. If you are interested in some data: The...

    If you are interested in some data:

    The sketch from above (#10) ran for about 3h. It generated a total number of ~100 Mio ISR calls @1Ás sample period and transferred some 2.3GByte over...
  16. Here a version which runs with a sampling rate of...

    Here a version which runs with a sampling rate of 1Ás, I still do not see any need for the Serial.availableForWrite.
    Runs for an hour now on Win10 and TyCommander.


    #include "Arduino.h"
    ...
  17. Ups, didn't read carefully.... Anyway, looks like...

    Ups, didn't read carefully.... Anyway, looks like the unnecessary availableForWrite is the root cause of the problem...
  18. Just tried it with MICRO_SECONDS_PER_SAMP (50)...

    Just tried it with MICRO_SECONDS_PER_SAMP (50)
    Works without a problem...

    (you might want to increase the last delay in loop if you go further down to not overrun your serial monitor. TyCommander...
  19. I tried your code and could reproduce the hanging...

    I tried your code and could reproduce the hanging after some time.

    I don't know what the "Serial.availableForWrite()" is, never saw that. Usually you can just print. Teensy will simply wait if it...
  20. Replies
    14
    Views
    217

    Yes. BTW there is no such thing as a 1M baudrate...

    Yes. BTW there is no such thing as a 1M baudrate for the USB Serial. It will always transmit with the full USB speed.

    Here a (very) basic example how to read serial data from the Teensy in c#

    ...
  21. Replies
    14
    Views
    217

    As promised, a minimal example which compiles and...

    As promised, a minimal example which compiles and works. The Teensy firmware repeatedly sends a raw hid frame where the first byte contains a counter to the PC. The PC software waits until it...
  22. Replies
    14
    Views
    217

    HID is limited to 64kB /s. 5x32bit @ 10kHz gives...

    HID is limited to 64kB /s. 5x32bit @ 10kHz gives 200kB/s that is going to be difficult :-)
  23. Replies
    14
    Views
    217

    Never had any latency problems with Serial and c#...

    Never had any latency problems with Serial and c# but that of course depends on the requirements. However, I'm not sure if HID will be better (latency is probably more a USB problem).
    Anyway, never...
  24. Replies
    14
    Views
    217

    Do you want to send the data via Serial or via...

    Do you want to send the data via Serial or via HID?
  25. Replies
    5
    Views
    456

    I'm using a Segger JTag Edu and just ordered a...

    I'm using a Segger JTag Edu and just ordered a JTag-Mini (for ~$20). This works great for Teensy debugging especially with vscode which has a supporting extension (Cortex-Debug) . However, you...
  26. Replies
    10
    Views
    229

    Are you sure that you need to filter that spikes?...

    Are you sure that you need to filter that spikes? The algorithm (and probably any other quadrature algorithm) should be immune to those and should just ignore it.
    I used the algorithm from this...
  27. Replies
    10
    Views
    229

    Glad it works so far. I don't know all common...

    Glad it works so far. I don't know all common libs of course but since there are 4 intervalTimers available it is not likely that all are used by other libraries.



    The sampling period is...
  28. Replies
    10
    Views
    229

    I usually prefer a sampling scheme instead of...

    I usually prefer a sampling scheme instead of using interrupts for high speed encoders. Here a thread with more info showing how to do that for 6 encoders. ...
  29. It of course depends on what "control four...

    It of course depends on what "control four brushed DC motors" actually means, at what speed (step frequency) you need to move your stepper and what else you plan to do with the Teensy. But, I'm quite...
  30. For the LEDs I'd use a driver like the TLC5947...

    For the LEDs I'd use a driver like the TLC5947 (24 PWM channels, SPI) here a breakout board: https://www.adafruit.com/product/1429 There are lot of others as well, just look for multichannel led...
  31. Sorry, forget #2, I didn't notice that you...

    Sorry, forget #2, I didn't notice that you actually did reserve channel 0 and channel 4.
    Can't test it right now but it seems to be the following problem:

    When pulse is true you trigger channel...
  32. In your callbackA you trigger channel 4? You only...

    In your callbackA you trigger channel 4? You only assigned two channels. There is an example showing how to handle more than one channel.
    Btw. You can directly trigger the channel from your pin...
  33. Im currently on a vacation bicycle trip. Hard to...

    Im currently on a vacation bicycle trip. Hard to explain on the mobile. Basically you record the time for different number of loops. Draw a loops Vs time graph in any spread sheet app or manually....
  34. I can confirm that. Since they are so cheap I...

    I can confirm that. Since they are so cheap I sometimes mount them together with a small hub in the device enclosure and connect them to a few debug pins. Very convenient during development...
  35. I added a DigitalWrite(3, HIGH) at the beginning...

    I added a DigitalWrite(3, HIGH) at the beginning of the ISR and a DigitalWrite(3, LOW) at the end and used a cheap LA to measure the duration of the resulting peak on pin 3 for various iteration...
  36. I did a quick measurement and got some 50ns for a...

    I did a quick measurement and got some 50ns for a constant DigitalWriteFast and some 80ns with variable pin number.
    Instead of using DigitalReadFast with variable pins from an array you can also...
  37. Just an untested idea: can it be that reading the...

    Just an untested idea: can it be that reading the 16 lines with variable pin numbers simply takes too long, so that the interrupt will be called again immediately after it finishes? (It is much...
  38. Yes that looks OK. Remark: When you are...

    Yes that looks OK.

    Remark: When you are unsure it is always good to add the units to the calculation. You can then easily spot errors.


    (11000 stp/sec) / (2.5 stp/mm) = 4400 mm/sec
    (4400...
  39. I can recommend Octopart (a meta search machine)....

    I can recommend Octopart (a meta search machine). It has a very good search engine and you can easily select distributors. Personally, I often buy at TME. The link below shows TME and Farnell as an...
  40. This should do what you want: #include...

    This should do what you want:



    #include "TeensyStep.h"

    // since you know how to transform from mm to steps we can as well
    // assume that 1 step = 1mm

    int s = 6000; // total...
  41. I can give you a more detailed answer later today...

    I can give you a more detailed answer later today but I think all you need to do is calculate the acceleration you need for your movement.

    Standard kinematic formulas are (out of my head without...
  42. Try adding a pull down resistor, say 4k7 to the...

    Try adding a pull down resistor, say 4k7 to the pin. During the upload the Teensy pin will float which might generate the observed effect.
  43. Thanks again for finding all those bugs! Very...

    Thanks again for finding all those bugs! Very helpful indeed.
    It might be easier to continue this discussion on GitHub. I opened an issue here: https://github.com/luni64/TeensyStep/issues/47
  44. I tried this but it seems to work as it should....

    I tried this but it seems to work as it should. Here the LA output. (The peaks shown in the third trace are generated directly after the stop commands)

    16619


    This is already fixed in the...
  45. Replies
    3
    Views
    198

    Yes it does. To be precise each controller...

    Yes it does. To be precise each controller requires its own timer. But as Theremingenieur pointed out, there are 4 of them. So if you use less than 4 TeensyStep controllers you'll have spare interval...
  46. Replies
    5
    Views
    396

    Just installed the May update (0.23.0) of the...

    Just installed the May update (0.23.0) of the c/c++ extension which seems to fix a lot of the intellisense issues. At least for me it now reliably finds the headers. However, I'm not using...
  47. I did some experiments on your problem and came...

    I did some experiments on your problem and came up with a quite simple and obvious solution. The only reason why the number of controllers was limited to a total number of 4 was that each controller...
  48. index() is defined as a function in string.h....

    index() is defined as a function in string.h. This function seems to be deprecated but it looks like the ARM compiler used for Teensy 3 still implements it. I assume that the AVR compiler for...
  49. Replies
    8
    Views
    403

    For a quick check you can also use the compiler...

    For a quick check you can also use the compiler explorer:

    https://godbolt.org/z/gmpL_J

    I like how the compiler implements bad() :-)
  50. This is fixed now! The problem only occurred when...

    This is fixed now! The problem only occurred when using default speed settings and not calling setMaxSpeed. Now it should work correctly for default values as well. Thanks for spotting that one.

    ...
Results 1 to 50 of 461
Page 1 of 10 1 2 3 4