Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contents of the buffer #19

Open
1250364116 opened this issue Sep 8, 2024 · 3 comments
Open

contents of the buffer #19

1250364116 opened this issue Sep 8, 2024 · 3 comments

Comments

@1250364116
Copy link

hello. As I see, the pio0 for each 32-bit sampled data fills the buffer by two values: the size of the sampled data and the sampled 32-bit data itself. then you add the end time of sampling that data as the third element. thus for each 32 data sampling, the buffer is filled by 3 elements in a row. but sometimes pio0 pushes out another element as a fourth value which is 0xFFFFFFFF.
so, what is this value and what does it mean? is it a flag for the end of the frame?

@ataradov
Copy link
Owner

ataradov commented Sep 8, 2024

The size of the data from the PIO is indicated as 0xffffffff-actual size (it counts down from 0xffffffff) and the data is limited to 31 bits. So, highest bit can be used to distinguish size (end of packet) from the data bits.

The only time PIO0 can push 0xffffffff is when the actual size is 0, and that only happens in the case of a line reset (D+=low, D-=low), which appears as a valid start of packet marker, but then does not have synchronization field.

But 0xffffffff is never pushed as an additional data, it is always pushed as a length part.

@1250364116
Copy link
Author

1250364116 commented Sep 8, 2024 via email

@ataradov
Copy link
Owner

ataradov commented Sep 8, 2024

Correct. You get data + size from the PIO itself and the time is added in the loop after the last element is read from the PIO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants