Safe to change fifo buffer size for pulsing stepper?!

Hello,

Im trying to get my steppers working by buffering the data ahead but i want to send 1 byte per microsecond and need to buffer everything. But i saw that the Fifo buffer of the Teensy 3.6 64 bytes is. Is or can it be a problem to set this to atleast 2048 bytes?! Otherwise i get some troubles with the speed to send data to the Teensy.

Or should i just test and check all incomming data, also a good option by the way :slight_smile:

Its about Serial1 (SERIAL1_TX_BUFFER_SIZE)

Thanks,

Nena

To where do you plan to send one byte per microsecond?

If you are thinking of doing that with a serial connection then forget it. It would require a transmission rate of 10 mega baud.

What data do the bytes represent?

…R

Hello Robin,

Well i use two Teensies one for buffering and sending the data en the second one to handle the data. I did a test with sending 1mb of data per second and it took About 280.000 microseconds for reading. So i also have time to buffer all the data what takes About 700.000 microseconds. So 1 million bytes per second should work to read send and handle with two teensies.

The data is for direct portmanipulation.

Nena

But if you buffer 2048 bytes then the output is up to 2048 microseconds behind the input.

Maybe with a bit more work one Teensy can do both tasks?

You can change the Serial buffers. The only way I have found to do it is edit the Teensy Core files that are in (in Windows) Program Files. To edit files there you must start your editor as administrator.

MorganS:
But if you buffer 2048 bytes then the output is up to 2048 microseconds behind the input.

No, the first time i will send 2048 bytes to the buffer and when it reads 512 bytes ill send a command back to the teensy to refill the buffer with 512 bytes, so that the buffer has always atleast 2048 bytes. If it can be set at a larger buffer then i will.

MorganS:
Maybe with a bit more work one Teensy can do both tasks?

I dont think that this can be done. Becourse this way i can pulse at a maximum of 500Khz, the reading of the data en sending it to the other Teensy takes about 98e4 microseconds for 1e6 bytes. So thats 1 second. There is no time to handle the data.

Greetings,

Nena

I still don't understand what you are trying to achieve (maybe my brain is on a go-slow).

What is driving the requirement for 1 byte per microsecond?

For how many seconds must this data rate be maintained? (i.e. how many bytes in total).

Where are all those byte going to come from? Are they being generated in real time or are they coming from a file? If they are coming from a file, what generated the file?

What do the bytes represent?

...R

Hi Robin,

Robin2:
I still don't understand what you are trying to achieve (maybe my brain is on a go-slow).

Already gray hair?! :slight_smile:

Robin2:
What is driving the requirement for 1 byte per microsecond?

Controled Pulse Sequence

Robin2:
For how many seconds must this data rate be maintained? (i.e. how many bytes in total).

A few bytes to several gigs.

Robin2:
Where are all those byte going to come from? Are they being generated in real time or are they coming from a file? If they are coming from a file, what generated the file?

Real time And from file. Generated by my own software (pc)

Robin2:
What do the bytes represent?

Zero's and One's :slight_smile: 0 .. 255 :smiley: 0x00 .. 0xFF Direct Portmanipulation

Greets,

Nena :slight_smile:

This website can help you with your problem: www.xyproblem.info

Sounds like a better encoding is needed, presumably the actual pin changes are much less frequent than 1MHz?

MorganS:
This website can help you with your problem: www.xyproblem.info

Hehehe, there's my awnser! But i already know what to do right now :- ) everything is tested and is working! 1e6 bytes per second! I only need to test the fifo buffer.

MarkT:
Sounds like a better encoding is needed, presumably the actual pin changes are much less frequent than 1MHz?

Nope, can't, all 8 pins have there own timing. Encoding to 2 or 3 bytes for a x times could work only with not so manny difference in the pulse. It will be a problem on pulses from 6uS and the other 7uS.

Nena

Mayby not so bad idear to encode by the way, but then i need to see time as units. So that for example 1.2 microseconds is 1 unit. Sending 2 bytes with pin status and x times. For example:

Byte 1: 0x35
Byte 2: 0xFF

So that 0x35 will be executed for 255 times. But its saver to send single bytes. Or using 1 bit as a control bit for both bytes! Mzzz ill think About it!

Edit:

If i use 7 bits for the count then i still can count to 128 but if i use 6 bits with a extra bit for a followup byte then i have 12 bits or more for the counter.

For example:

Byte 1: b0011 0010 indentfier bit 7 = 0
Byte 2: b1111 1111 counter + folowing byte bit 6
Byte 3: b1011 1111 counter + stop bit bit 6

Bit 7 is the indentifier so that nothing can go wrong. And i still can add a function byte in the sequence like b1000 0000 = folowing function byte! Or to say byte 1 is the function byte. Mmzzz

I think this will solve some time isues!

Thanks MarkT

Nena

NenaGirl:
Zero's and One's :slight_smile:

If you are not going to take the trouble to explain properly then I'm not going to waste time guessing.

...R