Search results

  1. 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)...
  2. 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.
  3. 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/
  4. 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
  5. 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.
  6. 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...
  7. 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
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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/
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. 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.
  24. 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...
  25. 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...
  26. 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?
  27. 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...
  28. 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.
  29. 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...
  30. 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...
  31. 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...
  32. 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...
  33. 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...
  34. S

    T4 DMAChannel.h - transferring 16 bytes

    I'm stumbling over what I think is a bug in Teesny4 DMAChannel.h. When attempting to do 16 bytes, then this code (from 1.59.0 core) puts value 4 (0100b) into SSIZE and DSIZE fields. But those are "Reserved" and "Using a reserved value causes a configuration error.". Should it not be a case for...
  35. S

    Teensy 4.0 : Strange issue when connecting multiple slaves on the secondary SPI bus

    Connecting the ST MEMS chips to Teensy4 over SPI comes with all sorts of pitfalls. These were my stumbling blocks: * The ST MEMS can do both I2C and SPI. It is quite easy to end up with I2C activated by accident. Then you're lost because once in I2C mode, it may pull down the data line...
  36. S

    Filter acceleration signal

    Maybe start with printing raw_data and velocity_data samples, that gets you 32768 lines with floating points. As in: for (uint32_t i = 0; i < numSamples; i++) { Serial.printf (“%d %1.6f\n”, i, raw_data); } Do that immediately after reading all ADC samples. And after each filtering step...
  37. S

    Filter acceleration signal

    First, on the hardware: So what's the circuit diagram in between the ADXL1005 and the ads1256, and the Teensy? Did you consider the analog filters R1 C1 R2 C2 as in this from the MEMS datasheet? What are the values that you use? Does your ads1256 use the same reference voltage (=VDD from the...
  38. S

    Reading SPI data very fast slows down Serial2 communication

    I think the default SPI T4 libraries are blocking. What that means is that there's stuff in there that says things such as "while (SPI_STATUS_REGISTER_TX_DONE_BIT != 1) {}; " the CPU will patiently repeat the check - and refuse to spend time on any other useful tasks. the lower the SPI...
  39. S

    Thoughts about extremely low overhead and low bitrate communications on Teensy 4.1

    Or use SPI DMA master or SPI DMA slave - did share that some months ago..
  40. S

    Thoughts about extremely low overhead and low bitrate communications on Teensy 4.1

    Another option: DMA_UART. See https://forum.pjrc.com/index.php?threads/using-dma-to-store-uart-byte-directly-in-teensy-3-5.71466/#post-315706 In your 250 ns you’ll have enough time to fill the DMA Tx buffer with up to, say, 64 bytes, and then you’ll still have enough time left to trigger the...
  41. S

    Another Burned out Teensy Thread......

    Those 3k3/1k8 do not lower the 5V voltage if you wire them as in the schematic…
  42. S

    Another Burned out Teensy Thread......

    Many Teensy’s and they all share their 3V3 pins? That’s asking for trouble. Especially when there’s also a 3V battery on VBAT. The 5 to 3V3 LDO’s have a MOSFET at their output that shorts to GND when LDO is receiving ‘OFF’ input. They have this FET to discharge any caps on the 3V3 rail, so that...
  43. S

    SD card and max write current - when is it safe to say that it will not bite?

    What I found so far is that in SdCardInfo.h there's the CSD specification. If you have a 'v1' CSD card then there are various 3 bit values that indicate max current. The actual limits in mA is via a lookup table that is not in SdCardInfo.h, but can be found in the SD card spec as below. Note min...
  44. S

    SD card and max write current - when is it safe to say that it will not bite?

    Thanks for this. But is any of that low level card diagnostics info accessible through the SD card drivers / libraries that we use in T4 by default? SDFat etc. What i would like to build in my application is something that checks the max current before any attempt to write to the card. Just so...
  45. S

    SD card and max write current - when is it safe to say that it will not bite?

    For a project I started to use SanDisk Ultra 512GB cards. My T41 power supply, 5V, comes from initially a 10..36V DC-DC converter, then an isolated DC-DC converter, NTE0506MC that gets me 6VDC, then a LDL1117S50R low dropout to make 5V that cannot exceed 5.5V ever, and then wired OR with diode...
  46. S

    151.2 MHz when selecting 150 MHz CPU clock?

    OK. So the drop down list in the IDE should not say 150 but 151 as one of the many CPU Speed options. I had expected 600/4=150, but that’s just a wrong assumption.
  47. S

    151.2 MHz when selecting 150 MHz CPU clock?

    For a project I prefer lowering the CPU clock so that my Teensy4.1 runs cooler, and may live a longer life. So in IDE I went Tools, CPU Speed, and picked 150 from the drop down list of options. When I check what my CPU clock then is with a Serial.printf ("F_CPU_ACTUAL is %ld Hz or...
  48. S

    U2 and D4 hot, 3.3v shorted to GND

    Hey Unhappyman, are you still unhappyWithoutU4? That U4 would be the first one I would unsolder to see if the 3v3 short disappears.
  49. S

    Issue with 16-bit ADC (ADS8354) communication with Teensy 4.1

    In the TI datasheet, the term SPI is carefully avoided... Not immediately clear what SPI mode is to be used. Sampling SDI on the falling edge, and clocking out SDO on the same falling edge. Then it's key you make sure that on the Teensy side the output pin for SCLK was already output, or at...
  50. S

    Multiple SPI at the same time

    Here's an example on how to do SPI masters on T4 with DMA. In a non blocking way. I also did a SPI DMA Slave library, but it looks like it's the master that you want here, and then three times in parallel, so SPI0, SPI1 and SPI2 hardware that is wired out on the Teensy 4.1. When using the...
Back
Top