Yes, we wanted external reference capability. If you don't need that, there is also the MCP4822, quite similar 2 x 12-bit DAC with internal-only 2.048 VDC reference.
It feels like something related to what you're doing in your ISRs, but that's just a guess. You don't need to disable interrupts when reading/writing EEPROM, so as a quick test, you could try commenting out those lines...
It's really not possible to help without seeing a complete program, so please try to reduce what you're doing to a small, working program that shows the issue. With that said, does "Int" stand for interrupt in these...
Starting from your code, I made a short working program that reads your 20 x 2-byte locations, increments and writes them back. This test works for me, with the data shown below. Note that it also works fine if I...
Seems like this is SPI slave mode. Teensy's standard SPI library does not support slave mode, but if you look at the SPI page of the PJRC site, you'll see links to libraries for SPI slave mode, several of them by user...
I gather you mean more than two, so if it needs to be simultaneous, then I think it would have to be serial. SPI is a possibility, but there are only 2 hardware SPI.
According to the PJRC site:
Serial has the...
I think it's because your code is not changing the setting of the original instance. It's trying to create a new instance on the same pin, and the error is telling you the pin is already in use. Try using the setPWM...
Wow, this is very nice. There have been some threads regarding generation of center-aligned and complementary PWM, but nothing like this. Did you create this from scratch?
The pins you have highlighted are I2C, SPI, Analog Input, and Digital I/O. You can likely use T4.0, which has all of those, and is quite a bit smaller than T4.1. I'm guessing Teensy++2.0 is 5V, whereas T4.x is 3.3V, so...
If it works up to 128ksps, it seems more likely that the buffer is overflowing than the buffer logic for some reason fails at that value. Can you make the buffer larger? Does CircularBuffer::write return an error if the...
Have you looked at the github repository below? It does 2D/3D/4D and uses double-precision floating point. I found this by googling "Open Simplex Noise C++"
https://github.com/deerel/OpenSimplexNoise
The previous post was for T4.1. Here is the same data, with the same card, for T3.5
FILE_SIZE_MB = 10
bufsize in bytes, speeds in KB/s, max/min/avg in usec
buf_size write max min avg read max ...
I can't build your program, but if you just want to know whether you can have PWM on both pins at the same time, try running this program. If you get PWM on both pins, then you can start debugging your program.
...
I don't see anything obviously wrong in the code, but we're only looking at a snippet. We can't see the definition of Val, or how you configured PWM resolution and frequency, or whether you might have used pinMode() or...
Yes, I just posted to that thread again with more info. I'm really only learning about SD now, so if I'm wrong about this, I hope others will jump in with more definitive answers. The comments in SdFat TeensySdioLogger...
Here's what I got by changing bench.ino to loop through various buffer sizes. The results vary from run to run, so think of this as 20-21 MB/s write, all the way down to 8-byte writes, and 22-23 MB/s read, declining...
Before QSPI stood for Quad SPI, it stood for Queued SPI. Most SPI, LPSPI in T4.1 has 16-element command/data queues you can set up, then start, poll for "done" (or get an interrupt), extract the data, restart, etc. You...
Both bench.ino and TeensySdioLogger.ino do preAllocate(). SdFat has evolved/improved a great deal, so learned wisdom from a few years ago may need an update. Bill is up to 2.2.1 now, with more big changes/improvements...
SdFat's file.write(), for both Fat and ExFat files, always writes 512 bytes at a time, so it makes sense that buffer size doesn't matter much in bench.ino. Smaller buffer sizes are almost as fast, so I think SdFat is...
That makes sense. If you know your disk is formatted, then everything has been erased, and there is no reason or benefit to use the "erase" function on a pre-allocated file.
Lately I've been working on a data logging project using the latest SD and Sdfat from TD 1.58b3. In post #4 of this thread, item 3 in the list of best practices is "Pre-erase" the file. Does anyone know what this means?...
I really don't understand the differences between all of the different file types, file systems, cards, cardinfo, etc., but File.flush() eventually calls sync() on one of the underlying SdFat file classes. There are...
I thought I had replied again, but yes, you're right that FFTW is not appropriate. You might look at ArduinoFFT on github. I don't know if it would meet your needs, but at least it would be easy to try.
I haven't used it myself, but I have a feeling those are convenience functions, and if you want, you can build your own "custom" size. There are also many portable FFT libraries out there, such as https://www.fftw.org/
I had never heard that term, so I did some googling. I found some for various processors, and from a few large companies such as Intel, National Instruments, and Dell. I'm pretty sure no such file exists for Teensy, but...
So far I have found it in these board packages on my own computer.
Adafruit SAMD 1.7.10
Arduino SAMD 1.8.13
GrumpyOldPizza STM32L4 0.0.28
Arduino-nRF5
They all seem to do it the same way. Each variant.h file...
That wouldn't solve the problem, because it's the external library that needs the #define. My work-around is to edit the library source, but I'd have to do that each time a library update is released.
Reposing this question. I ran into this same issue with the U8g2 display library. Apparently some Arduino board packages define macro WIRE_INTERFACES_COUNT to specify the number of hardware I2C ports available. U8g2...
Starting from the program we did the last time, I changed just the value written to the MUX register from 0x08 (AIN0-AINCOM) to 0x01 (AIN0-AIN1), no other changes, and I get good results. I am using my function...
Wow, they've been doing a lot of releases then. Just to be clear, if you want to try the 1.12 version, you don't have to build the libraries because @mjs513 included the binaries in his github repo. I haven't tried it,...
"sum" is a double, so I'm just guessing that you might not be using correct specifier in your print statement. Could you please try the program below, first with pin 0 jumpered to pin 22, and then with your signal, and...
Just looking at arm_math.h in cores\Teensy4, it looks like the length of the FFT is settable in a field of a struct that is a parameter to the functions. The field fftLen is type uint16_t, so perhaps you can do 32K but...
Agree. Have you looked at the signal with a scope? If you modify your setup() function to include writeAnalog(0,128) as shown below, and jumper pin 0 to pin 22, you can see whether you get good count and frequency with...
You need to look at that signal. Or if you can’t, modify the code to see more detail. When count and freq are close, it means you have relatively equal pulse widths. When freq is very low, it means sum is large. Add sum...
You can get a better sense of what's getting through to the processor if you do the frequency averaging at a regular interval, such as 1-Hz. When speed is relatively constant, you should see a consistent number of...
Okay, going back to your problem, you were speculating that the buffer was using an address used by AsyncWebServer, but if the buffer is in FLASH, that can't be. Since you are already using a buffer in FLASH, keep it...
If you search the forum for "simulink", you will find quite a few threads, and at least one person who is using it, but with their own modified version of Teensy core, so it may not be "easy". See the posts by forum...
You didn't say, but I'm guessing you must be buffering the new firmware in RAM. Check the size of your firmware. If it is smaller than the size of the RAM buffer, then you could try making the RAM buffer smaller. If the...
Thank you for posting your program, yes, it would be good to have examples for all of the possibilities. So far we have USB serial, UART, SD, and Ethernet. Still to go are I2C and SPI, but I think those are not as...
The program below produces a simulated quadrature encoder output on pins 2/3 and uses the QuadEncoder library to count on pins 0/1. This works at frequencies up to 18.75 MHz (150 MHz / 8), which produces 75 million...
Well, I still have the ADS1256 from the last time you were asking questions, so when I have a chance, I will try it, but it won't be today. My advice is provide a constant voltage to AIN1 on the ADS for your testing. It...
The program below produces center-aligned PWM on pins 2 and 3 of T4.x. These are channels A and B of FlexPWM4 sub-module 2. The duty cycle on A (pin 2) is set to 25% and B (pin 3) is set to 2x (50%), as shown in the...
Your change to MUX_REG_VALUE looks correct. Can you explain the change you made to READ_ADC()? I don't understand the added line
float vd = v - (VREF/2.0);
Maybe I don't understand what you will connect to...
It's certainly possible to read the ADC at 30 or 60 kHz. The timing should be very good if you have a high-priority timer interrupt and start the conversion in the ISR. The ADC library will let you set 12-bit...
Have you checked the I2C addresses of all devices to make sure you don't have a conflict? Since the GPS works by itself, structure your code so that you can add in sensors one at a time and see when it breaks.
I think PODF(2) works very well, and SPI clock >= 1 MHz is what virtually everyone wants. I'm not sure whether the OP had a specific reason to want 100 kHz, or was more of an accidental discovery that it can't be set...
Good to know Kurt. Perhaps both PODF and the other divisor could be set to get as close as possible to requested speed. Or is that to much to do in each beginTransaction()?
For T4.x, the clock source for LPSPI is 240 MHz, and it's not the system clock, so that's why it doesn't change when you reduce the system clock rate. The max divisor is 257, so that's where the minimum SCLK of a bit...
There has been some discussion lately of how high the SPI clock can go. I'm not sure how low it can go. Can you provide a working sketch to show the issue?
I'm using Logic Pro 8 and getting the correct results with my sketch.
EDIT: I'm getting the correct result with your sketch, too. Sampling igital signal at 500 Msps, trigger on rising edge.
If you are connecting Teensy pin 13 (SCLK) and/or Teensy pin 11 (MOSI) to the MCP, that will not work. Those signals must go directly from the Teensy to the AD9833(s). Only the chip select pins can go through the MCP,...
Here is a simpler program that produces 200 Hz signal with 10 us high time.
#include <Arduino.h>
const uint8_t _pin_out_ = 2;
uint32_t period = 5000 * (F_CPU / 1000000); // 5000 us
uint32_t hi_time = 10 *...
The MCP23x17 are digital I/O expanders. You can use them to provide the chip select (FSYNC?) signal to each AD9833, but you cannot use them to multiplex the SPI clock and data signals. That's okay, though, because you...
Do you mean you want to use MCP23017 to provide the chip select to multiple AD9833? I haven't looked at the MD_AD9833 library, but since that works, I assume you copied the working SPI configuration and code from there?...
Hi Ash. If you take a look at the simple sketch I posted, the DFT can decompose the load-cell signals into components that are multiples of the rotational frequency (speed). For example, if you are running at 600 rpm,...
Here is a test sketch showing the use of SDFT (sliding discrete fourier transform). It generates a simulated signal composed of harmonics 0-4, each with a different magnitude and phase, executes SDFT to decompose the...
Really amazing work. I'll read up on EMD.
EDIT: I'm no expert in DSP, but have you looked into the discrete fourier transform? There's an implementation called SDFT (sliding DFT), that I think would be quite good for...
I don't understand your question, and I'm not sure what your function M32x16 is supposed to do, but it doesn't look right. Can you please ask your question again and provide more detail, and please show a complete test...
Yes, that's the reason. I tried the timer definition below, and it worked. However, the OP should be aware that print/println are no re-entrant, so it's not OK to call Serial.print/println from a task and also from an...
Oh, I didn't notice that link from the OP. Well, I think the answer is no, there is no "built-in support" for this function. Looks like an interesting one.
Teensy 3.x and 4.x both have various timer peripherals that can count edges or measure time between edges. I'm not sure what you mean by "three phase encoder". Do you mean 3 signal outputs. Are they A/B (quadrature) and...
Do you mean the problem of copying data from a large buffer to a smaller one? You had the basic idea, but you had some mistakes in your logic. I suggest you make more use of print() and println() for debugging, because...
Try adding these two lines after you compute the lengths of the buffers. With this information, can you see what's wrong?
Serial.println( SYSEX_PRESET_LENGTH );
Serial.println( MIDI_BUFFER_LENGTH );