I ran the test 7 times and saw quite a variation in max busy:
rbMaxUsed
1280
12032
1280
768
6656
768
min write us
4.68
4.68
4.68
4.68
4.68
4.68
max write us
5.54
5.53
5.54
5.54
5.54
5.69
min busy us
18
17
18
18
18
18
max busy us
1390...
slash2
with your test and
Type is exFAT
Card size: 63.86 GB (GB = 1E9 bytes)
Manufacturer ID: 0X3
OEM ID: SD
Product: SP64G
Version: 8.0
Serial number: 0X28D120F8
Manufacturing date: 1/2012
I get about 2x your max busy us :
If you have time, I wonder if you would mind running the program below and sharing your results? What it does is log for 20 seconds at 5 MB/s, with each write being 512 bytes, and keeps track of buffer usage, time to return from SdFat write()...
Yes, I was seeing similar numbers on my cards- even Class I. The problem is that it’s an average. The card datasheets don’t tell you the maximum latency. That is they may plow along at 25mb/s but then do housekeeping for 50msec. That means you...
My own bench.ino tests with Sandisk XC is ~23MB/sec over SDIO, 2x faster than HC:
FreeStack: 449400
Type is exFAT
Card size: 63.86 GB (GB = 1E9 bytes)
Manufacturer ID: 0X3
OEM ID: SD
Product: SP64G
Version: 8.0
Serial number: 0X28D120F8...
That's good. Your total buffer is 945,152 bytes, so when you say max buffer usage was 132,227, does that mean you don't need both buffers after all?
Not a short-term fix, but if you want to get the RAM limit out of the way entirely, see the link...
RAM1 is "TCM" (tightly coupled memory) and is faster than RAM2. In my applications, having the buffer in RAM2 made no noticeable difference. I'm sure you could split your buffer across RAM1 and RAM2. I always use RingBuf from SdFat, which I like...
Yes of course and that makes directly connecting the tcd1304 a much worse proposition.
You get maybe 7-8 useful bits and then there is the non-linearity.
The other scheme that runs a close second is the emitter follower with the single stage...
I was being approximate
10.7 ENOB is from https://www.pjrc.com/teensy/IMXRT1060CEC_rev4.pdf
OS typically adds 0.5 bits of resolution for every doubling of the sampling rate, I usually rely on oversampling and exponential averaging / filter - I'm...
Are you still using analogRead()? You should really consider the DMA ADC examples in the Teensy set.
Mine attached does 1.17Mhz (one channel) with no averaging so ~10 real bits and with 8x averaging you should get almost 12 real bits and still...
In preface, using the TCD1304 (or any CCD), and obtaining results that are useable, at least reproducible and proportional to your light input, is not trivial.
Here are some of the issues: (A) light corruption vs "keep clean" and...
As an update, I'm thinking that the behavior is mostly in the controller of the BLDC (can't update first post now).
"specs" say "PWM signal speed regulation around 10-20kHz" but actually runs from hundreds up to 100kHz.
"signal feedback requires...
Interesting. I’ll have to check my 2 and 4 year old schematics to see how I got the FLIR Boson and OV7670 cameras to send images to the T4.1 through the CSI interface ;-)
At this time I just remember that the OV7670 software was difficult due to...
I have a small BLDC motor (5 wire with internal control board) and doing PWM control.
As per the Teensy docs:
Anytime you are doing PWM at high duty cycle it glitches every 4.3-5s, with exactly 500Hz. This is with or without a 4.7k pull-up...
FWIW I have a 4.0 overclocked to 916Mhz with a 1cm^2 heatsink and only see 50C running a modified SD bench.
916 might not be needed, I'll see when I finish ADC processing code.
Because that speed is only achievable in UHS-I mode, which requires external circuitry to switch the SD signal voltage from 3.3V to 1.8V.
Otherwise only high speed mode is supported, which runs at 50MHz - with 4 bits of data per clock that's a...
It's from the SanDisk Extreme range, those have better performance than the Ultra series. You can see it has the "U3" marking printed on it instead of "U1".
I just bought/tested a "new" uSD Sandisk 32GB Ultra UHS-1
to compare with older models.
Using SDIO and inserted in solder-on connector to Teensy 4.0.
In left-right order,
SdFat/bench.ino example results:
Use a freshly formatted SD for best...
Look at the Bill Greiman example TeensyDmaAdcLogger.ino
I also have some test code that writes ADC samples to uSD at 1.1MHz
Using the Teensyduino library with Visual Studio Code does allow the helpful use of GitHub Copilot
If accel is planned, please use ISM330DHCX. I think it has the best specs for small SMD at the moment.
I use it with Pi Zero 2W
Is CSI (Camera Serial Interface) ribbon connector in the realm of possibility?
Ah I think I see
And Bill Greiman did not use file.is_busy() in his example TeensyDmaAdcLogger.ino
if (n >= 512) { // could be if ((n > 512) && !file.isBusy()) {
if (rb.writeOut(512) != 512) {
Serial.println("writeOut() failed")...
With the main.cpp code RMS noise is ~15 counts at 12 bits and no averaging, 1.17Msamp/s.
Here is one second of photodiode data
no data jumps/missing even at high slew rates:
Good non-ISR examples using `writeOut()`, but currently working on the ISR version from RingBuf.h and TeensyDmaAdcLogger.ino
* This ring buffer may be used in ISRs. Use beginISR(), endISR(), write()
* and print() in the ISR and use writeOut() in...
In addendum to another post, here is my modified version of RingBuf ISR example (based on TeensyDmaAdcLogger.ino)
It always does 512 byte writes, but I can't follow in the lib to see if it does:
- always test for SD.is_busy()
- write only if SD...
This uses Bill Greiman's RingBuf.h, and I can't follow it very well, yet, and don't see an *.is_busy().
However VS Code Copilot seems to have found and fixed the main issue "adjusted buffer allocation and pointer math so BUF_BLOCK_SIZE is...
The SD card has an on-board, 1-sector (512 byte) buffer, so writes of more than 512 bytes result in loops of (a) transfer of 512 bytes to SD buffer, and (b) trigger actual SD write. Any of those 1-sector writes to SD can result in the card...
The basic SD write command is for a 512 byte sector. There is also a multi-sector write command. (With an optional command to warn the card how many sectors to expect.)
Best performance comes when using the multi-sector write with RU sized...
I am testing a modified TeensyDmaAdcLogger.ino example (attached) with a ping-pong buffer of 2 by 512
// Preallocate .5GiB file, multiplying 8 by 2^26, resulting in a value of 536,870,912 bytes, or 512 megabytes (MB)
const uint64_t...
In my case, I'm happy to say that switching from the Adafruit SDIO SD board to the soldered-on simple holder on the Teensy 4.0 made all the difference.
In my case, I'm happy to say that switching from the Adafruit SDIO SD board to the soldered-on simple holder on the Teensy 4.0 made all the difference. Same 10 year old Sandisk 16GB HC card, no blips at 256 byte intervals.
Photodiode card on...
Google AI mode just told me this which I'm testing:
To use the ADC library (by Pedvide) with manual DMA control, you utilize the library to configure the ADC hardware while using DMAChannel.h to manually set the TCD registers.
Manual...
pseudo-code still might help others
I am (currently) just writing to uSD at 553ksmp/s, and, also getting the every-512 byte glitch. You can see it is also railing the ADC occasionally:
I also just read that pinMode(<pin>, INPUT_DISABLE); should be added for analog inputs. I have not tested yet, but will.
I am assuming it is the case for ADC0... ?
Also here
I wish they were for sale (?) I would have done that instead.
We have also ground down board edges to create castellations, but if pre-populated we used stripped 30ga as jumpers - Bill was worried about static during grinding:
(That was MSP430...
Not the ideal solution, but in some situations might be enough - made this some time ago and have been using for over a year now.
T40 SDIO << link to github repo
Huh? Feels like we're talking in circles here.
They were talking about the molex connector that you ended up buying. The flex ribbon connector that the pads are actually designed for is this one, which has 1.0mm pitch and is used with the...