Search results

  1. D

    Teensy 3.6 looses programming

    I built an MP3 player out of a spare Teensy 3.6, the audio library, and Frank Boesing's codec library, using parts I had laying around. I use a FRAM chip to store filename hashes for "shuffle" play. I added an LED that's first lit in startup_middle_hook and then blinks at a 0.5 Hz rate under...
  2. D

    Teensy 3.6 looses programming

    The first project that "lost" programming is an MP3 player in a 1920's "Tombstone" radio case. It has two LEDs as a tuning indicator, a bluetooth module connected to Serial2, some buttons, and two analog inputs for volume and tuning. The USB port is only connected for programming and debugging...
  3. D

    Teensy 3.6 looses programming

    Every time a Teensy 3.6 has lost its programming I've rebuilt the image from source, using the current Teensyduino. I've had a loss of programming using Teensyduino version 1.58. When I had to reprogram it a few days ago I used Teensyduino 1.60. In my case if after a power cycle the Teensy...
  4. D

    Teensy 3.6 looses programming

    I have four Teensy 3.2 systems in daily use, with another twenty or so out in the wild. I also have two Teensy 4.1 systems running. I've only had a problem with the Teensy 3.6 systems. A Teensy 4.1 and a Teensy 3.2 are plugged into the same power strip as the recently failed Teensy 3.6, all...
  5. D

    Teensy 3.6 looses programming

    I just had it happen again on a Teensy 3.6, power supplied through a 5v wall-brick. The device was working fine until the AC power went out. When the power was re-applied the Teensy 3.6 appeared dead. I connected the Teensy 3.6's USB to a PC and it wasn't recognized until I held the program...
  6. D

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

    I haven't had problems with the higher data speeds of the APA102 or SK6812 LEDs. My Infinity Mirror Clock has a string of 120 APA102 LEDs, updated 120 times a second. My Ring Clock has a strand of 276 APA102 LEDs and a second strand of 222 APA102 LEDs. The strand of 222 is updated 118 times a...
  7. D

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

    I've used a TXB0104 breakout on many projects to control APA102 LED strips without problems. One example is my Infinity Mirror Clock
  8. D

    Staggering PWM to Reduce Power Supply Noise

    You could try using analogWriteFrequency() to adjust timings. See td_pulse for details. For your example of using pins 1 through 6, pins 2 and 3 share a timer on Teensy 4, so using analogWriteFrequence() on pin 2 will also affect pin 3.
  9. D

    Cheap MPR121 - disconnect ADD from ground?

    The two blobs are for when you change your mind and want ADD tied to ground. You can then bridge the two blobs with more solder.
  10. D

    Use 2 pins to power LED?

    When changing two (or more) pins tied together, first use "pinMode()" to change the mode of the pin(s) not being changed. Use "INPUT_PULLUP" if changing the pins to HIGH, and "INPUT_PULLDOWN" if changing the pins to LOW. Once all but one pin is in the in the appropriate INPUT state, change the...
  11. D

    16 bit DAC with a clock signal

    You should be able to do it with the "shiftOut()" function call. Something like shiftOut(Out1, Clock1, MSBFIRST, D1>>8); shiftOut(Out1, Clock1, MSBFIRST, D1 & 0xff); digitalWriteFast(Latch, LOW); digitalWriteFast(Clock1, HIGH); digitalWriteFast(Clock1, LOW); digitalWriteFast(Latch, HIGH);
  12. D

    RA8876LiteTeensy For Teensy T36 and T40

    Looks like the Lite library uses genitopCharacterRomParameter() to select the external font ROM. Something like: genitopCharacterRomParameter(RA8876_SERIAL_FLASH_SELECT1,RA8876_SPI_DIV4,RA8876_GT30L32S4W, RA8876_ASCII, RA8876_GT_VARIABLE_WIDTH_ARIAL); or...
  13. D

    RA8876LiteTeensy For Teensy T36 and T40

    Here's the code from the library I've been using. The entries might be named something else in the current library: void RA8876::initExternalFontRom(int spiIf, enum ExternalFontRom chip) { // See data sheet figure 16-10 // TODO: GT30L24T3Y supports FAST_READ command (0x0B) and runs at...
  14. D

    RA8876LiteTeensy For Teensy T36 and T40

    With an older version of the library I used ExternalFontRom rom = RA8876_FONT_ROM_GT30L32S4W; tft.initExternalFontRom(0, rom); tft.selectExternalFont( RA8876_FONT_FAMILY_TIMES, RA8876_FONT_SIZE_16, RA8876_FONT_ENCODING_ASCII); then to switch to Arial I only had to use...
  15. D

    Teensy 4.1 Problem setting output pin before its declaration

    You could try tying just the pull-up for the gate input of the 74HC595 to the Teensy's 3.3v regulator. The rest of your circuit can continue to use the your 3.3v supply.
  16. D

    Teensy 4.1 Problem setting output pin before its declaration

    Have you tried setting the pin mode to "INPUT_PULLUP" before setting the pin mode to "OUTPUT"? Like: extern "C" void startup_middle_hook(void); void startup_middle_hook(void) { pinMode(24, INPUT_PULLUP); pinMode(24, OUTPUT); digitalWriteFast(24, HIGH); } The pin will start in...
  17. D

    teensy 4.1 coding guidance for USB serial communication

    My point is that to make Python run fast the library is in C/C++ and not native Python.
  18. D

    teensy 4.1 coding guidance for USB serial communication

    I hate to tell you this, but Numpy and Scipy are not written in Python. They have a Python interface, but the "optimized, vectorized libraries" are written in C/C++.
  19. D

    Noise Issue with Teensy 4.1, Audio Shield, and PAM8403 Amplifier

    I used this 12v 5A Switching Power Supply to feed the barrel connector on this Stereo 20W Class D Audio Amplifier. I replaced the included power supply capacitor with a low-ESR aluminum-polymer capacitor. I used the power supply screw terminals on the amplifier to feed a small circuit board...
  20. D

    Noise Issue with Teensy 4.1, Audio Shield, and PAM8403 Amplifier

    Would something like this 2.5W mono amp work for you? I've used a Class D amp in a project, only using the stereo outputs of a Teensy 3.6. I powered a 20w stereo class-D amp with a 12v wall brick, and used a 12v to 5v regulator to power the Teensy 3.6. The only problem I had was with a...
  21. D

    Daisy Chain SPI Shift Register Control with Teensy 4.1

    How did you get 44.1 kHz using a 22.05 kHz interrupt? Looks to me like it was 11.025 kHz.
  22. D

    Teensy 4.0/4.1 Serial1.AttachCts

    CTS is an input, RTS is an output. The output of an 74HC14 inverter connects to the CTS-XBAR pin. The RTS signal from the other teensy connects to the input of the 74HC14 inverter. The diagram here: uart flow control may help. You can ignore the "Legacy Hardware Flow Control" section.
  23. D

    Teensy 4.0/4.1 Serial1.AttachCts

    You will indeed need to invert the CTS output. If you switch to Serial3 instead of Serial1 you can use pin 19 for CTS and not need an inverting buffer. If you can't use Serial3 and have two unused pins on your teensy you can build your own inverter in software, just tie your CTS pin to an used...
  24. D

    looking for recommendation for selector knob

    I've used a 12-position rotary switch as an input. I put 1K resistors between each terminal, creating a voltage divider. The last terminal goes to ground, the first terminal through another 1K resistor to +3.3v. The wiper goes to an analog input. I used a tree of "if" statements to detect...
  25. D

    How to use attachInterruptVector in Teensy 4.1 with Teensyduino to call instruction when Serial write buffer has transmitted all bits

    You could use "Serial3.flush()" rather than "delayMicroseconds(1150)". The flush() call will block until all the data has been transmitted. Information on the serial hardware is listed at td_uart.html
  26. D

    Teensy 4.1 Problem setting output pin before its declaration

    Here's another link describing the startup hooks: td_startup
  27. D

    Teensy 4.1 Problem setting output pin before its declaration

    There are many housekeeping steps performed before setup() is called. The Teensyduino environment has three hook routines that are called before setup(), so you can customize the startup. Here's a posting that describes the hooks: setup hooks In your case I'd use the "setup_middle_hook()"...
  28. D

    Humidity issues

    I've had similar problems, due more to power cycles than humidity. In my case they are teensy 3.6 processors that are indoors. I just had another teensy 3.6 lose programming, in a totally different project than the ones described here.
  29. D

    led-cube 15x

    A simple animation is to pick one of the eight corners and draw a wire-frame cube at the corner, starting with a line of length one, then two, then three, and so on until the entire 15x15x15 cube is outlined. Start reducing the line length back down to a single point, then choose another corner.
  30. D

    led-cube 15x

    I've attached a zip file of the perl code and the perl code output. For the 8x8x8 cube I'm only storing one bit per LED in flash. A random color is selected before the animation starts and every point has the same color. The rain/fireworks/worms code (not included) uses varying colors.
  31. D

    led-cube 15x

    Years ago I built an 8x8x8 cube using an arduino uno (ATmega328 processor). I display several animations, sixteen frames each pre-calculated and stored in flash. I have the "Sombrero Function", a wave, a spiral, and a rotating caltrop/jack. In addition I have dynamic animations of rain...
  32. D

    Adding Bluetooth and WiFi to a Teensy 4.1

    A few years ago I built a clock around an ESP32. I wanted WiFi to get the time using NTP and Bluetooth to change clock parameters. I discovered that the ESP32 could only do one or the other, not both simultaneously. Since I only needed WiFi for NTP I decided to primarily use Bluetooth. When...
  33. D

    Timelib.h and Daylight saving Time

    I use this library: Timezone
  34. D

    Beware! T4x RTC power consumption

    I power the RTC using a super capacitor, like this one: 1.5F 3.5v cap. I use a schottky diode between the Teensy's 3.3v output and the RTC power input to charge the cap. With a Teensy 3.2 it powers the RTC for several days. I haven't experimented with a Teensy 4.1, but I expect it to last a...
  35. D

    T4 NVRAM (SNVS_LPGPR0..3) and the penalty of using it?

    I've used an external F-RAM chip on a Teensy 3.6 like MatrixRat suggested in Post #13. If you're using a Teensy 4.1 you should be able to use a QSPI F-RAM chip as noted here...
  36. D

    Teensy 3.6 looses programming

    In my case it is known working code that goes missing. I have no problem uploading and running the code. In one case it's an MP3 player that is turned on a few times a week. The most recent case is a clock that's been running for several years. See...
  37. D

    Teensy 3.6 looses programming

    I just had a 2nd T3.6 lose it's programming. After a power "flicker" the T3.6 appeared dead. The PC didn't even see the T3.6 over the USB connection. After holding the reset button down for 15 seconds the PC could see the T3.6 and I could reprogram it. The power supply for this T3.6 is a...
  38. D

    DACs Teensy 3.5

    Looks to me like there is only one analog write in the for loop, with the second analog write after the for loop. Try this code: // Test DACs sine wave on Teensy 3.5 const int sine_dataA[192] =...
  39. D

    Teensy 3.6 looses programming

    The code is only reading from EEPROM, it's not saving any data there. I do use Serial to read commands and update the EEPROM, but I'd have to have the USB connected for that and it is only rarely connected. Even then the code only writes to EEPROM if the data from Serial is properly formatted...
  40. D

    Teensy 3.6 looses programming

    Under what circumstances would a Teensy 3.6 loose its programming? Several times I've had a Teensy 3.6 appear to die but really it just needed re-programming. I have to hold down the reset button for 15 seconds and then the Teensy 3.6 comes back to life. The teensy 3.6 is in an MP3 player...
  41. D

    Teensy 4.1 - NTP/PTP/RTC

    Here's the problem: const long SECS_PER_TICK32 = pow(10, 12) / pow(2, 32); const long SECS_PER_TICK15 = pow(10, 12) / pow(2, 15); ... ntp_fracPicos = fracSecs * SECS_PER_TICK32; ... int rtc_fracMicros = time_fracs * SECS_PER_TICK15; "const long" creates 32-bit constants...
  42. D

    Teensy 4.1 - NTP/PTP/RTC

    The NTP packet does not include fractional time in nanoseconds. The 32-bit field for fractional time is in the full 32-bits. It counts from 0 - 4294967295, or about 233 picoseconds per tick. Dividing the fractional seconds by a billion as in "Trx=epoch+(fracSecs/1E9);" does not give you the...
  43. D

    Teensy 4.1 - NTP/PTP/RTC

    NTPv3 and below use 32-bit seconds and 32-bit fractional seconds. NTPv4 use 64-bit seconds and 64-bit fractional seconds. The Teensy 4 RTC has a 64-bit counter incremented 32768 times a second. If you take the seconds component of an NTP packet and convert it to seconds since 1970, that...
  44. D

    Teensy 4.1 - NTP/PTP/RTC

    The SNVS_HPRTCMR and SNVS_HPRTCLR registers together form a 64-bit counter incrementing 32768 times a second, asynchronously from the CPU clock. The lower 15 bits are returned in the readRTCfrac() call, which will range from 0 - 32767. This represents a fraction of a second, where 32768 would...
  45. D

    Teensy 4.1 - NTP/PTP/RTC

    Try this for your loop() void loop() { delay(1000); uint64_t tmi = rtc_get_64(); // Convert the time value to seconds uint64_t time_seconds = tmi >> 15; uint64_t time_microseconds = ((tmi & 0x7fff) * 1000000ULL) >> 15; Serial.println("----------------------------")...
  46. D

    Teensy 4.1 - NTP/PTP/RTC

    I suggest you read through https://forum.pjrc.com/threads/61665-RTC-Registers-and-Millisecond-Precision-from-Teensy-4-0 Turns out the SNVS_HPRTCMR and SNVS_HPRTCLR together form a 64-bit counter incrementing 32768 times a second. In the following code: #include "imxrt.h" unsigned long...
  47. D

    Teensy 4.1 - NTP/PTP/RTC

    The code I submitted works for either Teensy 4 or Teensy 3, controlled by a "#define TEENSY4" if you want Teensy 4. Here's the readRTCFrac() code for only Teensy 4: #include <imxrt.h> /******************************************************************************/ // Read the RTC fractional...
  48. D

    Teensy 4.1 - NTP/PTP/RTC

    Paul posted this code: extern "C" int _gettimeofday(struct timeval *tv, void *ignore) { uint32_t hi1 = SNVS_HPRTCMR; uint32_t lo1 = SNVS_HPRTCLR; while (1) { uint32_t hi2 = SNVS_HPRTCMR; // ref manual 20.3.3.1.3 page 1231 uint32_t lo2 = SNVS_HPRTCLR; if (lo1 == lo2 && hi1 ==...
  49. D

    TEENSY 4.1 RTC battery

    I've had success using a 0.5F capacitor tied to VBAT. I charge the capacitor using a schottky diode tied to the Teensy's 3.3v pin. The capacitor keeps the RTC running for over a day without power. I've not tried a coin cell.
  50. D

    Booster for Fastled

    If the 3.3v signals are reliable to the first LED, then using the first LED as a level shifter should work. I've used a TXB0104 level-shifter chip with APA102 LEDs without any problem. If you don't want to handle SMD chips a break-out board is available such as...
Back
Top