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. I'm just wondering what's wrong with the original...

    I'm just wondering what's wrong with the original idea of simply setting a flag in the ISR and polling it in loop? Setting a flag in an ISR that is called at only 2kHz won't make a T3.2 sweat....
  2. Replies
    4
    Views
    153

    You are sending 8 bytes every 10Ás to (I assume)...

    You are sending 8 bytes every 10Ás to (I assume) the Serial Monitor of the IDE. This makes 800'000 characters per second. I assume that the Sermon simply is not fast enough to display those. If I...
  3. Replies
    21
    Views
    320

    I don't know how python implements arrays but...

    I don't know how python implements arrays but this might be a performance issue:


    It can be that python needs to copy the array quite often if it runs out of preallocated memory. The larger the...
  4. Replies
    1,009
    Views
    82,800

    Maybe this helps? MicroMod Stepper driver...

    Maybe this helps?
    MicroMod Stepper driver carrier (kicad)https://github.com/luni64/mmStep

    (T3.2 compatible board: https://github.com/luni64/MicroMod_3.2)
  5. I assume it works for the intervaltimer since its...

    I assume it works for the intervaltimer since its ISR needs to walk through all 4 channels and check the status bits. This takes probably long enough to propagate the value to the register. Of...
  6. I understand that the volatile in asm...

    I understand that the volatile in asm volatile("dsb"); prevents the compiler from reordering the instruction. Would be useless if it decides to put the dsb barrier in front of the flag resetting. But...
  7. Wild guess: Very short ISRs tend to be called...

    Wild guess: Very short ISRs tend to be called twice (or even trice) if the resetting of the ISR flag didn't make it through the bus synchronization fast enough. If the ISR gets called twice, at the...
  8. Deleted because the proposed method doesn't...

    Deleted because the proposed method doesn't really work...
  9. Replies
    7
    Views
    384

    The tutorial for what? There are a couple of...

    The tutorial for what? There are a couple of different suggestions in this thread...
  10. Teensyduino contains the smalloc library. You can...

    Teensyduino contains the smalloc library. You can use it to dynamically allocate memory from the PSRAM chips (EXTMEM)

    This:


    #include "smalloc.h"
    //....

    byte* buf = (byte*) sm_malloc(1024...
  11. Thread: TeensyTimerTool

    by luni
    Replies
    302
    Views
    51,003

    Depends on your requirements of course. I...

    Depends on your requirements of course. I currently implemented the DMA pulse generator only for the TMR/QUAD timers. It was more or less an exercise in DMA programming (which I didn't do so far). ...
  12. Replies
    7
    Views
    384

    If you work under Windows and don't like...

    If you work under Windows and don't like dependency on third party tools you can also have a look here: https://github.com/luni64/VisualTeensy. It simply sets up a vsCode Teensy project by...
  13. Replies
    7
    Views
    283

    The compiler searches for headers in the current...

    The compiler searches for headers in the current folder andf some system folders. If you want it to search in additional folders one needs to tell the compiler with additional -Ixxx parameters...
  14. Replies
    10
    Views
    534

    Added those to the user wiki here:...

    Added those to the user wiki here: https://github.com/TeensyUser/doc/wiki/Vendors
  15. I don't want to start a religion war but VLAs are...

    I don't want to start a religion war but VLAs are discussed quite controversial. The main argument against them goes like this: If you don't know the size at compile time VLAs might generate a stack...
  16. Replies
    2
    Views
    173

    Addendum to MarkT's answer: Instead of casting...

    Addendum to MarkT's answer: Instead of casting to an integer type you can also print pointer values directly using the %p format-parameter. (Makes printf friendlier to the eyes...)



    int32_t...
  17. Tried it with %llX works for HEX as well....

    Tried it with %llX works for HEX as well. Learned something new today :-)
  18. You can use the PRIn64 constants. Where n...

    You can use the PRIn64 constants. Where n corresponds to the normal printf format constants, d: integer, x: hex, X: hex with large letters...

    e.g.:


    Serial.printf("64bit hex: 0x%" PRIX64...
  19. Oh, 40-60kHz for 4 encoders is nothing. You can...

    Oh, 40-60kHz for 4 encoders is nothing. You can simply use the standard Encoder library, or if you want to make absolutely sure to not loose a count use the hardware counters. Also, at these low...
  20. What max pulse frequency are you expecting? ...

    What max pulse frequency are you expecting?


    That was sent via Ethernet / WebSocket to the displaying browser
  21. The most important information would be the...

    The most important information would be the generated pulses per second which of course depends on the max rotation speed you need to support.
    Generally, reading high frequency encoders with...
  22. Replies
    123
    Views
    42,654

    The library uses the FTM0 timer module which is...

    The library uses the FTM0 timer module which is also needed for PWM generation. Here https://www.pjrc.com/teensy/td_pulse.html you find a table (scroll down to PWM Frequency) which shows which pin...
  23. I also like Juraj's nice c++ proposal on...

    I also like Juraj's nice c++ proposal on Stackexchange: https://arduino.stackexchange.com/a/88255/66176 which solves this for all print functions (print, println, printf...)
  24. I also experienced that kind of stuff but the...

    I also experienced that kind of stuff but the other way round. The unfortunate habit of #defining things like abs, max etc in Arduino sometimes messes up standard c++ libraries/headers. Never saw...
  25. Difficult to help if you don't post complete code...

    Difficult to help if you don't post complete code showing the issue. I tried to deduce from the fragments what you want to achieve. Looks like the run function is supposed to be non blocking and...
  26. Yes, but formulated it nicer :-)

    Yes, but formulated it nicer :-)
  27. The way the interval timer is implemented you can...

    The way the interval timer is implemented you can only attach a parameter-less function returning void as callback. Your callback function pumpOutWithTimer looks like such a function but in fact it...
  28. Replies
    6
    Views
    317

    @Paul: I always wondered if there is a technical...

    @Paul: I always wondered if there is a technical reason why the MIDI modes don't use the BCD_DEVICE field to announce the board type? Would be very helpful to get this information for all USB-Modes...
  29. Replies
    13
    Views
    517

    Sure, see here for the corresponding T4 code...

    Sure, see here for the corresponding T4 code https://forum.pjrc.com/threads/68062-Teensy-4-1-RTC-get-milliseconds-correctly?p=287198&viewfull=1#post287198

    Edit: The main difference is that the T4...
  30. Replies
    13
    Views
    517

    The TimeLib maintains its own timer which you can...

    The TimeLib maintains its own timer which you can sync to e.g. the on board RTC or some external time generator. This makes a lot of sense for boards without an RTC. The code above does not use...
  31. Replies
    13
    Views
    517

    ...and here an other approach if you prefer time...

    ...and here an other approach if you prefer time strings over 64-bit timestamps:


    #include <ctime>

    void getRTC64(time_t* seconds, uint32_t* milliseconds)
    {
    uint32_t hi1 = RTC_TSR, lo1 =...
  32. Replies
    13
    Views
    517

    Both, the the RTC of the T3.x and the T4.x count...

    Both, the the RTC of the T3.x and the T4.x count the number of clock oscillator periods to keep track of time. The clock crystal oscillates with 32.768kHz, thus the RTC increments every 1/32768 =...
  33. Got it, thanks. Never tried the debugging...

    Got it, thanks. Never tried the debugging capabilities of VM. Might give it a try during the upcoming holidays. Does it use GDB as backend?
  34. I kind of still don't understand your goal. Do...

    I kind of still don't understand your goal. Do you want to integrate this information as part of your application (e.g. users don't select COM ports but say, Teensies based on their serial numbers...
  35. Actually this only lists the currently connected...

    Actually this only lists the currently connected COM Ports. If you have more than one connected the list simply grows. Here the list if only one with triple serial and one with dual serial are...
  36. Windows maintains a database of connected devices...

    Windows maintains a database of connected devices to ensure that it assigns always the same COM port number to a device regardless on what USB port the device is plugged in. However, this database...
  37. Thread: Generating pulses

    by luni
    Replies
    2
    Views
    342

    I don't know anything about your threading...

    I don't know anything about your threading library, but if you only need to generate a few frequencies on pins you can do this:


    include "Arduino.h"

    void setup()
    {
    ...
  38. I don't know how exactly you want to transform...

    I don't know how exactly you want to transform the mouse input, but as long as "new/virtual" position and button states can be calculated from the position and buttons states of the connected mouse...
  39. If I open your files I see a different...

    If I open your files I see a different declaration of _Logo in LittleBuddy.h:


    class LittleBuddy : public Adafruit_GrayOLED
    {
    // stuff....

    const unsigned char...
  40. Replies
    37
    Views
    2,888

    Reason is that the Teensies in MIDI mode don't...

    Reason is that the Teensies in MIDI mode don't communicate the board type. Thus the check for compatible firmware fails and uploading errs with the "Upload_FirmwareMismatch" you observed. As...
  41. Replies
    0
    Views
    138

    BCD_DEVICE and Teensy Type

    I use the BCD_DEVICE field in the USB Descriptor to identify the type of the connected Teensy without having to start the bootloader first. However, I just noticed that the USB types MIDI XX and...
  42. Replies
    37
    Views
    2,888

    I can reproduce that with the "WinForms Uploader"...

    I can reproduce that with the "WinForms Uploader" example. Seems to be related to the Serial+MIDIx4 Usb mode. I can upload if I first switch the board to bootloader (using the bootloader button in...
  43. Replies
    10
    Views
    489

    I assume your techs will have a Laptop? If so,...

    I assume your techs will have a Laptop? If so, just install tyTools from here https://github.com/Koromix/tytools/releases/tag/v0.9.5 and use it to upload the firmware to your boards. As mentioned...
  44. Replies
    12
    Views
    546

    As mentioned above, just choose Optimize...

    As mentioned above, just choose Optimize "Smallest Code"

    26870

    If this brings the size of your sketch far enough down you can selectively enable optimization by using #pragma optimize (see...
  45. Replies
    12
    Views
    546

    BTW: Did you try to switch to nanolib? You can...

    BTW: Did you try to switch to nanolib? You can easily test this by using the Optimize for smallest code option.
  46. Replies
    12
    Views
    546

    You probably didn't see my edit above...

    You probably didn't see my edit above...
  47. Replies
    12
    Views
    546

    You need to place FLASHMEM in the function...

    You need to place FLASHMEM in the function declarations. E.g. if you compile this:


    void setup(){
    }

    void loop(){
    }
  48. Replies
    12
    Views
    546

    You can use gnu nm to print a nice symbol table....

    You can use gnu nm to print a nice symbol table. Here what it prints for a random sketch:



    00000000 000001d0 T _VectorsFlash
    00000022 A _teensy_model_identifier
    000001d0 00000200 T...
  49. Replies
    26
    Views
    940

    A guy at stackoverflow writes about using them: ...

    A guy at stackoverflow writes about using them:

    :)
  50. Replies
    26
    Views
    940

    'and' instead of && is unusual but perfectly OK....

    'and' instead of && is unusual but perfectly OK. But, you have the parentheses wrong. You probably meant to write:


    if ((millis() - HeartbeatMillis > 2000) and (millis() - HeartbeatMillis <...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4