About 6 months ago I invested in an entry-level M1 Mac Mini (8GB RAM 256GB SSD). Overall, I'm very pleased with the system. With the latest version of Teensyduino/Arduino, I am able to compile...
Type: Posts; User: mborgerson
About 6 months ago I invested in an entry-level M1 Mac Mini (8GB RAM 256GB SSD). Overall, I'm very pleased with the system. With the latest version of Teensyduino/Arduino, I am able to compile...
The OP posted a lot of code that has nothing to do with sampling and buffering the data from the ADC. It doesn't provide us with the algorithm for the median filters or tell us anything about the...
You could use the two DAC outputs of the T3.6 to generate a sine wave with controllable frequency and amplitude in the range from 0.1 to 50Hz. You would have to convert the DAC output to a...
I spent a couple of months last fall working with a FLIR camera interfaced to a T4.1. I learned a lot about using the CMOS Sensor Interface (CSI) and the Pixel Processing Pipeline (PXP). At about...
It also bothers me that the ADS1256 data sheet says that the maximum sample rate is 30KHz. Running any ADC right at the limits on the data sheet bothers me. Do You really need a 24-bit ADC for...
I believe there's a minor problem in the first line of the setup function:
pinMode(analogReadPin, INPUT);
If you're expecting good results with analog inputs, you should set up the pin with:...
Some miscellaneous thoughts:
1. It seems that running MTP as a thread or pseudo-thread, might solve a lot of the issues with the host PC timing out. The pseudo-thread could have the MTP Loop...
I can verify that Teensyduino and Arduino install properly on an M1 Mac mini running Monterey (MacOS 12.2.1). I did run into a few 'interesting' issues when getting my setup tuned to my...
One issue I've noted with Teensy SD Cards having lots of files that the MTP index is constructed as a file on the SD card in my older MTP code. That is probably a lot slower than building the index...
I solved the problem of forcing the PC to notice changes in the MTP disk by using usb_init() to stop and restart the USB link. This has the disadvantage of breaking the USB Serial comms link, which...
I've just installed Teensyduino 1.56 (and Arduino 1.8.19) on a newly-purchased M1 Mac Mini. I would like to try out some of my programs that use MTP. I've been using a version of MTP that I...
A few notes:
1. in Setup you have:
pinMode(A0, INPUT_DISABLE);
adc->adc0->setAveraging(1 ); // set number of averages
...
If you'll post your code, I'll look it over. I haven't run the original code in a year or more, so I can't really tell you much without looking at your code.
Another approach that I've used in the past is to add a short-term backup capability to allow ample time to stop logging and close your files. I used a 5V supercapacitor of 0.47F which kept the...
I've been working on CSI camera input and PXP color space conversions recently. I have to use EXTMEM frame buffers for VGA frames due to their size (614400 bytes) so I am concerned about cache...
In imxrt.h we have:
#define PXP_PS_CTRL_WB_SWAP ((uint32_t)(1<<5))
This agrees with the rev. 2 reference manual page 1939 which shows the WB_SWAP in PXP_PS_CTRL as bit 5.
...
While the suggested state machine will work, it could get awkward for longer keys. A simpler approach is to check the input against the key string one character at a time as in the following demo...
I'm working on a camera application where I use an ILI9341 display as a viewfinder. That part is working well and I can update the viewfinder at 15FPS completely in the background.
That part...
I did manage to get VGA-resolution BMP images sending to the PC. The transitions look OK, but the frame rate is noticeably slower. This is due to the 4 times larger number of pixels. The .bmp...
Your timing code will probably return 0 for all values in vImag;
You could try something like this:
void adc0_isr() {
uint16_t adc_val;
// call readSingle() to clear the interrupt.
I ran my histogram analyzer that does 1,000,000 samples at 50uSec intervals for two cases: The first collects the ADC values for histogram analysis without SD card writes, the second collects the...
If you simply called my GetADC function without change and captured the time before and after the call, the interval is going to be higher by 101 milliseconds due to the delay() calls in the...
With the OP's specification of 50uSec sampling, I think there is a low probability that the SysTick interrupt will affect the ADC timing. Both the ADC timer and the Systick timer are generated from...
Here is a simple demo program to collect 16384 samples using the ADC timer.
// Sample program to Collect ADC data with ADC timer
// Using the ADC timer to collect minimizes sampling jitter
//...
I've got lots of example code that might be applicable, but your question is a bit too vague. To pull out the right example I need to know:
1. Which Teensy are you using?
2. How many samples...
Another possibility is to use the ADC library and the hardware ADC timer. It is also more complex in that you have to know how to set up and use an interrupt to collect the data-- but it gets you...
Perhaps the lower input voltage results in a slower V_3.3 rise time and the 1.5K pull-up resistor used to pull up the USB DP signal isn't pulling up quickly enough and the PC is lacking the signal...
As noted, 100K is too large for the divider resistors. I don't know if it's true for the T3.2, but on the T4.X
I always add
pinMode(inPin, INPUT_DISABLE);
to make sure only the...
I ran a test of the following collection loop with an input signal of about 2.36MHz:
// Collect time stamps for rising edges
void CollectSample(uint32_t numsamples) {
uint16_t scount = 0;
...
Access time to the registers is slower than normal DTCM memory access because the peripheral bus runs at only 150MHz, whereas the internal bus to DTCM memory runs at the 600MHz CPU clock rate.
I...
I wrote a test program to use the input capture capability on GPT2 and to save the data to SD. The program saves separate files for channels 1 and 2. It seems to work well with one channel at...
Your code with multiple "port.print(...)" statement is very inefficient for the serial port. Each call will probably wait until it is finished to start the next statement. It should be much more...
Here is a sample sketch showing intermittent capture of input pulse timing.
// Fast_Stamp_4
// Sketch to test fast intermittent time-stamp collection
// M. Borgerson May 25, 2010
...
Do you need continuous sampling? If not, could you use an intermittent sampling scheme where you collect data for 10 milliseconds, stop and write to SD card, collect another 10milliseconds, stop...
I would make sure that you use Serial1 and Serial2 as they have the 8-byte transmit and receive FIFOs and that will reduce the receive interrupt overhead.
There's no real need to go through the...
I'll need to see the code to give you any kind of definitive answer to that. My first GUESS is that doubling or tripling the sample rate caused some buffer overflows and you may need larger...
The most straightforward way to do this is:
uint32_t totalSamples = secondsToSample * SAMPLERATE; // pre-calculate number of samples needed based on duration of sampling
volatile void...
It should be straightforward to log for a fixed amount of time by using an elapsedMillis timer which is reset when starting logging. In the loop you would add code to check the elapsedMillis timer...
After working for a while with downconverting 40KHz ultrasonic signals and thinking about the timing of conversions for Pk-Pk voltage measurement, I decided that I needed a T4 frequency counter that...
A few experiments might prove interesting-----if somewhat costly in Teensies and time:
1. Does the timing of the damage change if you change the sampling speed and conversion speed?
2. Does the...
The voltage source was a signal generator with a 50-ohm output impedance.
I think we need to make sure we are thinking of the same things. An accuracy of 0.01V means that the measured voltage is...
If the EEClick can output a signal of up to 5V, then your combination of 10-Ohm and 10KOhm resistors won't protect the Teensy. It only reduces the input voltage by one part in one thousand.
To...
On the basis that 100 lines of code is often worth a thousand lines of discussion, I put together a simple program to test over and under-sampling an ~300KHz sine wave and calculating the...
The ADC on the T4.0 can be set up with an aperture time of 100nSec or less. @Samsurp specified an accuracy of 0.01Volts in a 4.5 Volt signal, so a 10-bit resolution should be sufficient. I think...
Unless you subsample at a frequency that is an exact sub multiple of the input sine wave, you will eventually take a sample at a maximum and minimum point. The key to getting this to work is to know...
The nice thing about designing systems with a few really expensive sensors is that the funding agencies don't quibble about the cost of upgrading to an MPU with more memory or better peripheral...
The one used on the oceanographic sensors was the FP07DA103N when I last worked there in 2018. That is a 10K Ohm at 20 deg C unit. It's not in stock at DigiKey, but the 8K Ohm version is...
Let's look at the energy balance. Assume you want 8 gallons of water at 160F. Your cold water tap yields water at 60F. Boiling water is 212F.
The boiling water is 52 degrees away from the...
It just occurred to me that this down-conversion scheme might be a nice way to put together an ultrasonic doppler velocity sensor. I've got a handful of 40KHz ultrasonic sensors in the toolbox and...
I played around with LTSpice a bit this morning and designed a 4-pole Butterworth bandpass filter with about 6dB gain from 38 to 42KHz and -40dB rejection at 19KHz and LOTS more at 60Hz. It takes a...