Дребезг контактов

взято тут http://www.mikroe.com/chapters/view/17/chapter-4-examples/

SWITCHES AND PUSH-BUTTONS

Switches and push-buttons are probably the simplest devices providing the simplest way of detecting the appearance of a voltage on a microcontroller input pin. Nevertheless, it is not as simple as it seems… The reason for it is a contact bounce.

Debounce Effect

The contact bounce is a common problem with mechanical switches. When the contacts strike together, their momentum and elasticity act together to cause bounce. The result is a rapidly pulsed electrical current instead of a clean transition from zero to full current. It mostly occurs due to vibrations, slight rough spots and dirt between contacts. This effect is usually unnoticeable when using these components in everyday life because the bounce happens too fast to affect most equipment. However, it causes problems in some analog and logic circuits that respond fast enough to misinterpret on/off pulses as a data stream. Anyway, the whole process doesn’t last long (a few micro or milliseconds), but long enough to be registered by the microcontroller. When only a push-button is used as a counter signal source, errors occur in almost 100% of cases!

This problem may be easily solved by connecting a simple RC circuit to suppress quick voltage changes. Since the bounce period is not defined, the values of components are not precisely determined. In most cases it is recommended to use the values as shown in figure below.

RC circuit

If complete stability is needed then radical measures should be taken. The output of the circuit, shown in figure below (RS flip-flop), will change its logic state only after detecting the first pulse triggered by a contact bounce. This solution is more expensive (SPDT switch), but the problem is definitely solved.

RS flip-flop

In addition to these hardware solutions, there is also a simple software solution. When the program tests the logic state of an input pin and detects a change, the check should be done one more time after a certain delay. If the program confirms the change, it means that a switch/push button has changed its position. The advantages of such solution are obvious: it is free of charge, effects of contact bounce are eliminated and it can be applied to the poorer quality contacts as well.

Тактовые генераторы в PIC (Microchip)

взято тут http://www.mikroe.com/chapters/view/17/chapter-4-examples/

CLOCK SIGNAL

Even though the microcontroller has a built-in oscillator, it cannot operate without external components which stabilize its operation and determine its frequency (operating speed of the microcontroller). Depending on elements in use as well as their frequencies, the oscillator can be run in four different modes:

  • LP — Low Power Crystal;
  • XT — Crystal / Resonator;
  • HS — High speed Crystal / Resonator; and
  • RC — Resistor / Capacitor.
Oscillator can be run in four different modes

Why are these modes so important? Owing to the fact that it is almost impossible to make a stable oscillator which operates over a wide frequency range, the microcontroller must know which crystal is connected so that it can adjust the operation of its internal electronics to it. This is why all programs used for chip loading contain an option for oscillator mode selection. See figure on the left.

Quartz Crystal

When the quartz crystal is used for frequency stabilization, a built-in oscillator operates at a precise frequency which is not affected by changes in temperature and power supply voltage. This frequency is usually labeled on the crysal casing.

Apart from the crystal, capacitors C1 and C2 must also be connected as per schematic below. Their capacitance is not of great importance. Therefore, the values provided in the table below should be considered as a recommendation, not as a strict rule.

Quartz Resonator

Ceramic Resonator

Ceramic resonator is cheaper, but very similar to quartz by its function and the way of operation. This is why schematics illustrating their connection to the microcontroller are identical. However, the capacitor value is slightly different due to different electric features. Refer to the table below.

Ceramic Resonator

Such resonators are usually connected to oscillators when it is not necessary to provide extremely precise frequency.

RC Oscillator

If the operating frequency is not of importance then there is no need to use additional expensive components for stabilization. Instead, a simple RC network, as shown in figure below, is sufficient. Since only the input of the local oscillator is used here, the clock signal with the Fosc/4 frequency will appear on the OSC2 pin. This frequency also represents the operating frequency of the microcontroller, i.e. the speed of instruction execution.

RC Oscillator

External Oscillator

If it is required to synchronize the operation of several microcontrollers or if for some reason it is not possible to use any of the previous schematics, a clock signal may be generated by an external oscillator. Refer to figure below.

