adamfk / bouncy-button Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Affero General Public License v3.0
License: GNU Affero General Public License v3.0
Sometimes I do tests watching youtube or something. I use my peripheral vision to tell when to press/release and I miss the new max record.
I ran a bunch more exhaustive tests over night. No issue found. I believe my original test setup for observing the problem may have been flawed. Closing until we have a better test methodology.
We may occasionally log an extra pulse. It seems rather rare at this point unless you connect a 200+ kHz self generated signal.
I'm not overly concerned about it. It would be nice to fully understand or have another person help test/validate.
It's difficult to know exactly how the AVR architecture works regarding the edge counting peripheral and digital input synchronization/sampling. Some things in the datasheet seem to contradict others and also earlier tests.
This simulation is my current understanding.
The problem still doesn't quite make sense to me. If my simulation/model is accurate, then there should be certain times when we sample the pin as low and the next CPU instruction, we sample the rising edge count as increased. This does happen if I self test with a frequency between 210 kHz (gen a37
) and 381 kHz (gen a20
). How often we see it drops off as frequency decreases.
If it is a simple lining up issue, we should see it happen with a probability of roughly 1/40. However, when I test with frequencies slower than gen a37
, it runs a lot without detecting any issue.
I'm also running a frequency sweep with my picoscope and an NPN (and external 1k pullup). It started at 100 kHz (the fastest it can) and has run for hours already. I modified code to not wait for stable or even detect initial change so it would go faster and hopefully remove any factors preventing reproducing the 1/40 issue. gen a30
does reproduce the issue right away even with the modifications.
Interesting that gen a38
gives a period of almost 2x constant logging speed of around 40 instruction cycles. Perhaps this issue is related to that.
Should try pattern generator that can vary spacing between pulses.
Could be useful to have timestamps. Initially, we should just ignore them in the browser if they are present.
21:42:02.547 -> #################### Test #1 ####################
21:42:02.547 -> Section count: 1, type: "Normal"
21:42:02.581 -> Waiting for stable input... good.
21:42:03.091 -> _
21:42:03.091 -> | |
21:42:03.091 -> _ __ ___| | ___ __ _ ___ ___
21:42:03.091 -> | '__/ _ \ |/ _ \/ _` / __|/ _ \
21:42:03.091 -> | | | __/ | __/ (_| \__ \ __/
21:42:03.091 -> |_| \___|_|\___|\__,_|___/\___|
21:42:03.091 -> Release the button (it is currently pressed == logic low)
21:42:03.091 -> <test>
Test in chrome and firefox. Assume edge is same as chrome.
each chart/graph should be on its own page. table should start on its own page
https://developer.mozilla.org/en-US/docs/Web/CSS/break-after
gg - Glitch Guard. Useful with 'dtg'. Marks data to here as good.
dtg - Delete To last Glitch Guard 'gg'. Useful if wires glitch and a bunch of bogus data is recorded.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.