I just modified the program to load some values into the buffer, for the write() and then to zero the buffer before the read(). With that I can confirm that as far as read is concerned, the data was nt0 stored or read...
Then, I tried "quickformat". The command list files shows that the file has gone away. Save temp.txt, again creates an empty file.
So, I feel confused. Why is write() not writing anything to the file?
At startup it reports
Space Used = 65536
Filesystem Size = 65536
After writing the file, save temp.txt, the list command produces the following. It shows that the file has been created, but the size is 0...
Command: save temp.txt
Response:
saved to temp.txt 4096 0
The first number is the number of bytes that were supposed to be written. The last number is the size returned by file.size() immediately after...
Following is a complete source code.
The intent is to use LittleFS to save and recall data to and from program memory on a T4.0. The directory listing shows the file is created but that it has zero size.
What I...
@kurtE, I would maintain that the low level should be save/set the number of bits, and transfer, and above that a call that does an 8/16/32/block transfer with all of the dress-up. But then maybe it should be...
Well that's neat, the code. Thank you.
I am very grateful for the help that has been offered, that you know the part and the library so well is a huge help, and I appreciate the reasons for supporting the less...
@joepasquariello Perhaps you are right, I should have stopped at the first line. Let me rephrase.
My sincere feeling is that in an embedded environment, the default API should be close to the hardware and...
The folks at Arduino forum report that command history was added to the serial monitor in version 1.8.10 of the IDE
But, it seems to be missing from my recent install of 1.8.19 with Teensy. Up-arrow in the Serial...
Is there anything wrong with supporting a dedicated or user managed paradigm alongside of the multiple device paradigm?
After all, an MCU on a few centimeters of embedded pcb, is not a desktop. Should so much...
P/S Really, in a dedicated system with one device, even more so that it transfers in blocks, it hardly makes sense to have to save, set, transfer and restore every word.
And for a small MCU system like the...
@joepasquariello Fantastic!!! Thank you so much. So then the hypothesis was right, the setup for 16 bits takes a big part of the 150 nsecs.
BTW those times are from the call to the start of the transfer, yes? ...
@joepasquariello So.... my shower thought this morning.... three new calls for the API, set16bit(), specialtransfer() and restore(). What do you think?
The other thought is that what I should do first is time...
@WMXYZ That is interesting.
One issue is the 710-750nsecs for conversion. readout commences on the first clock after the convert pin is low.
So maybe that is enough. Sync with the clock in code, clear convert...
@joepasquariello Yes, I want to run it as fast as possible.
Re the chip, that is close. The conversion indeed starts on the rising edge. But it takes about 700 nsecs to complete, and then it is available on...
@joepasquariello Thank you, that's a huge time saver.
For a dedicated embedded system, I usually prefer to understand the part and have at its registers. But that does look a time sink in this instance...
Hi,
The following is to ask about a speed up for looping over transfer16() with some other operations in between calls to transfer16(). The essential is that there seems to be about 150 nsec between calling...
@defragster Thank you very much, and also @KurtE and @PaulStoffregen I do very much appreciate the help, and you have all been fantastic.
I called beginTransaction() to set the speed. Is there another way that...
@defragster And if nothing else is using the bus? Actually, this is in preparation for some code that reads frames from a linear CCD, some 2K words per shutter and shutters can run on a clock or triggered from a...
@kd5rxt-mark Its just a test program. I wait to initialize the spi until I am actually testing the spi. That is one of the way you check things, your turn them on one at a time. It ranks right up there next to...
@defragster, yes of course, that is what the logical test does. in this test program, it is called the first time that command is recognized and then not afterwards.
I think that description is consistent with...
So, as it turns out, everything is working great and as spec'd.
Here is the code that I wound up with, for the 16bit transfers from the ADC with the convert pin asserted for 700nsec between transfer. The time from...
@defragster
It has SPI.beginTransaction(settings). Does it need SPI.begin() also? And I guess that means it needs SPI.end() after SPI.endTransaction()? It didnt seem so in the source code.
@defragster Any speed that I set in the SPI above 4MHz locks it up. You can try it with the sketch that I listed. I hope and pray that the SPI gets fixed, getting to the full max speed is super important.
...
Okay, here is a complete sketch.
There are several problems.
1) The datasheet says the max speed is 30MHz, But the fastest the SPI library is only 4 MHz. How do we get the faster speed?
2) Any use of the...
Here are two code snippets, they run from loop. Again, this is a contrived example do demonstration what seems like a bug.
The first works perfectly okay. The second hangs at SPI.transfer16. What I am doing...
Hi
The ADC device, MCP33131D-10 requires SDI be held high during the complete cycle. Below is a screen capture from the datasheet. See Note 1.
How do I do that?
Thank you
@PaulStoffregen Hi Paul, thank you. I think I have go this part under control for the time being. I am about to post another more serious question on another thread/
@defragster Great. So here is what works so far, and what I am thinking to do.
The code snipped below, works. So, the idea is modify the above script to add the following to define the serial number string for...
So, turning on verbose, I managed to capture the following from the IDE. It seems informative, although there are more than a few mysteries, for example why it repeats the compilation three times each time adding one...
Hi,
Is there a production compatible way to set serial numbers for the Teensy 4?
I think the most convenient solution would be if we could write over the serial number in the image flashed to the board.
...
Doctorate in Chemistry and Physics, former faculty in Materials Science at a big ten school, scientist in x-ray diffraction, spectroscopy and instrumentation at a National Lab. Currently working on lasing, lighting and quantum information applications in organic semiconductors.