etc
MC14490 하드웨어 디바운스
makeSomething
2020. 1. 16. 12:48
하드웨어 디바운스되는 칩중에서 이 칩이 최고중의 하나가 아닐까 합니다.
Features
• Diode Protection on All Inputs
• Six Debouncers Per Package
• Internal Pullups on All Data Inputs
• Can Be Used as a Digital Integrator, System Synchronizer, or Delay Line
• Internal Oscillator (R−C), or External Clock Source
• TTL Compatible Data Inputs/Outputs
• Single Line Input, Debounces Both “Make” and “Break” Contacts
• Does Not Require “Form C” (Single Pole Double Throw) Input Signal
• Cascadable for Longer Time Delays
• Schmitt Trigger on Clock Input (Pin 7)
• Supply Voltage Range = 3.0 V to 18 V
10nf를 사용했는데 4.7nf를 사용하면 좀 더 빠르게 클릭이 가능합니다. 10nf는 대략 100ms정도의 딜레이를 만들어 냅니다.
테스트용 아두이노 코드입니다. 하드웨어적으로 처리하기 때문에 delay없이 작동합니다.
int buttonPin = 3; // the number of the input pin
int ledPin = 13; // the number of the output pin
int state = 0; // the current state of the output pin
int reading; // the current reading from the input pin
int previous = 0; // the previous reading from the input pin
void setup()
{
pinMode(buttonPin, INPUT_PULLUP);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
reading = digitalRead(buttonPin);
if (reading == 0 && previous == 1)
{
state = !state;
Serial.println("button pressed");
}
digitalWrite(ledPin, state);
previous = reading;
}