External Oscillator

Regardless of the fact that the microcontroller is a product of modern technology, it is of no use if not connected to additional components. Simply put, the appearance of voltage on the microcontroller pins means nothing if not used for performing certain operations such as to turn something on/off, shift, display etc.

Стабилизаторы в корпусе SOT23-5

взято тут — http://monitor.espec.ws/section27/topic200427.html

Таблица SMD компонентов —  http://ecworld.ru/support/sdd/smdcod.htm

 

AIC1647 — SMD marking code 1647 / 1647P

AIC1653 — SMD marking code 1653

AL8805

AP3417C — SMD marking code G4I / G4U / G4V / G4W / BH / BL / BM / BN

APE1501 — SMD marking code G1xx

APW7104 — SMD marking code .W04X

AT731

AX3513 — SMD marking code G6xxx

BS3406

CAT4238 — SMD marking code MUxx

EC9203NNB2R — SMD marking code 9203

ELM91xx1xA ELM91xx3xA

EML3020 — SMD marking code 3020

EML9366 — SMD marking code 9366 / L601 / L607 / L60M / L600

FAN5331

FP6161 — SMD marking code ZYxxx

FP6366 — SMD marking code D0

FP6736 — SMD marking code CY

 

FSP3304 — SMD marking code LCxx

G5111T11 / G5111T12 — SMD marking code 51xx / 52xx

G5130 G5131 — SMD marking code EA25x / EA26x / EA27x / EA28x / EA29x / EA30x / EA31x / EA32x / EA33x / EA34x / EA35x / EA36x / EA37x / EA38x / EA39x / EA40x / EA41x / EA42x / EA43x / EA44x / EA45x / EA46x / EA47x / EA48x / EA49x / EA50x / EB25x / EB26x / EB27x / EB28x / EB29x / EB30x / EB31x / EB32x / EB33x / EB34x / EB35x / EB36x / EB37x / EB38x / EB39x / EB40x / EB41x / EB42x / EB43x / EB44x / EB45x / EB46x / EB47x / EB48x / EB49x / EB50x

G5695 — SMD marking code 5695x

HX1001 — SMD marking code HX-KG / HX-FG / HX-UG / HX-NG / HX-VG

iD8602

IS31LT3350

IS31LT3354

KB4312A — SMD marking code ATxxxx

LM2611A LM2611B

LM2703 — SMD marking code S48B

LM2704 — SMD marking code S28B

LM2731 — SMD marking code S51A / S51B

LM2733 — SMD marking code S52A / S52B

LM3670 — SMD marking code SDEB / SDDB / SEFB / SDCB / SDBB / S82B / SCZB / SDFB

LM3671 — SMD marking code SBTB / SBPB / SDRB / SEDB / SBRB / SDUB / SBSB / SDVB

LM3674 — SMD marking code SLRB / SLSB / SLHB / SNNB / SLZB / SLTB

LM27313 — SMD marking code SRPB / SD3B

LMR62014

LMR64010 — SMD marking code SF9B

*************************************************************************

LMR64010 — SMD marking code SF9B


LT1613 — SMD marking code LTED


LT1615 LT1615-1 — SMD marking code LTIZ / LTKH / LTXZ / LTBHT


LT1617 LT1617-1 — SMD marking code LTKF / LTKA


LT1931 LT1931A — SMD marking code LTRA LTSP LTBZF LTBZG


MAX1722 MAX1723 MAX1724 — SMD marking code ADQF / ADQG / ADQH / ADQI / ADQJ / ADQK


ME2108CM5 ME2108DM5


MIC5205 — SMD marking code KB25 / KB27 / KB28 / KB29 / KB2J / KB30 / KB31 / KB32 / KB33 / KB36 / KB38 / KB40 / KB50 / LB25 / LB27 / LB28 / LB29 / LB2J / LB30 / LB31 / LB32 / LB33 / LB36 / LB38 / LB40 / LB50


MP2104 — SMD marking code D7YW / D8YW


MP2105 — SMD marking code C6YW


