I have a peculiar problem with the MCC172 - I'm reading continuously at 1280Hz using a slightly modified version of the continous_scan.c example. I read 128 samples every loop, at 1280Hz I should get a read every 100mS but I'm not, mostly it's around 105mS but occasionally (every 8-9 loops) it will read in 55mS. I don't appear to be losing any samples but the reported timing is off, I'm using the Pi clock_gettime() to record the timestamp every loop, other than this timestamp there is no other code in my loop other than the mcc scan_read function.
Additionally (or perhaps connected) if I check the data in the buffer using the mcc scan_status function to ensure I have 128 samples in the buffer before I read this does not return a continuously increasing number of samples but returns (for example) 4,4,4,95,95,95,95,160 - I would have expected to receive back 4,16,32,55,100,116,129 or something similar (if that makes any sense!).
The loop time without the mcc scan_read is around 2-3mS so I know my loop is fast enough,
Question
stevepqr
I have a peculiar problem with the MCC172 - I'm reading continuously at 1280Hz using a slightly modified version of the continous_scan.c example. I read 128 samples every loop, at 1280Hz I should get a read every 100mS but I'm not, mostly it's around 105mS but occasionally (every 8-9 loops) it will read in 55mS. I don't appear to be losing any samples but the reported timing is off, I'm using the Pi clock_gettime() to record the timestamp every loop, other than this timestamp there is no other code in my loop other than the mcc scan_read function.
Additionally (or perhaps connected) if I check the data in the buffer using the mcc scan_status function to ensure I have 128 samples in the buffer before I read this does not return a continuously increasing number of samples but returns (for example) 4,4,4,95,95,95,95,160 - I would have expected to receive back 4,16,32,55,100,116,129 or something similar (if that makes any sense!).
The loop time without the mcc scan_read is around 2-3mS so I know my loop is fast enough,
any ideas?
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now