Latching/Interrupt based digital inputs #10
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the Lightgate reflections are usually missed because we only send the pin state at each sending interval. That's stupid.
Solution A, the simple but bad one:
Declare the pin as latching, sample at 1kHz and if during one sending interval we've seen a 1 at any point in time, send a 1 after the interval.
Problem: Even at 1 kHz at max vehicle speed, the reflection zone needs to be at least 2.2cm wide, which is way too close to the usable width of the cone to be a safe reading. Also, this might explain why the readings were always dodgy even with the Autobox, which also sampled at 1kHz
Solution B, the proper one:
Use Pin Interrupts (CubeMX Pin Mode
GPIO_EXTI
) to detect even shorter pulses.Annoyance: Usually we'd do this through CubeMX, but we don't want 2 separate IOCs. So ideally we'd either use Pin interrupts both in the front and the back (either for those 2 pins or for all of them) or we re-implement the code gen's interrupt config using our pin configuration system.
@l.gies hat Option A schon irgendwo implementiert und könnte bald ausprobiert werden
@k.winkels CC
Würde Option B nehmen mit unmodifizierter IOC, das sollten nur ein paar zeilen sein, mmn einfacher als mehrere iocs zu pflegen.
Ja denke ich auch. Hast du Bock das zu machen? Hab bis nächste Woche keine Zeit leider
Ja gerne, ab Montag aber erst wahrscheinlich