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

Search:

Type: Posts; User: Nominal Animal

Page 1 of 4 1 2 3 4

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    101

    You might find Mark Allen Weiss...

    You might find Mark Allen Weiss's Data Structures and Algorithm Analysis (either second edition in C, or third edition in C++) interesting and useful. You can find the second edition online if you...
  2. Replies
    5
    Views
    101

    Preprocessor only does math in #if clauses, but...

    Preprocessor only does math in #if clauses, but the compiler does integer arithmetic on literals at compile time. (For floating-point math, it depends on options used, and whether the expression has...
  3. Note that there is a technical issue...

    Note that there is a technical issue to cleanly solve this.

    As you noticed, .begin() and .end() don't actually do anything; the reason I used them is more to do with us human programmers than...
  4. Teensyduino: Add data_lost = Serial.reset(flags)?

    Hi @PaulStoffregen, @FrankB, and others working on the nitty-gritty details of USB Serial in the Teensyduino cores,

    I'd like to propose a new member function, .reset(), with an optional flag, that...
  5. Okay, it was much simpler than I thought. We...

    Okay, it was much simpler than I thought. We just use Serial.begin() when we first notice an userspace application has connected (by noticing that (Serial) is now true), and when (Serial) turns...
  6. Hopefully this will explain what, why, and how...

    Hopefully this will explain what, why, and how that happens.

    First, let's create a simple sketch, a variant of the Blink example, serial-blink.ino:


    #define LED 13

    void setup() {
    ...
  7. Perhaps this illustration of 100 samples (a sine...

    Perhaps this illustration of 100 samples (a sine wave plus noise) gives you some idea:
    19084
    The same data, but with different coefficient and window size:
    19085
  8. No, just once (gauge_value). Think of...

    No, just once (gauge_value).

    Think of gauge_shown as the needle in the gauge, dragged around by the sampled gauge_value , but limited to a maximum rate of change.



    If the sampled value...
  9. Let's say you have the following variables: ...

    Let's say you have the following variables:



    float gauge_value; /* Actual gauge value measured; changes rapidly */
    float gauge_shown; /* Displayed gauge value */

    #define GAUGE_MAX_UP ...
  10. Using #include "usb_serial.h" #define ...

    Using


    #include "usb_serial.h"
    #define MSGLEN 512

    static unsigned char msg[MSGLEN];
    static uint32_t msg_read;
    static uint32_t msg_written;
  11. But.. are you sure you are using POSIX read() and...

    But.. are you sure you are using POSIX read() and write() correctly?

    A very common error I see is using if (read(ttyfd, buffer, bytes) < 0) error(); , assuming that read() will always read the...
  12. Yes. I would scavenge (cut) an existing cable...

    Yes. I would scavenge (cut) an existing cable with the desired connector, solder the wires directly to the Teensy 4.0, and use UV curing glue or epoxy to help keep the wires in place.

    I'm not...
  13. BTW, KurtE is absolutely right. It always makes...

    BTW, KurtE is absolutely right. It always makes sense to look at the whole, and consider which details matter.

    The cases where a double frame buffer would be useful are relatively rare. ...
  14. Consider the case where sending/writing the frame...

    Consider the case where sending/writing the frame buffer to the display takes t1 milliseconds, and it takes the microcontroller t2 milliseconds to redraw everything in the framebuffer.

    If you use...
  15. For a keypad, I recommend the diode approach. ...

    For a keypad, I recommend the diode approach.

    If you have NM keys, you need N+M I/O pins: N outputs and M inputs. You can use an expander, shift register, counter etc. for the N outputs, if you...
  16. True; apologies for hijacking the thread, KurtE....

    True; apologies for hijacking the thread, KurtE.

    Back on topic, looking at the datasheet, the signals, timing, and command set seems very similar to ILI9341/ILI9488 (noting that I am mostly...
  17. That also makes porting (between displays)...

    That also makes porting (between displays) easier.

    For example, if one wants to use ILI9341/ILI9488 in 9-bit parallel mode (for 18-bit color, or 6 bits per component), one can use the...
  18. The main difference between SPI and parallel...

    The main difference between SPI and parallel transfer is the maximum display frame rate one can achieve. SPI is certainly simpler: fewer wires, easier to get going, libraries already exist. Simpler...
  19. I don't know what my affliction is called, but me...

    I don't know what my affliction is called, but me fail English often in the "tone" or subtext, and spelling mistakes makes it hard for me to read/understand.

    When I encounter mistakes like...
  20. ILI9488_t3 supports the palette method I...

    ILI9488_t3 supports the palette method I described above, although it calls it pallet :rolleyes:

    It does support DMA too, by precalculating the data sent via SPI into a buffer, then using a DMA to...
  21. To simplify a bit, the DMA engine is a separate...

    To simplify a bit, the DMA engine is a separate unit in the microcontroller, that transfers 8-bit bytes or 16- or 32-bit words, while the processor itself is working on something else.

    ILI9341,...
  22. On the Teensy 4.0, although there aren't 16 pins...

    On the Teensy 4.0, although there aren't 16 pins available on any I/O port (closest is AD_B1, which has 0-3, 6-11, 14-15), bit-banging them will do just fine due to the 600 MHz system clock, because...
  23. True; I only have one ILI9341 and no ILI9488, and...

    True; I only have one ILI9341 and no ILI9488, and was only quoting what the datasheet says.

    (I found the version 0.90 and version 1.00 using a simple DuckDuckGo search; looking at the site itself...
  24. The maximum SPI clock the ILI9488 datasheet...

    The maximum SPI clock the ILI9488 datasheet allows, is about 15 MHz (to be exact, 66ns per SPI clock cycle). With a 320480 display at 16 bits per pixel, you can reach about 6 frames per second....
  25. Better write your own float parser. Let's see: ...

    Better write your own float parser. Let's see:


    int parseFloats(char *buffer, float to[], int max)
    {
    int count = 0;
    float value;
    float divisor;

    while (*buffer) {
  26. The Teensy MIDI page shows how to use 74HC4051...

    The Teensy MIDI page shows how to use 74HC4051 (8:1 multiplexer); the 74HC4067 (16:1 multiplexer) is otherwise similar, but uses four address lines instead of three. Both seem to be available at...
  27. Could you retest with void loop() { ...

    Could you retest with



    void loop() {
    digitalWriteFast(13, HIGH);
    GPT1_SR = 0x00000001;
    digitalWriteFast(13, LOW);
    delayMicroseconds(1);
    digitalWriteFast(13, HIGH);
  28. Replies
    201
    Views
    4,734

    Sorry for interrupting (pun not intended), but I...

    Sorry for interrupting (pun not intended), but I recently verified the following approach works on Teensy 3.2.


    The ADCx is in software trigger mode.
    One DMA channel is used to transfer...
  29. If your variables are floats or doubles, normal...

    If your variables are floats or doubles, normal operations (+ - * /) work as expected, remembering that floating-point values are not always exact. (For example, 0.1 cannot usually be represented...
  30. I only meant that I misremembered the limit.h...

    I only meant that I misremembered the limit.h differences between POSIX and C. (C++, which Arduino environment uses, delegates the definition to C standards.)
    I also mostly ignore C11 and rely on...
  31. True. (I normally work with POSIX, which is...

    True.

    (I normally work with POSIX, which is slightly stricter than standard C, and does limit INT_MIN to -2147483647 or smaller, and INT_MAX to 2147483647 or larger, essentially requiring 32-bit...
  32. Quite true! Thanks for pointing out the error,...

    Quite true! Thanks for pointing out the error, luni. (Edit time window closed, can't fix :().


    Some further detail, to atone for my error, for anyone working with non-integer numeric data:

    In...
  33. When you have c = a / b : If both a and b are...

    When you have c = a / b :
    If both a and b are integer types, c is the result truncated (rounded towards zero) to the nearest integer, even if c is a float or a double.
    If a or b is a float, and...
  34. Replies
    4
    Views
    194

    What I would do, is extend multistepper to...

    What I would do, is extend multistepper to support a global volatile flag, that is initialized to zero in the user init() function, and set in the interrupt function.

    Necessary changes to...
  35. Change the second word on the second line, map,...

    Change the second word on the second line, map, to say my_map, then copy-paste all of it to your Arduino source file, before the code that uses it (so, before getAnalogData function). In your own...
  36. It is not the trackball I would worry about for...

    It is not the trackball I would worry about for shorts -- it is likely just a couple of photointerruptors (ie. LEDs and phototransistors) with a disk with holes or windows rotating in between, so it...
  37. This looks very similar to standard arcade...

    This looks very similar to standard arcade joystics people use with Teensies,
    https://cdn-shop.adafruit.com/1200x900/480-01.jpg
    The only difference is that the newer arcade joystics use...
  38. The Arduino map() is not optimal; see this post...

    The Arduino map() is not optimal; see this post of mine. In particular, the integer version does not return the rounded values of the floating-point version; mine does.

    Let's reconstruct the...
  39. Just in the hopes that this is useful, extracted...

    Just in the hopes that this is useful, extracted from the datasheet manitou linked to:

    The ADS8861 is a 10-pin chip, an 16-bit 1 MSPS ADC:
              ┌──────┐
          REF │ 1 10 │ DVDD
         AVDD │...
  40. Replies
    3
    Views
    141

    I have not yet seen two Teensies with the same...

    I have not yet seen two Teensies with the same serial number, and I do believe they are assigned different serial numbers by the boot loader.

    As an example, the two Teensy 3.2 that I have lying...
  41. Replies
    3
    Views
    141

    In Linux, the joysticks get assigned in the order...

    In Linux, the joysticks get assigned in the order you plug them in.

    If both joysticks are connected when the computer boots or restarts, I believe the order is random.

    udev does create...
  42. Fully agreed, JBeale. I alluded to that in the...

    Fully agreed, JBeale. I alluded to that in the second-to-last paragraph.

    Teensy 4.0 contains a hardware entropy source, TPRNG, that might suffice; but personally, I'd like more than one entropy...
  43. I also recommend public key cryptography for...

    I also recommend public key cryptography for this, just like Paul above.

    However, to combat against replay attacks, you'll want the microcontroller to generate a random number, to which the host...
  44. Joebobsicle over at EEVblog forums...

    Joebobsicle over at EEVblog forums mentioned that on STM32 H7, invalidating (better name than deleting, IMHO) the caches for the buffers to work, only works if they're aligned to 32 bytes.

    Maybe...
  45. Replies
    16
    Views
    1,076

    Thanks. I don't have a 4.0 yet, but will do that...

    Thanks. I don't have a 4.0 yet, but will do that when I get one.
  46. Replies
    16
    Views
    1,076

    teensy_loader_cli and Teensy 4.0?

    Will teensy_loader_cli get support for Teensy 4.0?
  47. Replies
    161
    Views
    13,452

    What I'm thinking of, is a controller for 3D...

    What I'm thinking of, is a controller for 3D printers using a carrier board with TMC2208 support, and proper isolation between motor ground and logic ground, using e.g. Si86xx isolators. (Lack of...
  48. No, you should use the 3.3V pin for the pullups. ...

    No, you should use the 3.3V pin for the pullups. Smaller resistance yields stronger pullups, because the current is higher then.

    What kind of cable/wire are you using for the I2C? Personally,...
  49. Replies
    1
    Views
    108

    Let's say you use 10 kOhm linear potentiometers. ...

    Let's say you use 10 kOhm linear potentiometers. You connect one end to +3.3V, the wiper to your input, and the other end to GND, to use the potentiometer in the voltage divider configuration. ...
  50. Replies
    6
    Views
    306

    Note that 17 rows of 30 leds each plus two leds...

    Note that 17 rows of 30 leds each plus two leds is 1730+2 = 510+2 = 512 = 29 leds, which looks suspiciously like a limitation somewhere.
Results 1 to 50 of 161
Page 1 of 4 1 2 3 4