MT5201


NCP1400A — SMD marking code DAIxx / DAVxx / DAAxx / DABxx / DAJxx / DADxx


NCP1402 — SMD marking code DAUxx / DAExx / DAFxx / DAGxx / DCRxx / DAHxx


NCP1403 — SMD marking code DCExx


NCP1406 — SMD marking code DAM Axx


NCP1529 — SMD marking code DXJ Axx


NCP5005 — SMD marking code DBNxxx


NCP5007 — SMD marking code DCLxxx


PAM2301 — SMD marking code BAxxx


R1210Nxx1x R1210Nxx2x Series


R1223N


R1224Nxx2E/F/G/H/L/M R1224N102G/H/M


RN5RKxx1A RN5RKxx1B RN5RKxx2A


RT8060 — SMD marking code 3R=xxx


RT8060A — SMD marking code 20=xxx


S-8351 S-8352 Series


S-8550 S-8551 Series — SMD marking code R5Ax / R5Cx


SP1937 — SMD marking code 97xx


ST1937


ST1S12GR ST1S12G12R ST1S12G18R


SY8088 — SMD marking code LDxxx


TPS61040 TPS61041 — SMD marking code PHOI / QXK / PHPI / CCL / CAW


TPS62200 TPS62201 TPS62202 TPS62203 TPS62204 TPS62205 TPS62207 TPS62208 — SMD marking code PHKI / PHLI / PHMI / PHNI / PHSI / PHTI / PJGI / ALW


TS1935


TS3410 — SMD marking code G6xxx


WD1013EA


XC9116B02AMR XC9116D02AMR — SMD marking code FBAx / FDAx


XC9119D10A — SMD marking code LDAx


XC9235 XC9236 XC9237


ZXSC300 — SMD marking code C300


ZXLD1615 — SMD marking code 615


KB3426 — SMD marking code A17x / A16x / A33x / A37x


SY8008A SY8008B SY8008C — SMD marking code AAxxx / ABxxx / ACxxx / BIxxx / BGxxx


SY8009A SY8009B — SMD marking code ADxxx / CUxxx / ASxxx

VOLTAGE REGULATORS


AAT3212


CLM2805A-X CLM2805C-X


EMP8734 — SMD marking code 8734


G9001 — SMD marking code 900Fx / 900Ix / 900Jx / 900Px


LP2983 — SMD marking code LENA / LELA / LENB / LELB


LP2985-N — SMD marking code L0KA / L0OA / L0PA / L0RA / L0SA / L0TA / L0UA / L0YA / LA7A / LALA / LAUA / LAXA / LKTA


MAX8887 MAX8888 — SMD marking code ADQD / ADPX / ADPY / ADPZ / ADQE / ADQA / ADQB / ADQC


NCP4625 — SMD marking code FBA / FBH / FBU / FBX / GBA / GBT / FAA / FAH / FAU / FAX / GAA / GAT


LN2407P00FMR


NCP703 — SMD marking code AEC / AEG / AED / AEE / AEF / AEH


R1111N181A R1111N181B R1111N301A R1111N301B R1111N401A R1111N401B R1111N501A R1111N501B — SMD marking code B8xx


R1162x Series


RT9167 RT9167A — SMD marking code E0 / E1 / E2 / E3 / E4 / E5 / E6 / E7 / E8 / E9 / EA / EB / EC / ED / EE / EF / EG / EH / EJ / EK / EL / EM / EN / EP / EQ / ER / ES / ET / EU / EV / EW / EX / EY / EZ / AR / AS / J0 / J1 / J2 / J3 / J4 / J5 / J6 / J7 / J8 / J9 / JA / JB / JC / JF / JE / JD / JG / JH / JJ / JK / JL / JM / JN / JP / JQ / JR / JS / JT / JU / JV / JW / JX / JY / JZ


RT9193


RT9701CBL — SMD marking code AH / C0


S-812C


