Forum Rule: Always post complete source code & details to reproduce any issue!
Tab Content
  • luni's Avatar
    Today, 08:24 AM
    IIRC, the ATMEL studio it handles ATMEL chips only, i.e. AVR, SAM.... Teensy uses NXP processors, I doubt that you can use ATMEL Studio for NXP processors. The ATMEL Studio is using a very old version of...
    4 replies | 150 view(s)
  • luni's Avatar
    Yesterday, 06:52 PM
    luni replied to a thread EncoderTool in General Discussion
    Let me know if you run against a wall
    50 replies | 4526 view(s)
  • luni's Avatar
    Yesterday, 06:36 PM
    luni replied to a thread EncoderTool in General Discussion
    Did you see the example showing how to use the 23S17 (SPI version of the chip) https://github.com/luni64/EncoderTool/blob/master/examples/2_multiplexing/multiplexed_MCP23S17? If you need the I2C version, adapting the...
    50 replies | 4526 view(s)
  • luni's Avatar
    Yesterday, 07:29 AM
    You would need to set your ATMEL Studio to the toolchain which is used by Teensyduino and use the same compiler switches. But this would be the same as using the Arduino IDE and select a Teensy board. So, I'm afraid you...
    4 replies | 233 view(s)
  • luni's Avatar
    Yesterday, 06:24 AM
    You can not link an object file compiled for one processor to an object file compiled for another processor. Object files contain the actual machine code which is totally dependent on the processor.
    4 replies | 233 view(s)
  • luni's Avatar
    05-24-2023, 08:14 PM
    luni replied to a thread EncoderTool in General Discussion
    Sounds good. Thanks a lot for testing!
    50 replies | 4526 view(s)
  • luni's Avatar
    05-24-2023, 06:15 PM
    luni replied to a thread EncoderTool in General Discussion
    Should work with 1.58 out of the box. Thanks for testing
    50 replies | 4526 view(s)
  • luni's Avatar
    05-24-2023, 05:25 PM
    luni replied to a thread EncoderTool in General Discussion
    @clinker8 I need to fix an EncoderTool issue for the ESP32. To fix it, I need to touch the part of the code which generated the compile issue you had some months ago. Can I talk you into trying the code in the...
    50 replies | 4526 view(s)
  • luni's Avatar
    05-22-2023, 07:19 AM
    These encoders are just mechanical switches. If you can not pull the pin down, something is probably wrong with the encoder or your wiring. Here what I usually do in such cases...
    15 replies | 596 view(s)
  • luni's Avatar
    05-21-2023, 04:30 PM
    If you don't have a harsh environment, you can simply connect the C pin to GND and directly connect A/B to the Teensy. Just use pinmode(INPUT_PULLUP) for the pins. No need for resistors or capacitors. The quadrature...
    15 replies | 596 view(s)
  • luni's Avatar
    05-21-2023, 04:14 PM
    Actually you don't even need the surrounding struct you can directly put/get your array: #include <EEPROM.h> float focusCalib12]4]; void setup() { EEPROM.put(0, focusCalib); EEPROM.get(0, focusCalib);
    29 replies | 11130 view(s)
  • luni's Avatar
    05-18-2023, 11:33 AM
    Are you sure your USB cable is good for 480Mb/sec? Cheap/old cables may be certified for 12Mbit only
    2 replies | 94 view(s)
  • luni's Avatar
    05-14-2023, 02:20 AM
    Yes, but did you look at the memory consumption? Last time I tried it was some 300kB :-(
    84 replies | 4934 view(s)
  • luni's Avatar
    05-13-2023, 06:38 PM
    luni replied to a thread random() in General Discussion
    Seems to be the usual clash with the arduino #defines for abs, round etc. Try to #undef them. IIRC mjs513 already has a PR removing those #defines from the core Edit: Here it is:...
    12 replies | 2676 view(s)
  • luni's Avatar
    05-13-2023, 04:55 PM
    luni replied to a thread random() in General Discussion
    Random returns uint32_t if its parameters are uint32_t. However, as you observed, it only returns values from 0 to 2^31. Same for the standard C "rand()" function. C++ provides much better random generators in its...
    12 replies | 2676 view(s)
  • luni's Avatar
    05-08-2023, 10:33 AM
    Works here using IDE 2.1.0. Adds a folder "build" to the sketch folder which contains this: For small snippets I like the compiler explorer, it life-generates the asm while you type your c++ code. Here an...
    6 replies | 195 view(s)
  • luni's Avatar
    05-08-2023, 07:30 AM
    Would be good to add the same info to the IntervalTimer::update function which also accepts floats. You might also consider removing the leftover specialization of the update function (see PR701)
    7 replies | 244 view(s)
  • luni's Avatar
    05-04-2023, 02:41 PM
    luni replied to a thread Help with Coding in Project Guidance
    You declared your struct "testType" nested in the class TestHeader. This is OK but probably not what you want. If you want to access this type you need to fully qualify it. E.g. in Test.ino you need to write ...
    3 replies | 515 view(s)
  • luni's Avatar
    05-03-2023, 07:52 AM
    I have absolutely no stakes in it. I was just interested if Pauls statement from #2 is correct. If this behaviour of elapsedMillis should be fixed / documentend / ignored is another question which needs to be decided by...
    17 replies | 382 view(s)
  • luni's Avatar
    05-03-2023, 06:16 AM
    This is certainly a better definition than "something complicated" :-) But, even if I delcare stopwartch static, the println will trigger a reload of ms. Anyway, I think the example shows that elapsedMillis is not...
    17 replies | 382 view(s)
  • luni's Avatar
    05-03-2023, 05:02 AM
    I think Shawn is right. Below a simple example demonstrating the problem. A 1s timer is resetting the elapsedMillis variable `stopwatch` in its callback. In a tight loop the LED is switched on when the stopwatch value...
    17 replies | 382 view(s)
  • luni's Avatar
    04-25-2023, 03:49 PM
    Maybe another process opened the port and blocks it? Maybe you did open another uploader or Terminal and didn't close it, maybe some Zombie process? In those cases rebooting your PC should help. Does it upload after...
    24 replies | 680 view(s)
  • luni's Avatar
    04-24-2023, 07:32 AM
    This is what is autogenerated for a new Teensy (4.1) project. ; PlatformIO Project Configuration File ; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags...
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 06:42 PM
    I stand corrected. As usual: "If nothing helps, read the fucking manual" :-) https://docs.platformio.org/en/latest/platforms/teensy.html#platform-teensy One doesn't need to directly set the compiler flags, there are...
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 06:17 PM
    @pr8x: Here (windows) <user>\.platformio\packages\framework-arduinoteensy you find board.txt. Once you understand the unusual file format you can easily find the required info
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 05:46 PM
    The problem is that PIO doesn't have such a menu. You can easily set compiler options but you need to know that e.g. -Os goes with -specs=nano-spec in teensyduino. Something like a translation of the tools menu to...
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 05:28 PM
    Glad it works now. Have fun
    3 replies | 178 view(s)
  • luni's Avatar
    04-23-2023, 05:24 PM
    There are two versions of the standard library for this toolchain: newlib and newlib-nano. specs=nano.specs switches to the nano version of the libray. There probably is a reason why teensyduino only uses newlib-nano...
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 04:42 PM
    Looks like you are using PIO? Did you also set "--specs=nano.specs"? Newlib nano is used by teensyduino if you choose smallest code.
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 04:35 PM
    They are set by default anyway.
    16 replies | 570 view(s)
  • luni's Avatar
    04-23-2023, 03:57 PM
    Here a prove of principle. It uses GPIO6_16- GPIO6-31 which are routed to teensy pins. Of course, if you want to output 5000 pulses at 500kHz the pulstrain will be 10 ms long which is borderline if you need a pulsetrain...
    10 replies | 225 view(s)
  • luni's Avatar
    04-23-2023, 01:56 PM
    Thanks, I can do a quick test, shouldn't be too difficult.
    10 replies | 225 view(s)
  • luni's Avatar
    04-23-2023, 01:46 PM
    Just to make sure: the trajectory planner will send you values of up to 5000 per 10ms per motor right?
    10 replies | 225 view(s)
  • luni's Avatar
    04-23-2023, 07:41 AM
    How many steps do you expect per 10ms interval from your motion planner? If it is not too much, you could simply send them to the controllers @700kHz in a 10ms periodic interrupt (or triggered by the arrival of a new...
    10 replies | 225 view(s)
  • luni's Avatar
    04-23-2023, 06:05 AM
    There is no need to do the encoder readout with your own code. There are a lot of proven libs around doing this for you. Here an example using the EncoderTool. The library allows to attach a callback function which will...
    3 replies | 178 view(s)
  • luni's Avatar
    04-21-2023, 11:37 AM
    I think I know what is going on here: Looks like you compiled with -DF_CPU=48000000 which worked. Then you just changed your makefile to -DF_CPU=72000000 and recompiled without a 'make clean'. Thus the core was not...
    3 replies | 126 view(s)
  • luni's Avatar
    04-21-2023, 09:07 AM
    I tested your your code and can not reproduce the effect. It generates a nice 10kHz signal with 25Ás HIGH time for F_CPU = 48MHz, 72MHz and 96MHz
    3 replies | 126 view(s)
  • luni's Avatar
    04-20-2023, 12:55 PM
    Looks like those steppers have some unusual step pattern. Here a library to drive them: https://github.com/clearwater/SwitecX25. This lib is directly driving the motor (not step/dir). However, you probably need some...
    10 replies | 457 view(s)
  • luni's Avatar
    04-20-2023, 12:28 PM
    No, TeensyStep is not compatible with T4.x. Are you sure that your gauge has a stepper motor? Do you have a datasheet?
    10 replies | 457 view(s)
  • luni's Avatar
    04-20-2023, 11:12 AM
    I saw your PR. Wouldn't this PR eliminate Pauls macros completely? Probably a risky thing? Maybe just converting the macros to functions which shouldn't clash because the STL lives in the std:: namespace? Anyway, as...
    84 replies | 4934 view(s)
  • luni's Avatar
    04-20-2023, 08:06 AM
    As thebigg mentioned, the Arduino/Teensyduino #defines of standard functions (abs, round...) can mess up the standard library if STL headers are included after Arduino.h. It looks like the new toolchain (or the current...
    84 replies | 4934 view(s)
  • luni's Avatar
    04-19-2023, 11:00 AM
    Maybe this: https://forum.pjrc.com/threads/67520-RAWHID-demonstration-program helps?
    1 replies | 130 view(s)
  • luni's Avatar
    04-18-2023, 01:06 PM
    luni replied to a thread Teensy Qt in General Discussion
    IMHO PIO is pretty much THE current development system for embedded development. Installation is super simple, you'd install it from within vscode (it's just an extension to vscode). There should be plenty of...
    480 replies | 214432 view(s)
  • luni's Avatar
    04-18-2023, 05:34 AM
    Why do you think the waveform is not centralized already? If you imagine vertical lines through the centers on both LA pictures above you will see exactly what you have drawn? (of course after swapping 2/3) Starting...
    13 replies | 315 view(s)
  • luni's Avatar
    04-17-2023, 07:54 PM
    luni replied to a thread Teensy Qt in General Discussion
    Here is what I usually use in PIO. platform = teensy upload_command = C:\toolchain\TyTools\tyCommanderC upload $SOURCE --autostart --wait --multi extends =TeensyBase board = Teensy40
    480 replies | 214432 view(s)
  • luni's Avatar
    04-14-2023, 06:35 PM
    Unfortunately changing this to other means of identification (e.g. same USB Port) would be quite some rework. Reading/Writing to the serial port from a c# PC application is not really difficult. See here for...
    22 replies | 398 view(s)
  • luni's Avatar
    04-14-2023, 06:29 PM
    Paul could give a reliable answer, but I don't think you can change this. It is probably burnt in some read only memory. Couldn't you simply store your revision etc information in the EEPROM and send it on request to...
    22 replies | 398 view(s)
  • luni's Avatar
    04-14-2023, 06:21 PM
    Disclaimer: I didn't work on TeensySharp for years and I could be wrong. When TeensySharp reboots the board it triggers the process and then waits until a board with the same serialnumber but the halfkay PID appears...
    22 replies | 398 view(s)
  • luni's Avatar
    04-14-2023, 05:53 PM
    Your code does not compile (breakTime clashes with some function defined in the core) I renamed it to brkTime: IntervalTimer t1, t2; constexpr uint8_t pins4] = {0, 1, 2, 3}; void switchOn() { static...
    13 replies | 315 view(s)
  • luni's Avatar
    04-14-2023, 11:03 AM
    I tested it with 100kHz (@256MHz) with which is kind of borderline. Execution times get into the same order of magnitude as the delays so the duty cycle calculation need to be corrected.
    13 replies | 315 view(s)
  • luni's Avatar
    04-14-2023, 08:06 AM
    Using the PWM capabilites of the timers is of course the most elegant and precise method. If you just need a quick and dirty method you could use 2 IntervalTimers to generate the signal (fixed 0.25% phase shift). It is...
    13 replies | 315 view(s)
  • luni's Avatar
    04-14-2023, 06:15 AM
    This works here to distinguish a cold boot (power on boot) from a reset bool isWarmBoot() { static DMAMEM unsigned bootCheck; // DMAMEM is not zeroed during bootup if (bootCheck != 0xAAAA'AAAA) {...
    10 replies | 1087 view(s)
  • luni's Avatar
    04-13-2023, 09:02 AM
    Try to place above setup. This used to enable float scanf in the nanolib c-library
    3 replies | 142 view(s)
  • luni's Avatar
    04-10-2023, 01:13 PM
    For those not following the other thread here a link to some usage examples for the extended IntervalTimer interface: https://github.com/TeensyUser/doc/wiki/Using-the-new-callback-interface
    84 replies | 4934 view(s)
  • luni's Avatar
    04-09-2023, 09:36 AM
    luni replied to a thread c++17 in General Discussion
    Yes, that was exciting enough to get me out from under the mortar boxes :-)
    13 replies | 504 view(s)
  • luni's Avatar
    04-09-2023, 08:34 AM
    luni replied to a thread c++17 in General Discussion
    Thanks, didn't find much time for Teensy lately (renovating a (semi detached) house). Looks like I need to catch up :-)
    13 replies | 504 view(s)
  • luni's Avatar
    04-09-2023, 08:01 AM
    luni replied to a thread c++17 in General Discussion
    Thanks, didn't notice that there already is a 1.59 Beta-1
    13 replies | 504 view(s)
  • luni's Avatar
    04-09-2023, 06:37 AM
    luni started a thread c++17 in General Discussion
    @Paul: Do you intend to switch to c++ 17 (or higher) with 1.59? I thought 1.58 was already c++ 17 but looks like I only dreamed that :-)
    13 replies | 504 view(s)
No More Results
About luni

Basic Information

Age
58
About luni
Location:
Germany

Statistics


Total Posts
Total Posts
2,061
Posts Per Day
0.62
Last Post
How to use Atmel Studio 6.2 with Teensy 4.0? Today 08:24 AM
General Information
Join Date
04-27-2014