Search results

  1. S

    High Temperature Environment

    80 C ambient temperature is a challenge. The Teensy CPU easily adds 20 C when it’s working at 528 MHz. It has internal temperature sensors that shut it down when it sees it’s getting too hot. The trigger point for that can be increased a little bit in software, but probably not high enough for...
  2. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    PS this is not your level shifter i hope? https://tinkering.vandoeselaar.com/wp-content/uploads/2019/04/cdj-shifter.jpg (this will push 5V high levels onto the 3V power rail... the hysteresis will not work as intended… caps on the CLK and DATA lines…)
  3. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Looks like it reports many more bytes received than what your master sent. Strong hint that your SPI clock signal at the slave input really sees more than 27*8 edges. And thus registers more bytes received while the CS was low. As it depends on what’s in the TX buffer, it may well be the case...
  4. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Rezo, a diagram plus a photo, and the code that you use might help here. What does ‘things get messy’ look like? Are things not messy when SPI and GND wires are all short (< 5 cm)?
  5. S

    SPI data via DMA corrupt

    Then you probably have a resonating LC circuit on the SCK line. So not so much an echoing transmission line. Just LC that's ringing. 100pF... 12cm wires = 24 cm wire length = about 1 uH f0 = just a couple of MHz...
  6. S

    SPI data via DMA corrupt

    So how long is the SCK wire (PCB track) from Teensy pin to zener? And how long a copper track is GND-Teensy to same zener?
  7. S

    SPI data via DMA corrupt

    Maybe capacitance from the zener diodes. Note that the zeners are 3.3V and the logic high voltage level is also 3.3V, so already in normal operation these zeners start zenering already - with parasitic capacitance going sky-high. But you mentioned you also cut out the fuses. With that you maybe...
  8. S

    SPI data via DMA corrupt

    On “There is one other thing thing. If I change the SPI to SPI1.transfer(buffer, sizeof(buffer)); (and remove if(_spiDone)) the code only loops once and crashes after that.” - as mentioned above, echos on the Teensy SPI clock output AND INPUT pin result in your SPI shift registers clocking in...
  9. S

    SPI data via DMA corrupt

    The SPI clock speed in Hz has no impact. What matters are the ramps. So how fast the signal rises and falls. Unfortunately these are very fast transients and despite the many pin property settings i think there is no way to adjust any of that when the pin is in SPI clock out mode. And in that...
  10. S

    SPI data via DMA corrupt

    Looks to me like signal reflections on your SPI clock line. If the SPI clock signals wire gets longer then the problem starts to bite at some point. I can see the issue emerging already here in your scope image. If you had a better scope (higher bandwidth) then you would have seen that both the...
  11. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    The benefits are: * More i/o pins remain available for other use * Fewer wires to so lower cost and lower likelihood of wiring errors * Impossible to mixup input, output, tx, rx pins… But don’t forget the GND wire. There’s no such thing as 1 wire…
  12. S

    Accurate timing with RTC and timers

    A gnss module maybe? The 1 pulse per second output on legacy gps modules used to be pretty accurate already, and a UTC timestamp is given for free. Works indoors also nowadays with Galileo.
  13. S

    Teensy 4.1 PSRAM and flash

    I connected a scope and checked if the Teensy 4.1 PSRAM power-up initialization timing is as per Adafruit IC PSRAM 64Mbit SPI 133MHz 8-SOIC 'shoulds' in datasheet, ref datasheet page above. It does not. I see ~20 ms in between VDD active and CE# going high. Only 4 us after CE# went high, it goes...
  14. S

    Teensy 4.1 PSRAM and flash

    The datasheet says it does matter… And what about the 150 us? Is that respected? And keeping CLK low while /CE remains high - does it really do that? I mean how can it do that when pullups or pulldowns are still off? Think also what might happen after a soft Teensy reset, these pins may float...
  15. S

    Teensy 4.1 PSRAM and flash

    Ok, but reset state for the pin weak internal pullup is ‘off’. So what is it in the hardware that assures us that in between power on (or any) reset and executing the quoted initialisation code the /CS levels are really high? And follow VDD when booting?
  16. S

    Teensy 4.1 PSRAM and flash

    Is the problem still there after hard wiring a pullup resistor, say 100k, from VDD to Adafruit IC PSRAM /CS? Reason for asking: when Teensy boots and searches for what might be soldered in the optional PSRAM and Flash, it may not have pulled high the other unit /CS pin. The EMC_22 might still be...
  17. S

    Teensy 4.1 Datalogger using both ADCs with DMA

    here’s an example that lets you do 12 bits ADC, 1, 2 or 4 channels, up to 1Ms/s. timer triggered, to DMA. https://forum.pjrc.com/index.php?threads/t4-adc-real-time-timer-triggered-with-dma-using-adc_etc.76129/ this doesn’t yet write to SD cards, but that can be added easily.
  18. S

    Teensy 4.1 DMA based UART for Serial6, for both tx and rx

    Difficult to say without seeing the full code. If you toggle a digital output pin on your 25 us ISR entry and exit, and look at that with a scope, does it then ever miss a cycle? You can also timestamping with ARM_DWT_CYCCNT, that gets you the most accurate timestamping, running at (i think)...
  19. S

    Teensy 4.1 DMA based UART for Serial6, for both tx and rx

    Is it just with Serial6, or also Serial1, Serial2, Serial3, Serial4, Serial5, Serial7 or Serial8? Making a PWM signal in software is maybe not the best way. Hardware timers would be better. The imxrt1062 has plenty of those.
  20. S

    ADC_ETC Not Triggering (Software & Hardware Mode)

    maybe this helps: https://forum.pjrc.com/index.php?threads/t4-adc-real-time-timer-triggered-with-dma-using-adc_etc.76129/
  21. S

    Teensy 4.1 DMA based UART for Serial6, for both tx and rx

    An example for serial with DMA on T4.1: https://forum.pjrc.com/index.php?threads/using-dma-to-store-uart-byte-directly-in-teensy-3-5.71466/#post-315706
  22. S

    F1 PTC Fuse can cause heat-related reboot loops on heavily loaded Teensy 4.1 projects.

    Curt, can you share a picture on how your T4.1 is fitted in the target system? One that rules out that other electronics heats up the environment where the Teensy and its PTC sits. Plus are you using SD cards? Some cards use very high currents occasionally - i think when writing to them.
  23. S

    Repeated Teensy 4.1 Failures - Processor appears fried

    That should be a good hint. So which io pins exactly? And what does a voltmeter show when you measure from those pins to GND in a not yet failed unit? What type and voltage are the zener diodes Z7 and Z11? How exactly do you guarantee that the volts on all Teensy io pins cannot exceed 3.3V...
  24. S

    SD Card Insert Causing Reboot

    I had same problems a year ago. It was a card that had high peak currents, and a 5v to T4 power supply that could not give more than ~150 mA to that 5V line. https://forum.pjrc.com/index.php?threads/sd-card-and-max-write-current-when-is-it-safe-to-say-that-it-will-not-bite.75473/#post-346543
  25. S

    Learning the Peripheral Register Programming Model of the Teensy 4.1

    On howto “use the ADC to set up a DMA into a buffer at a fixed acquisition rate, say 10kHz to start with, at 12-bit resolution. “ Yes, too demanding for ChatGPT etc… But here’s an example that lets you do 12 bits ADC, 1, 2 or 4 channels, up to 1Ms/s. timer triggered, to DMA...
  26. S

    Beware! T4x RTC power consumption

    I also went for separate RTC chips when a battery backed RTC is needed by the application. But I'm just wondering if better software in a Teensy 4 could get us lower VBAT drain in general. Because: if I power up a T4 with only VBAT, i see 43 uA when VBAT is 3V. if I then plug in USB with 5V...
  27. S

    Beware! T4x RTC power consumption

    On why T4 and RTC coin cell batteries (CR2032, CR2012 etc) give us months but not >>3 months: is this a software bug / omission after all? Reading the many many register settings in this NXP 2023 Application note, and not getting many hits when searching T4 source codes for usage of e.g...
  28. S

    Teensy 4.1 doesn't boot with VBAT applied. No v3.3 generated.

    Maybe you have solder flux leftover or splashes that form a resistor, at delicate points such as nearby the onoff pin, and at points where 5v or even 12v may hit Teensy pins (via flux leftovers) that cannot tolerate that? On the LDO, in that particular project i always have a Schottky diode...
  29. S

    Teensy 4.1 doesn't boot with VBAT applied. No v3.3 generated.

    IP66 in the tropics is not keeping the water out. See e.g. https://electronics.stackexchange.com/questions/388866/moisture-trapped-in-ip66-enclosure The issue is that despite of the rubber seals, such boxes breath in and out on a daily basis. During the day in full sunlight the internal...
  30. S

    Teensy 4.1 doesn't boot with VBAT applied. No v3.3 generated.

    I can well imagine that the VictorFS systems operate in environments and climates where water may condense where the on/off pin is exposed. Or where insects can creep into the datalogger units and do a short circuit with their body. If water or beasts or mold forms a << 10k bridge to GND, say to...
  31. S

    Teensy 4.0 sampling rate 1MHz ?

    See this example: https://forum.pjrc.com/index.php?threads/t4-adc-real-time-timer-triggered-with-dma-using-adc_etc.76129/
  32. S

    Ever had a week where nothing works? Mine has to do with the ADC MCP3564 chip

    On why T4 SPI may not work as intended with the MCP3564: with the default Teensy SPI library implementation, in this SPI MODE, the MOSI level for the first bit is either 1 or 0, depending on what the the last bit in the last byte of a previous SPI transaction was. This behavior is specific to...
  33. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Here's another example for Serial (LPUART), 1 wire, DMA receive and transmit, background data buffers exchanging. Uses just 1 signaling wire in between two Teensy4's. So GND and this one LPUART TX pin is all that's needed. Can use either Serial1, Serial2, Serial5 or Serial7. Packet size set as...
  34. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    The slave likely gets 'out of sync' easily now because the SPI CS input gets more or less ignored. The code I shared just does 27 bytes for a transaction, but it no longer looks at CS rising edge. If the SPI clock fails to make it occasionally or if it gets you false double edges dur to ringing...
  35. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Yes, but there are a few catches. Code that I had working for T4 master and T4 slave attached. (working as long as GND interconnect is short enough) Other issues were in the way you let the master immediately trigger a next transaction. With less than a microsecond in between CS going high and...
  36. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Only a true decent ground plane, or a very short GND wire in between the two Teensies makes it work reliably here on my bench. Very short means < 5 cm. Without that, I get spikes on the SPI CS line. Where that line hits the slave SPI CS input pin. Spikes that are the worst when SCK and MOSI...
  37. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    I managed to reproduce. Sometimes. There's something unexpected happening. It works only if I put just a bit of capacitive or resistive load on the SPI CS pin on the slave T4... What I think is happening is that due to poor ground plane practices, there's crosstalk from SCK onto the CS line...
  38. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Can you share a photo that shows what pins are the 4 SPI wires plus ground wire? This just to reassure master T4 MOSI and MISO link to slave “MISO“ and “MOSI”? Asking again, because you may have wired master SPI pins to exactly the same pins on the slave. And then it will not work because you...
  39. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Rezo, you now have a payload of 512 bytes. Your application i think needs 27 byte payloads? So why not leave Nbytes at 27? I’ve not had opportunity today to replicate your dual Teensy4.x setup and test. Can you share a photo that shows what pins are the 4 SPI wires plus ground wire? This just to...
  40. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Is the tx buffer 512 bytes long? Share the sketch and i’ll have a look.
  41. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Rezo, I see you've changed the buffer size to 27. It was 512 in the example. I think it must be a power of 2, and likely it must be 512 (2^9) for the T4_DMA_SPI_SLAVE class to work as intended. This is due to the way the DMA works, with auto incrementing address pointers and masking the last N...
  42. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    I'm not quite sure that your above code is non-blocking. Looks like it waits with de-asserting SPI /CS pin until all 27 bytes have been read and written. So during that time, other code will not run? The idea behind the DMA SPI example that I shared is that such blocking does not happen. The...
  43. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    But what will trigger the SPI transaction in the master? A timer?
  44. S

    T4, SPI, DMA multiple transactions, MISO and MOSI are tristate and one pin

    Probably yes. Is your Teensy the SPI the master or the slave? For both i did a DMA based code examples. This thread is about the master i think. Is the 27 bytes payload to be transferred as first 27 bytes out and then 27 bytes in, or in and out at the same time, byte by byte? Both would be...
  45. S

    Long contiguous SPI transfers (T4x)

    The ADC produces 18 bit signed numbers. You will use 32 bit signed integers. When right shifting uint32 using >>14 the sign bit no longer will be sign bit. Use >>>14 instead.
  46. S

    Minimal example of DMA-driven SPI with CS toggle every 8/16/32 bits?

    Attached an example on how it can be done. In this example I was using several ST MEMS sensors, a Microchip RTC, and a MAQ473 sensor. Some using SPI1, some SPI0 (aka SPI) and some use SPI2. What you need from this zip is the T4_DMA_SPI*.* files as the library for using any of the three SPI...
  47. S

    SPI Slave for T4, DMA SPI Slave

    Maybe you could try to fake a CS signal, for example with a one-shot 1 ms timer, triggered by an edge on your SPI CLK signal? I think all it needs is a CS rising edge as the indication that whatever happened before the rising edge is now a finished transaction. In other words, with CS low, it...
  48. S

    SPI Slave for T4, DMA SPI Slave

    Not really. Without CS pin, there is no way to detect the start and end of a N byte transaction. So then we cannot really tell what N is. You could try manually pulsing what is the CS pin on the Teensy side, and then look at what it displays. If the traffic is sporadic then you might be able to...
  49. S

    Multi-channel Fast Analogue Capture and Stream

    Sketch attached lets you synchronously sample at 12 bits resolution 4 channels with 500 kHz. Using Teensy4.x A0, A1, A2, A3 analog inputs. Channels A2 and A3 are sampled at the same time just a fraction of a microsecond or so later than A0 and A1 were sampled at the same time. This is with a...
  50. S

    T4 ADC real-time, timer triggered, with DMA, using ADC_ETC

    Managed to get a more decent analog channels sampler working for Teensy4. It allows continuous streaming, dual channel synchronous sampling, at rates up to 1 Ms/s, 12 bits, into buffers as big as what fits in DMAMEM. Either 1, 2, 4 or 8 analog input channels, sampled at max rates of 1 Ms/s, 1...
Back
Top