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. 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...
  2. 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;...
  3. 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...
  4. 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...
  5. The helper SAMD51J20A does have 256k of RAM,...

    The helper SAMD51J20A does have 256k of RAM, which is enough for tiles, sprites and fonts, or for a 320240 framebuffer. Since it is Arduino-programmable -- basically the same as Adafruit Feather M4...
  6. 16-bit parallel ILI9341/ILI9488/etc. displays with Teensies

    Just out of technical interest, I've looked at a few different possibilities of connecting cheap 240320/320480 TFT display modules using 16-bit parallel connection to various Teensies.
    The...
  7. Correct. (You could replace the division by a...

    Correct.

    (You could replace the division by a power of two (2, 4, 8, 16) by a multiplication with the exact reciprocal (0.5f, 0.25f, 0.125f, 0.0625f). I've actually expanded on this in this...
  8. Replies
    5
    Views
    220

    Since I happen to have both a Teensy 4 and an...

    Since I happen to have both a Teensy 4 and an ADuM3160 USB isolator, I tested it.

    Teensy 4 works and programs fine with the USB isolator in 12 MBit/s (full speed) mode; no changes necessary. ...
  9. First one is exponential filtering with...

    First one is exponential filtering with coefficient 0.5, the second is windowed filter with 2 sample window. They are equally valid.

    How to define "accuracy"? The main purpose is to smooth out...
  10. Replies
    5
    Views
    245

    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...
  11. Replies
    5
    Views
    245

    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...
  12. 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...
  13. 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...
  14. 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...
  15. 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() {
    ...
  16. 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
  17. 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...
  18. 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 ...
  19. 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;
  20. 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...
  21. 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...
  22. 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. ...
  23. 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...
  24. 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...
  25. 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...
  26. 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...
  27. 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...
  28. 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...
  29. 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...
  30. 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,...
  31. 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...
  32. 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...
  33. 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....
  34. 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) {
  35. 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...
  36. 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);
  37. Replies
    201
    Views
    5,866

    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...
  38. 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...
  39. 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...
  40. 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...
  41. 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...
  42. 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...
  43. Replies
    4
    Views
    235

    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...
  44. 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...
  45. 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...
  46. 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...
  47. 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...
  48. 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 │...
  49. Replies
    3
    Views
    160

    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...
  50. Replies
    3
    Views
    160

    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...
Results 1 to 50 of 170
Page 1 of 4 1 2 3 4