Here's short demo of the prototype:
The newest version of this project uses the ESP8266. This gives it an order of magnitude boost in precision over the previous version. (The first prototype used an Arduino at 16MHz. But due to the limitations of the 328P was not able to take full advantage of it. The ESP8266 has a CCOUNT register. This is an unsigned 32 bit int that always has a running tally of the clock cycle count at the full 80MHz of the ESP8266. fps speed is then determined by taking the clock cycle rate and dividing it by the difference between the first and second measured CCOUNT:
fps = 80000000 / ( CCOUNT_2 - CCOUNT_1 )
Since the max value of the CCOUNT register is 4294967291 and it increments at 80 MHz, there is a small (1 in 50000 or so) chance that the CCOUNT register will have reset between the first and second measurement. To handle this we check to see if CCOUNT_2 < CCOUNT_1. If it is we can still get fps by doing -
fps = 80000000 / ( ( 4294967291 - CCOUNT_1) + CCOUNT_2 )
Code will go up on Github in the next day or two. Until then...
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.