Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: Nominal Animal

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. I'm just glad to be of help. I've got another...

    I'm just glad to be of help. I've got another project going on – Teensy 4.0 and 4.1 interactive pinouts in a browser – so I'll concentrate on that for now. If you'd like me to try and find the bug...
  2. As far as I can tell, we hit the kernel bug when...

    As far as I can tell, we hit the kernel bug when Teensy resets, and there is still data begin sent to the Teensy. If we could ensure the reset packet is the last one we try to send, immediately...
  3. It's the same kernel use-after-free bug. When...

    It's the same kernel use-after-free bug. When the Teensy resets, some of the URB sent from the host to the Teensy need to be canceled. (acm_kill_urbs() in the oops, in this case.)
    Like I linked to...
  4. To me, it looks like an actual Linux kernel bug,...

    To me, it looks like an actual Linux kernel bug, that occurs when an USB URB is canceled (because the device reset or vanishes).

    There is a relatively recent possibly related bug report on the...
  5. If you are referring to the 32-button limit per...

    If you are referring to the 32-button limit per USB Joystick, I recommend making your Teensy an USB Keyboard + Joystick pair, with the extra buttons producing standard keypresses.

    This thread has...
  6. Replies
    4
    Views
    173

    The effects in instruction timing (for Cortex-M4,...

    The effects in instruction timing (for Cortex-M4, PDF) you are seeing is a result of pipelining instructions within the Cortex-M4 core itself; i.e., at the lowest hardware level in the...
  7. (I haven't found any, and can't even find...

    (I haven't found any, and can't even find instruction timings for ARMv7 or FPv5 used on the i.MX RT1062 on Teensy 4.0 and 4.1.
    As far as I know, one would have to microbenchmark the various...
  8. Floats (Binary32) have 23 bits of precision, but...

    Floats (Binary32) have 23 bits of precision, but a 254-bit range.
    32-bit integers have 32 bits of precision and a 32-bit range, of course.
    If the absolute maximum signal range is known, then 32-bit...
  9. For that particular case, yes. On 32-bit...

    For that particular case, yes.

    On 32-bit microcontroller, it makes sense to use the 32-bit filter implementation only.
    On 8-bit microcontrollers, it makes sense to use the 16-bit filter if it...
  10. In C (as opposed to C++), one can use the...

    In C (as opposed to C++), one can use the following pattern. First, filter16.h:


    #if !defined(FILTER_NAME)
    #error Define FILTER_NAME as the name of the filter.
    #elif...
  11. Note: It looks like the state has to be an...

    Note: It looks like the state has to be an exact-width type (so uintN_t and not uint_fastN_t), as any extra bits will mess up the modulo arithmetic.

    The 16-bit state is intended for input samples...
  12. Do ignore my post #7: when I wrote that, I was...

    Do ignore my post #7: when I wrote that, I was obviously confusing a sliding window filter with the exponential moving average. (I'd edit it to correct it, but the grace period is over.)


    I...
  13. Here's a simple Python3 test bench anyone can...

    Here's a simple Python3 test bench anyone can experiment with:


    from random import Random
    from math import sin, pi

    class Source:
    __slots__ = ('prng', 'phase')

    def __init__(self,...
  14. Perhaps that was your intention, but fact is, the...

    Perhaps that was your intention, but fact is, the C++ implementation includes the rounding operation.

    Code to implement the above is different: you need to calculate average in fixed point as...
  15. Eh, what? I was describing a mathematical...

    Eh, what? I was describing a mathematical formula, not suggesting code.

    There is an important distinction here, by the way.

    The often used mathematical form

            state = (1 -...
  16. Exponential decay filtering,         average =...

    Exponential decay filtering,
            average = C·sample + (1-C)·average
    (where C is a real coefficient smaller than 1) is different to exponential moving average.

    Their main difference is that...
  17. No, OP's code is not right. A correct...

    No, OP's code is not right. A correct implementation would be


    constexpr int_fast16_t fractional_bits = 2;
    int_fast16_t heading = 0;

    int_fast16_t average_heading(int_fast16_t sample)
    {
    ...
  18. It is a common programming pattern for "animator"...

    It is a common programming pattern for "animator" functions to take a number as a parameter, describing the progress along the animation.

    However, looking at the code, neither drawRunAnim() nor...
  19. Those are literally the same images;...

    Those are literally the same images; teensy41-sides.html links to the ones hosted here.


    True. I was thinking of the case when considering a pin on one side, and having to connect it from the...
  20. OK! The first test is at...

    OK! The first test is at https://nominal-animal.net/teensy41/teensy41-pins.html, and the turning test at https://nominal-animal.net/teensy41/teensy41-sides.html.

    To repeat, the idea is that while...
  21. Here's what I meant: 21007 saved as...

    Here's what I meant: 21007 saved as teensy-sides.html .
    (I realized I could make the SVG canvas a standard size, and reference the pin locations to that, then scale and rotate the JPEG images to...
  22. I mean, if I add a button that changes the side...

    I mean, if I add a button that changes the side of the board shown –– and yes, pin positions will change, and effectively left and right side labels etc. swap places –– the image jumps, because the...
  23. I know, defragster; the issue is that it is...

    I know, defragster; the issue is that it is slightly different size to the back one, so swapping them in place creates a jarring "jump" effect.
    I'd like big enough pictures I could rotate and scale...
  24. If draw_state is some unsigned integer type, then...

    If draw_state is some unsigned integer type, then (draw_state >> 3) == (draw_state / 8), and ((draw_state & 7) == (draw_state % 8)) (modulo, i.e. remainder if divided by 8).


    draw_state │...
  25. Does anyone have higher-resolution front and back...

    Does anyone have higher-resolution front and back images of Teensy 4.1? I don't have one (yet), so I can't take my own pics either.
    I'd like to crop/rotate/scale them so that they match, and make...
  26. I was too lazy to add more than the GND and SPI1...

    I was too lazy to add more than the GND and SPI1 pins, but at least you can see how this would work.
    I rotated https://forum.pjrc.com/teensy41_2.jpg, cropped it, and saved as a 199×704 pixel JPEG...
  27. You know, I'd be happy to try and whip up an...

    You know, I'd be happy to try and whip up an example interactive page (client-side/browser only, will work fine even if saved as a local file) to show the different options, with tooltips/rollovers...
  28. Unfortunately, like I already mentioned most of...

    Unfortunately, like I already mentioned most of the motor controller drivers (including DRV8825) and even CNC/3D printer boards like SmoothieBoard use a common ground for motors and logic.

    The...
  29. There is no issue, as long as you explicitly...

    There is no issue, as long as you explicitly specify which byte order you use in the transfers.

    On some host hardware architectures, accessing an unaligned float may not work, and byte order...
  30. Ground potential difference (and thus a ground...

    Ground potential difference (and thus a ground loop) is a likely culprit.

    A simple fix is to get yourself a cheap ADuM3160-based USB isolator between Teensy and the host computer. It will limit...
  31. Replies
    13
    Views
    736

    I mean 3 distinct APIs. Whether you want it all...

    I mean 3 distinct APIs. Whether you want it all in one library, or split the crypto hash to a separate one, I do not know.

    With a tested ISAAC-based PRNG, I'd be happy with a single one.

    The...
  32. (I am not ashamed to admit that I use K to remind...

    (I am not ashamed to admit that I use K to remind me which side is the cathode, and A to remind me which side is the anode, in a diode or a LED.)

    (I haven't found a good one for polarity yet. The...
  33. Replies
    13
    Views
    736

    For non-cryptographic work, I recommend using one...

    For non-cryptographic work, I recommend using one of the Xorshift variants; many of them are as random as Mersenne Twister, but much faster. In fact, my preferred one, using only the 32 high bits of...
  34. My ping-pong...

    My ping-pong test shows that Teensy 4.0 has issues at high-bandwidth 1024-byte messages, but it does not tell us where the problem is.

    When you suggested testing transfers in just one direction...
  35. No worries! Anyway, here is the Teensyduino...

    No worries! Anyway, here is the Teensyduino sketch for Teensy 4.0 with USB Serial:


    // SPDX-License-Identifier: CC0-1.0

    #define SEED 1
    #define SIZE 512

    static uint64_t state;
    static...
  36. Ah, right; with 512 byte packets, even this old...

    Ah, right; with 512 byte packets, even this old HP Pavilion 11 x360 can do 270 Mbits/s (34 Mbytes/s) locally. I bet an i5/i7 or a relatively recent AMD can do >480Mbits/s locally with 512 byte...
  37. @KurtE, @defragster -- If you happen to have a...

    @KurtE, @defragster -- If you happen to have a fast-ish Linux machine (virtual machine is perfectly okay), you might wish to test the following program pair. I finished these first; I'll implement...
  38. Replies
    3
    Views
    157

    I agree with Frank B. It turns out it is...

    I agree with Frank B.

    It turns out it is usually easier to construct the value using integer types, and convert it to double when needed for computation. One would use something like the...
  39. Me too, that's why I do tests using raw termios...

    Me too, that's why I do tests using raw termios on Linux.


    Excellent idea; doing one-way tests will tell us a lot more about exactly what is happening.

    Unfortunately, I just noticed I have a...
  40. No, there are odd issues even with C code that...

    No, there are odd issues even with C code that can easily handle the full USB bandwidth (using termios in Linux), but keels over with Teensy 4.0.

    It looks like a "lockup" of some sort when either...
  41. Replies
    12
    Views
    496

    I've used an awk scriptlet to do this. While you...

    I've used an awk scriptlet to do this. While you can use the C preprocessor (avr-cpp in Arduino, arm-none-eabi-cpp in Teensyduino) to do all preprocessing, it is easier to write a simple awk script...
  42. Replies
    2
    Views
    480

    Do you need to generate the sample clock also, or...

    Do you need to generate the sample clock also, or just the -0.3V/+0.3V sync pulses/pulse pairs?

    If we look at just the sync pulse (pair) itself, starting at 0V (idle):

    The output drops to...
  43. Replies
    797
    Views
    37,182

    I've been tickled pink at being recognized as...

    I've been tickled pink at being recognized as potentially useful beta tester :o -- Thanks!
    But as of now, I have my hands full :( (with stuff involving 4.0).

    I will be getting a Teensy 4.1 later...
  44. Replies
    4
    Views
    254

    To expand on what Pete (el_supremo) already...

    To expand on what Pete (el_supremo) already answered, the Arduino sketches are actually just a subset of C++ compiled using GCC, with some autogenerated code (like function prototypes, which may look...
  45. Replies
    5
    Views
    451

    Teensy 4 is not an 8-bit AVR, it is a 32-bit ARM....

    Teensy 4 is not an 8-bit AVR, it is a 32-bit ARM. Are you sure your firmware building tool will work for Teensy 4?

    Teensy 4 does not have 8-bit ports (PORT A..F bit 0..7), it has 32-bit GPIO...
  46. Replies
    17
    Views
    648

    Perhaps micros() and millis() could be...

    Perhaps micros() and millis() could be implemented on top of a GPT running at 1 MHz (using the peripheral clock, ipg_clk), so its counter is directly in microseconds, and wraps around every ~ 4295...
  47. You won't have much accuracy at all doing it that...

    You won't have much accuracy at all doing it that way.

    I would recommend you use a MAX31865 instead, with its voltage or ground switched via a transistor or MOSFET on demand by Teensy.

    You can...
  48. Yes, it does work. This is how resistive...

    Yes, it does work. This is how resistive four-wire touch panels are read as well: a pair of pins is used as outputs, and the coordinate along that axis is read from either of the two other pins;...
  49. For what it is worth, I agree. @PaulStoffregen,...

    For what it is worth, I agree. @PaulStoffregen, there is definitely something odd here.

    In cores/teensy4/analog.c:analog_init(), the ADC1_CFG = mode | ADC_HC_AIEN | ADC_CFG_ADHSC; line is...
  50. FWIW, here...

    FWIW, here is the EasyEDA project for the SAMD51 blitter board. While it can be used standalone, I really am envisioning it more like the boards used on most display modules their flat flex cable is...
Results 1 to 50 of 216
Page 1 of 5 1 2 3 4