Search results

  1. Nominal Animal

    Teensy 4.1 Pins

    For the 14 SPST toggle switches (OFF-ON), 3 SPDT (ON-OFF-ON) toggle switches, rocker switch (OFF-ON), and push button (OFF-(ON), i.e. momentary), I'd use a 4×6 matrix with diodes, using 10 pins, and 12 BAT54C Schottky diodes in SOT23-3 (a common cathode pair of diodes in each package). For the...
  2. Nominal Animal

    #define placement

    Adafruit #2050, 3.5" 320×480 TFT, actually uses the HX8357D controller and the Adafruit_TFTLCD library. It should not be too difficult to copy the ILI9341_t3 library as HX8357D_t4 –– that way there is no library resolution issues! –– and change the initialization commands and the rotation...
  3. Nominal Animal

    #define placement

    Oh, I just meant that it is nontrivial to do in any case, especially when you only have 320×240 display modules at hand; and not specific to Teensy at all. Making a library too general is feature creep, and since features you cannot test are likely to be buggy, it is not a good thing. It is...
  4. Nominal Animal

    Suggestions for recording data

    Mostly, it depends on how you call Serial.write(). If you use it to write individual bytes or words, Teensy 4.x tops out at about 4 Mbytes/sec. If you collect data into buffers (in binary) and write in chunks of 32 bytes or more (up to 512 makes sense), you can get 25-30 Mbytes/sec on typical...
  5. Nominal Animal

    #define placement

    In general terms in C and C++, the pattern is to define the macros before the include statements, so that in the included (library!) code you do #ifndef FOO #define FOO 456 // Default #endif /* FOO */ This means that if FOO is not defined before the include statement, it will default to...
  6. Nominal Animal

    Flashing 4.1 code on a board with a 4.0 bootloader chip

    Yep, I'm fully aware it might change in the future. As I explained above, I do have a way to work around it, by using a two-bit bus switch with inverted enable, so that a GPIO pin that is floating or low at startup (like B0_12, pin 32, which defaults to a 100k pull-down) enables the bootloader...
  7. Nominal Animal

    Flashing 4.1 code on a board with a 4.0 bootloader chip

    @PaulStoffregen: Ping? Does the current bootloader version work with GPIO_B0_13 (BGA pin D10) – MKL02 PTB4 (pin 12) not connected?
  8. Nominal Animal

    Flashing 4.1 code on a board with a 4.0 bootloader chip

    @PaulStoffregen: Is this still true for the current bootloader version (as of 2024-01-31)? Or would it be better to use a digital bus switch, for example Toshiba TC7WB67CFK, to ensure it is connected (and other functions for the B0_13 pin disconnected) by default during bootup, and only...
  9. Nominal Animal

    Combining two 32-bit values into one 64-bit value: unexpected result

    You can obviously fix that by usingLRsample = (((uint64_t)((uint32_t)leftSample)) << 32) | ((uint32_t)rightSample); It is important to first cast the value to the same size but unsigned, to prevent sign extension. You can safely assign an unsigned expression to a signed variable of the same...
  10. Nominal Animal

    Teensy 4.0 5v Serial Tolerance?

    That makes even more sense to me too. The current-limiting series resistor is often used with logic IC chips with signal levels exceeding VCC, and their datasheets often mention it (and it works because of small rail-clamping diodes within the IC itself).
  11. Nominal Animal

    Teensy 4.0 5v Serial Tolerance?

    In series with the RX and TX signals, of course, so they'd limit the current in the signal to what the tiny little ESD diodes or whachamacallits' in the Teensy can handle; sure. I just prefer those level translators and isolators, because they're cheap, simple, and robust. I don't even know...
  12. Nominal Animal

    Teensy 4.0 5v Serial Tolerance?

    Is there a reason you're not using a TXU0202 (Mouser, DigiKey) or even two 74LVC1T45's in SOT-26 (LCSC, Mouser) dead-bugged (soldered directly to wires and covered with heatshrink)? I keep telling microcontroller users to stock up on unidirectional level shifters (TXU0202 for UART, TXU0204 for...
  13. Nominal Animal

    Odd sized screen - just can't find an option

    BuyDisplay ER-TFT034-1 is 42.6mm × 92.8mm (display itself 38.24mm × 86.02mm, so touch panel could sit on top), with IPS panel and 412×960 resolution, and a capacitive touch panel; but is difficult to drive as it expects continuously refreshed RGB data in parallel (ST7701S controller). It would...
  14. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    The series resistor is placed between the IC pin that drives the signal voltage, and the rest of the signal trace. (If we put the series resistor on the other side, near the input pin, we get reflections and other nasty stuff, because electrical signals propagate at a finite speed.) You see...
  15. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    Use one SPI as a master, connected to CLK+MOSI+MISO1. Then, use another SPI as a slave, connected to CLK+MISO2, with MOSI unconnected. Teensy 4.x are all well suited for this. If you want more parallel buses with the same clock, you could use two SN74HCS157 per socket, for CLK + MOSI1 + .. +...
  16. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    I do suspect the issues alexandros is seeing are due to timing mismatch between clock and data signals, as well as noise. Schmitt triggers on input can help with the noise, but to fix the timing issues, both clock and data signals must be routed the same way (with roughly the same length...
  17. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    For pure shift registers: Let's assume we use three signals: SCLK, MOSI, and MISO. Each socket receives SCLK_PREV, MOSI_PREV, and MISO_PREV from the previous socket, forwarding them to the next socket as SCLK_NEXT, MOSI_NEXT, MISO_NEXT. (That is, SCLK_NEXT in socket 2 is the same as SCLK_PREV...
  18. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    Yep; there are many digital isolator chips available with different configurations (both unidirectional and bidirectional, different number of channels, different channel direction configurations for unidirectional one) that can also do voltage level shifting. I personally prefer ISO6721 (or...
  19. Nominal Animal

    Trying to pass SPI signals through transistors, but it doesn't seem to work

    Instead of a tree-like structure, where the signals pass through several transistors, you should consider a bus like structure. I prefer to use unidirectional voltage level translators like TI TXU0304 for SPI, TXU0204 for UART with hardware RTS/CTS, and TXU0202 for UART RX/TX; with the OE...
  20. Nominal Animal

    comms over USB serial

    Thanks! This backs up my claim and understanding, because the only difference between the two (25+ MB/s vs. under 5 MB/s) is how Serial.write() is called in the Teensy sketch. Based on this, we can recommend Teensy developers use a buffer (buf) of suitable size (len, for example 32), and if...
  21. Nominal Animal

    Forum switching to new SSL cert

    And for completeness, works absolutely fine on Linux as well.
  22. Nominal Animal

    comms over USB serial

    If you want, you could change the Teensy sketch (replacing #if 0 with #if 1), with no changes to the Linux program. You should see the transfer rate drop down to 4-5 MB/s. (To repeat, the only difference is that the #if 1 version uses Serial.write() for each byte separately on Teensy; the...
  23. Nominal Animal

    comms over USB serial

    Here is the sketch I use for Teensy USB Serial benchmarking: // SPDX-License-Identifier: CC0-1.0 // Size of outgoing buffer constexpr size_t packet_size = 32; constexpr size_t packet_words = packet_size / 4; uint32_t packet[packet_words]; // Xorshift64* pseudo-random number...
  24. Nominal Animal

    comms over USB serial

    It's not that. The 4 to 5 MB/s limit occurs when you use Serial.write() for each byte to be sent, instead of filling a buffer (of up to Serial.availableForWrite() bytes) and send the filled buffer using Serial.write(buffer, bytes). If you use a 32 byte or larger buffer, you can expect to reach...
  25. Nominal Animal

    Level shifting a 5V input down to 3.3V for Teensy 4.0

    I like using TI TXU0n0m unidirectional voltage level shifters. In this case, a TXU0101 would work well. It works at up to 200 Mbit/s rates, with the 5.0V-to-3.3V (or vice versa) propagation delay being 11ns maximum. TI recommends using a 0.1nF supply bypass capacitor on each supply pin...
  26. Nominal Animal

    test thread

    The DNS update reached me too, and everything seems to work fine. I did have to set my avatar image, but I'm not sure I had one set before. Other than that, everything seems to have transferred over correctly. (y)
  27. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    Apologies for spamming the thread, for the content firehose, and posting such annoyingly long posts, but here's the LM4048-2.048V (or any other 2.048V shunt voltage regulator that works in the 0.2mA - 10mA range)-based circuit, with component-by component explanation. I am posting this only...
  28. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    I realized I forgot to post links to good articles on the web describing the constant current sink using BJT and MOSFET the above schematic is based on; with the LM4040 just very precisely limiting the backlight control voltage to 2.5V and thus the current over the LEDs. Apologies! The main...
  29. Nominal Animal

    Need help with USBSerial device not getting recognized by teensy 4.1

    If the underlying reason is USB host support lacking something necessary for high-speed (480 Mbit/s) serial support to work, you could just use one of the cheap ($10/10€) ADuM3160-based USB isolators you can get off eBay and elsewhere, between Teensy and the USB serial device. If you get one...
  30. Nominal Animal

    Triple USB faster than one on Teensy 4.1 with Linux host??

    You're using USB Serial and the Linux ACM driver (because /dev/ttyACMn), which in Linux goes through the tty subsystem. This is basically geared towards human data rates with stuff like timeouts in 0.1 second units built right in, and its internal latencies become a bottleneck at high data...
  31. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    You should probably tell them you do have 5V also available; there is no need to power the backlights from the 3.3V supply. Here is what I would suggest, as a hobbyist myself (click to embiggen): I consider the above schematic to be obvious and well known, in the public domain. There are two...
  32. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    Excellent! Those provide all the information we need! (I have designed one similar board like the one you have, for someone who wanted to use BuyDisplay ER-TFT028A2 on a Seek Reveal Pro (replacing the TM024HDH71 display), using the ILI9341 controller (yours uses ST7789; both common). The...
  33. Nominal Animal

    MPR121 multiple board issue

    No idea, unless you have a long wire from the ADDR pin that picks up electrical noise, or a short between the ADDR pin and one of the electrode pins. Fortunately, easy workarounds do exist, specifically in the form of an additional PCA9546A or PCA9548A chip, letting 4 or 8 MPR121's with the...
  34. Nominal Animal

    ILI9341 variable writing over iteself

    The line tft.println(i); will only draw the characters on top of the existing image. Don't think of drawing the characters as "foreground on background", but like transparency sheets. To make the number legible, you need to clear the area to a background color first, before you slap that...
  35. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    Your schematic shows Teensy pin 8 connected to the LCD module BL pin. There are several ways that BL might be connected: 1. Direct connection to backlight LED anodes, cathodes to ground, optionally with a current-limiting resistor in between. 2. Direct connection to backlight LED cathodes...
  36. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    Me hobbyist only. I can't even tell if you're being kind, or sniping at me. ;) I don't think so, because powering the LCD backlight from a GPIO pin is the key problem, I believe. If you use a multimeter in milliAmps mode, using its probes to replace the wire from Teensy pin 8 to display BL...
  37. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    To drive LEDs, you do need to limit the current somehow. I fear that if you connect BL directly to 5V, it will burn out the backlight LEDs, unless the module contains a limiting resistor in itself. Bipolar junction transistors or MOSFETs can be used for this purpose. Since you want to use PWM...
  38. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    No, just a single three-pin SOT-23 part, and two or three resistors. You can dead-bug this, i.e. solder directly to wires, and put heatshrink on top to keep it well contained. (SOT-23 (SOT23-3) is just 2.9mm by 1.3mm body, with one leg in the middle of one side, and two legs on the opposite...
  39. Nominal Animal

    Screen Brightens when Faders are Moved - Teensy 4.1

    You're driving the LCD backlight (LEDs) from a GPIO pin directly. Backlight LEDs tend to need more current than a GPIO pin can provide, so anything happening in the same circuit will affect the current to the backlight. If the backlight is white, the 3.3 volt level you supply to the backlight...
  40. Nominal Animal

    Teensy MicroMod PCB thickness increased

    I welcome the stiffer MicroMod. The one I have bends alarmingly when in use; MLCCs and BGA pads really do require a stiff board or problems ensue (as we've already discovered with the MicroMod pad issues). I've looked at making my own board based on Teensy 4 and the PJRC-programmed bootloader...
  41. Nominal Animal

    Possible to use Teensy AS the keyboard to replace 8x8 matrix?

    The project can be split into two parts: Teensy as a host for a standard USB keyboard. This is well supported by Teensyduino: you can use Teensy 4.1 or 3.6 (easiest, with USB host port exposed on pins, so you only need to plug in a suitable cable), or Teensy 4.0 (soldering an USB female...
  42. Nominal Animal

    Taylor series equation - angle value setup

    I agree: taylor(1073741824) returns = -2147483522. When lines 84-88 of https://github.com/PaulStoffregen/Audio/synth_sine.cpp are changed to if (ph >= 0xC0000000 || ph < 0x40000000) { // ph: 0.32 angle = (int32_t)ph; // valid from -90 to +90 degrees } else {...
  43. Nominal Animal

    Query Re Connecting Multiple Teensies Together

    KD5RXT's suggestion is what came to my mind first as well. Other options do exist. One is to use a dual supply voltage level shifter IC like TI TXU0202 (UART RX+TX), TXU0204 (UART RX+TX+CTS+RTS), or TXU0304 (SPI), which keep all outputs high-Z (as if not connected) until both voltage supplies...
  44. Nominal Animal

    Need help with teensy USBhost to Arduinio HID mouse interface

    I wonder if it could be as simple as there not being enough current available for the Pro Micro clone mouse. How much current does that thing draw from the USB bus anyway? (The small USB dongley voltage and current meters you can get for very cheap, are really useful for this.)
  45. Nominal Animal

    Issue using a 5V encoder with Teensy 4.1

    If I checked your picture right, you have a 38S6G5-B-G24N optical rotary encoder. You should have mentioned the model number in your original post, because that would have saved everyone a lot of confusion. 38S6G5-B-G24N are optical rotary encoders made by various Chinese manufacturers, but...
  46. Nominal Animal

    5v encoder (600PPR) for JOGWHEEL

    Yes, exactly. All that is needed is a pull-up resistor to 3.3V per output. This is an "open collector" output, so named because the output is the collector from an NPN transistor (which is not connected to anywhere else). The exact value of the pullup is not very important. At 3.3V, a 1kOhm...
  47. Nominal Animal

    Issue using a 5V encoder with Teensy 4.1

    Note that without the datasheet describing the encoder precisely, we do not know if it has open collector/open drain outputs or not. Like I explained, open collector/drain output is common, because it is so simple for optical encoders: the axis has a disk with radial opaque and transparent...
  48. Nominal Animal

    Issue using a 5V encoder with Teensy 4.1

    Not all encoders will work with open-drain/open-collector outputs to pulled to 3.3V, if they're specified to work with 5-20V. In the simplest optical encoder designs, the outputs are from phototransistors with emitters grounded and collectors directly as outputs. These will work down to...
  49. Nominal Animal

    Issue using a 5V encoder with Teensy 4.1

    I recently got involved with a surprisingly similar issue, namely interfacing 12V PWM-controlled 4-pin fans, where (Intel 4-pin PWM fan spec) the PWM is an open collector output, and the tachometer signal from the fan (two pulses per rotation) is open collector output, but requiring a pull-up to...
  50. Nominal Animal

    Serial.Printf limit on decimal places

    No, you can use strtod(). Use example: // src points to the number, or to whitespace preceding the number. // It can also be a buffer. If it is n'th character in buffer, just use (buffer + n) instead. char *src; // end will point to the first character after the parsed...
Back
Top