From c2addeadb6c956d94ce61debf63719e29c2cd1e6 Mon Sep 17 00:00:00 2001 From: Mikhail Grushinskiy Date: Fri, 29 Nov 2024 14:11:44 -0500 Subject: [PATCH] Update README.md --- bbn_m5atomS3_lite_alternator_freq_to_RPM/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bbn_m5atomS3_lite_alternator_freq_to_RPM/README.md b/bbn_m5atomS3_lite_alternator_freq_to_RPM/README.md index 9f486c6..3fe4fa8 100644 --- a/bbn_m5atomS3_lite_alternator_freq_to_RPM/README.md +++ b/bbn_m5atomS3_lite_alternator_freq_to_RPM/README.md @@ -32,10 +32,14 @@ Output to esp32: ## ESP32 code +### Interrupt counting + Attach an interrupt handler function in RISING edge to analog input pin. Add logic to debounce interrupt. IF you do not know what 'debouncing of interrupt' you can google it. +### Debouncing interrupts + Debounce timeout. Let's say your engine RPM gauge goes to 5000 RPM and alternalor has N-poles. And "transfer number" on an alternator belt (makes alernator RPM differ from engine RPM). The ratio between alternator RPM and engine RPM is usually 2.5 to 1. @@ -53,6 +57,8 @@ Let's say there are 12 poles on alternator N = 12, R = 1. So debouncing time of 200 microseconds should be reasonable. +### Critical section of pulse counting + On esp32 there has to be added some synchronization code on the critical section of interrupts (pulses) counting.