Still trying to figure out an automated-process for determining *where* my data is actually being written...
It's an interesting challenge...
It's basically like adding data to a circular-buffer, but not knowing the actual index.
I can load that buffer up with data...
I can start it outputting that data, but there's a delay before it will start outputting the data, repeatedly, from some unknown index.
I need to determine the index-offset from the data-output (and possibly some correlation with time?).
e.g. I load the sequence 1,2,3,4,5,6,7,8, to some random starting-location in an 8-element circular buffer. It, eventually, spits out 3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2...
The above sequence doesn't tell me anything... I have no idea where it started, and it's cycling through every element.
Further, I can't actually *read* every element it spits-out. At-best (and this is highly unlikely) I'll be able to catch every-other element...
But, more-likely, it will be every 4th or 6th or 8th (but always a multiple of 2... also, plausibly shifted by one... e.g. 3rd, 5th, 7th...?))
So, I'm imagining something like a vernier scale...
Instead of telling it to output the *entire* sequence, what if it output an *odd* number of elements...?
e.g. I loaded 1-8, and told it to output the first 7 elements cyclically.
... again, I have no idea *which* elements are the first 7... it could be 1-7, or it could be 8,1,2,3,4,5,6 or any other combination. So, in the latter-case, I might get the stream: 3,4,5,6,8,1,2,3,4,5,6,8...
And, then, with the slow-sampling, only able to catch every-other output, I might get 4,6,1,3,5,8,2,4,6,1,3,5...
(And what if I only catch every 4th or 8th?)
Can I determine the offset from this information...?
Well, in the above case, I never get the value 7....
And I told it to spit-out the first 7 elements (of 8)...
So... I think there's only one case that would allow for this... which is
Written Value (random start-position) : 1 2 3 4 5 6 7 8 Value has been Read: Y Y Y Y Y Y Y Actual Position of unread value: 8 Actual Positions of written values: 2 3 4 5 6 7 1 Write-To-Actual Offset: = 2-1 = +1 (Heh, since when do I do stuff like this NOT zero-based?)YES!
Now... what if I only capture every 4th or 6th element...? Won't it repeat at some point where possibly two values will be missed every time...? I'll have to think about this some more. But, for now... I think I'm on a much more plausible track (and easier to implement) than the last idea...
Another case where writing-it-out has made things a little easier for me to grasp...
My original idea was to load each value with either 1 or 0, in a roughly-50% toggling fashion... But I couldn't quite figure out how to phrase it in words...
Then something about the amount of time *actually* measured high, vs the amount of time *actually* measured low...
(thus vernier-esque)...
Then I tried to come up with an example of a clock that'd been rotated, but it was too complex... (somehow it skips an hour?)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
... or I talked myself into a loop...
I can't tell it to output a certain number of elements repeatedly... I can only tell it, from a written element, to repeat from the first (actual) element... ...and we don't know where that element (the one telling it to repeat from the first) is located.
Are you sure? yes | no