Search results

  1. Nominal Animal

    Very unusual behavior TRNG

    As in a reputable cryptographer saying this is okay, no, not exactly. The current state of the art in CSPRNGs is fast-key-erasure random-number generators. The /dev/urandom in the Linux kernel is a well-known, well-examined implementation. DJB describes the case for when using AES-256-CTR...
  2. Nominal Animal

    Very unusual behavior TRNG

    Very true, but none of the standard PRNGs are. And as illustrated by the problem at hand, I would definitely not trust an MCU hardware entropy source to be cryptographically secure either, noting that the Pedersen2006 reference is not applicable here at all. Even if one was using a dedicated...
  3. Nominal Animal

    Level Shifting for HD108 and SK9822 LED Strips (And Older APA102, HD107)

    Because I often use Teensy to interface to SoCs, I keep some TI TXU0n0m, 74LVC1T45, and 74LVC8T245 voltage level translators in stock. Each side has their own supply (but share the same GND, these are not isolators), and you should add a 100nF supply bypass capacitor between each VCC and GND...
  4. Nominal Animal

    Very unusual behavior TRNG

    Can I ask you why you don't use the 32-40 high bits of Xorshift64* PRNG with 64 bits of state, and have the WDT (or even systick) interrupt mix some entroy if available the state (via addition or exclusive-or)? All 64-bit states except zero are valid and produce good sequences. If one uses...
  5. Nominal Animal

    Qualcomm Arduino license changes

    I agree. In particular, the T&C only concerns the arduino.cc website and related services, not the software — which even I missed on the first read —, and the licenses governing the software (AGPL for the IDE, GPL for the cli tools) have not been modified at all. Considering the number of...
  6. Nominal Animal

    Looks like I will soon have yet another distraction - Arduino UNO Q

    According to Adafruit's Phil Torrone, https://x.com/ptorrone/status/1990833856182653171 it does not look good. I warmly recommend checking the modified Arduino Privacy Policy and Terms and Conditions. I'm not sure I can agree to those terms and conditions myself. Thus far the software...
  7. Nominal Animal

    4 wire fan speed control

    (I did create my own single and dual 12V PWM fan controllers using ATtiny85 AVR MCUs (ATTINY85-20PU). Both the schematics and the board files are in Public Domain / CC0-1.0, but I haven't written the firmware yet; I'll use the dual one for my DIY soldering fume hood with 2/3/4 120-140mm 12V PWM...
  8. Nominal Animal

    4 wire fan speed control

    The PWM signal is open drain/collector; I recommend using a BSS138 or NX138AKR N-channel enhancement mode logic level MOSFET, with source to ground, drain to the fourth pin of the 4-pin fan connector (MOLEX 47053-1000), and gate to a 100Ω – 220Ω current limiting resistor which is connected to a...
  9. Nominal Animal

    Print signed int

    There is no signed hexadecimal format support that I know of. However, it is simple to implement: if ((int16_t)value < 0) { display.print("-"); display.print((uint16_t)(-(int16_t)value), HEX); } else { display.print("+"); display.print((uint16_t)value...
  10. Nominal Animal

    Teensy + Audio shield only works when connected to PC-USB

    The while (!Serial) ; line in your setup() function waits until an application opens the USB serial port. Since wall warts provide only power, your Teensy will wait for that to happen forever. So, just remove that line.
  11. Nominal Animal

    OpAmp and Teensy 4.1

    I like to use I²C or SPI digital-to-analog converters myself. For example, MCP4725 is a single 12-bit I²C ratiometric DAC (output depending on the supply voltage, no separate reference voltage) in SOT23-6, small but hand-solderable, with one I²C address selection bit/pin. There are four...
  12. Nominal Animal

    using a buck dc-dc convertor from an unregulated power supply to power Teensy

    I agree with MarkT. If you use the larger packages like TO-220-3 with a suitable heatsink (but consider what the potential on the tab is, and whether you need an isolating "silpad" or mica sheet in between; Mouser/Digikey/etc. sell these and they're cheap), it is only a matter of getting rid of...
  13. Nominal Animal

    using a buck dc-dc convertor from an unregulated power supply to power Teensy

    But the TLV75733P on the Teensy has an absolute maximum input voltage of only 6V, so it is that linear regulator that may go bork if a voltage spike occurs. Let's say you have buck regulator outputting 6V, with at least 4.7µF capacitance on the output (X7R ceramics if no any requirements)...
  14. Nominal Animal

    using a buck dc-dc convertor from an unregulated power supply to power Teensy

    I would use a buck to 7V-9V, and a robust linear regulator down to 5V, with datasheet-suggested capacitors before and after. DC-DC converters can have issues like overshoot at very low loads or overshoot spikes at certain fault conditions. While you can design/choose a DC-DC converter without...
  15. Nominal Animal

    Fast 8 bit parallel I/O for T4.0

    For a 8-bit wide bus using GPIO6 bits 16-19, 24-27, I'd use temp = val ^ state; GPIO6_DR_TOGGLE = ((temp & 15) << 16) | ((temp & 240) << 20); state = val & 1023; to update the bus state to val. For a 10-bit wide bus using GPIO6 bits 16-19, 22-27, I'd use temp = val ^ state; GPIO6_DR_TOGGLE =...
  16. Nominal Animal

    Is GPIO9_DR volatile?

    As you can see in cores/teensy/imxrt.h, GPIO9_DR is accessed via a structure where the target member is volatile. The link is to Paul's Github repo for the Teensyduino cores, with each release version having their own tag. It is possible to use the GCC compiler...
  17. Nominal Animal

    GPIO2 DMA access issue

    You also need to select GPIO2 instead of GPIO7 for pin 13, by clearing bit 3 of IOMUXC_GPR_GPR27; see page 323 of the reference manual. That is, add IOMUXC_GPR_GPR27 &= ~(0b1 << 3); in setup().
  18. Nominal Animal

    MathJax support for the forum?

    I love to help with applied math stuff, especially 2D vector algebra and versors/unit quaternions/bivectors describing rotations and orientations (the implemented math is exactly the same for the four components), most recently this one. These would be much nicer if we could use MathJax here...
  19. Nominal Animal

    Directional change in joystick

    I'll expand on MarkT's post above, starting from the very basics, so that everyone can follow. (Also, MarkT, your rotation matrix is transposed wrt. standard right-handed coordinate system and column vectors: it's usually the upper right sine that is negated, not the lower left one. It only...
  20. Nominal Animal

    Problem with size of enum variables

    C and C++ are completely different programming languages. The snippet shown uses C++ syntax, and does not compile as C, not even as C23. I stand by my claim of using the C++11 and later syntax for specifying the underlying type for the enum type, because the rest of the code is already C++ and...
  21. Nominal Animal

    Problem with size of enum variables

    The quoted code is C++, not C, and since C++11, one can define the underlying type for the enum as I showed above.
  22. Nominal Animal

    Problem with size of enum variables

    Use typedef enum LEP_SYS_ENABLE_E_TAG: uint32_t { LEP_SYS_DISABLE = 0, LEP_SYS_ENABLE, } LEP_SYS_ENABLE_E, *LEP_SYS_ENABLE_E_PTR; so that the underlying type of the enum is an unsigned 32-bit integer. You can use any other integral type besides uint32_t the same way. This is valid C++...
  23. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    I fully agree with Paul above, both in intent and definitions. By "floating", I specifically meant that the supply does not tie its outputs to any specific potential; it only keeps the positive output a specific voltage above the negative output, up to a maximum current draw; and only up to a...
  24. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    Reread my first message. I wrote, "If you need your Teensy to have a different ground potential than the computer (USB GND pin potential), you do need to use an USB isolator." It is critical that you understand that "1 V" describes a difference of one volt. In Teensies and other...
  25. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    You have to, actually. They must be directly connected for the USB isolator to work correctly. It's the 5V output from the isolated DC-DC supply that needs a bit of care. In this case, the Teensy is powered from a separate supply (and its GND must be directly connected to Teensy GND and thus...
  26. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    If you connect the external power supply to Teensy+isolator when nothing is powered yet, there should not be enough energy in the circuits to cause an ESD event (other than in the same scale that happens ordinarily/all the time), so no bleed resistor is needed. In fact, a resistor between the...
  27. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    That uses K-Cut B0505S-1WR3 isolated DC-DC supply, which has a minimum load of 20mA. So, you need a cable between the isolator and Teensy where the 5V line broken, not connected to anything on the Teensy side, and on the isolator side 5V and GND connected using a 250Ω quarter-watt (or...
  28. Nominal Animal

    How does grounding work if I cut the 5V pads or connect schottsky diodes while keeping the USB plugged in?

    If you need your Teensy to have a different ground potential than the computer (USB GND pin potential), you do need to use an USB isolator. Analog Devices' ADuM3160 and ADuM4160 full-speed isolators work fine with Teensies. Teensy 4.x/MicroMod automatically limit themselves to full speed, or...
  29. Nominal Animal

    Split Keyboard w/ Teensy 4.1 - Can it be done?

    I would use a pair of Teensy 4.0's, with either WS2812 or similar digitally-controlled RGB LEDs to limit the number of I/Os needed, or a dedicated LED matrix controller IC; with a nice shielded 6-wire (RX+GND twisted, TX+GND twisted, 5V, GND) cable between the two Teensies using high baud rate...
  30. Nominal Animal

    Custom PCB for ER-TFT028A2-4 IPS TFT Display (ILI9341)

    I have the same displays, and have played a bit with different ways of driving the LEDs. I have not built it this suggestion yet myself, but (KiCAD/ngspice) simulations show it should work fine at up to 10 kHz PWM. The idea is to use a low-drop adjustable linear regulator like TLV75801P as a...
  31. 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...
  32. 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...
  33. 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...
  34. 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...
  35. 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...
  36. 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...
  37. 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?
  38. 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...
  39. 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...
  40. 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).
  41. 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...
  42. 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...
  43. 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...
  44. 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...
  45. 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 + .. +...
  46. 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...
  47. 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...
  48. 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...
  49. 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...
  50. 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...
Back
Top