S-816 Series — SMD marking code BAAT2x / BABT2x / BACT2x / BADT2x / BAET2x / BAFT2x / BAGT2x / BAHT2x / BAIT2x / BAJT2x / BAKT2x / BALT2x / BAMT2x / BANT2x / BAOT2x / BAPT2x / BAQT2x / BART2x / BAST2x / BATT2x / BAUT2x / BAVT2x / BAWT2x / BAXT2x / BAYT2x / BAZT2x / BBAT2x / BBBT2x / BBCT2x / BBDT2x / BBET2x / BBFT2x / BBGT2x / BBHT2x / BBIT2x / BBJT2x


S-1111 S-1121 Series


TC1014 TC1015 TC1185 — SMD marking code AY / A0 / A1 / A2 / A3 / A5 / A7 / A8 / A9 / AZ / B0 / B1 / B2 / B3 / B5 / B7 / B8 / B9 / BT / BY / BZ / N0 / N1 / N2 / N3 / N5 / N7 / N8 / N9 / NB / NT / NY / NZ


TK68101AS2 TK68112AS2 TK68113AS2 TK68115AS2 TK68118AS2 TK68125AS2 TK68126AS2 TK68127AS2 TK68128AS2 TK68129AS2 TK68130AS2 TK68131AS2 TK68132AS2 TK68133AS2 TK68135AS2 TK68140AS2 — SMD marking code N01 / N12 / N13 / N15 / N18 / N25 / N26 / N27 / N28 / N29 / N30 / N31 / N32 / N33 / N35 / N40


TPS76301-Q1 TPS76316-Q1 TPS76318-Q1 TPS76325-Q1 TPS76327-Q1 TPS76328-Q1 TPS76330-Q1 TPS76333-Q1 TPS76338-Q1 TPS76350-Q1 — SMD marking code BAN / BAD / BAP / BAQ / BAT / BAU / BAW


TS5213CU533RF TS5213CU550RF TS5213CX533RF TS5213CX550RF — SMD marking code TX5 / TXS


PT1101E23E-xx — аналог R1223Nxx2


ACT6906 — SMD marking code IAFX / IAFA / IAFB / IAFM


ACT6907 — SMD marking code IAGX / IAGA / IAGB / IAGD / IAGL / IAGG / IAGM

 

 

 

 

 

 

KNX/EIB Дроссель (drossel)

По мотивам mikrokontroller.net и freebus.org

 

 

 

Надо попробовать этух схему, есть определенные перспективы
(взято http://www.cqham.ru/smartdrill.htm)

Вчера срочно понадобилось макетку дома делать — до понедельника далеко, работа стоит, начальство свирепствуее… ~10х20 см, сотни четыре отверстий. Hачал сверлить, после первой сотни на ручной сверлилке кнопка загнулась (КМ1-1в). Во блин, думаю, как все не вовремя. И плату надо, и кнопки нет. Попробовал сверлить с постоянно включенным моторчиком — пока в кернение сверлом попадешь, вокруг вся фольга как после террористов… 8-( И тут вспомнил как кто-то с пол года назад писал, что у знакомого сверлилка сама включается и выключается… Пол-часа с кружкой кофе, сигаретой в одной руке, карандашем в другой и пол-часа на эксперименты с паяльником и вот оно — SmartDrill 😎

Итак, как ОHО работает: в ненагруженном состоянии моторчик потребляет 35 мА. Ток проходит через проволочный 10 Ом резистор и обычный МЛТ 0,25 300 Ом. Вал слегка вращается (~100 об/мин). Транзисторы закрыты. Когда нагрузка на валу возростает (я попал в кернение сверлом), ток увеличивается, на проволочном резисторе падение также увеличивается, это падение через резистор 4к7 прикладывается к базе КТ361, там суммируется с начальным смещением (через резистор 300к) и КТ361 открывается. Hа базу КТ972А подается открывающий ток и он переходит в насыщенное состояние. Моторчик крутится с высокой скоростью. После снятия нагрузки, падение на проволочном резисторе снова уменьшается, схема переходит в неактивное состояние. Конденсатор 0,1-0,33 мкФ устраняет ложные срабатывания от бросков коллекторного тока. Сверлить одно удовольствие 😎