From fc53d5512420ace25444cffbb2129a772f7bfa14 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 12 Sep 2015 01:02:28 -0400 Subject: [PATCH] auto-sync --- .../controllers/trigger/trigger_decoder.cpp | 21 +- .../controllers/trigger/trigger_decoder.h | 1 + .../controllers/trigger/trigger_structure.cpp | 7 +- .../controllers/trigger/trigger_structure.h | 7 + firmware/rusefi.cpp | 2 +- hardware/CJ125_board/O2_input_CJ125.sch | 1306 +++++++++++++++++ unit_tests/test_trigger_decoder.cpp | 88 +- 7 files changed, 1336 insertions(+), 96 deletions(-) create mode 100644 hardware/CJ125_board/O2_input_CJ125.sch diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 9b3d6d8b3a..91a7f834fa 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -149,8 +149,9 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no nextTriggerEvent() ; if (TRIGGER_SHAPE(gapBothDirections) && considerEventForGap()) { - toothed_previous_duration = currentDuration; isFirstEvent = false; + durationBeforePrevious = toothed_previous_duration; + toothed_previous_duration = currentDuration; toothed_previous_time = nowNt; } return; @@ -172,20 +173,27 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no bool_t isSynchronizationPoint; if (TRIGGER_SHAPE(isSynchronizationNeeded)) { - isSynchronizationPoint = currentDuration > toothed_previous_duration * TRIGGER_SHAPE(syncRatioFrom) - && currentDuration < toothed_previous_duration * TRIGGER_SHAPE(syncRatioTo); + /** + * Here I prefer to have two multiplications instead of one division, that's a micro-optimization + */ + isSynchronizationPoint = currentDuration > toothed_previous_duration * TRIGGER_SHAPE(syncRatioFrom) && + currentDuration < toothed_previous_duration * TRIGGER_SHAPE(syncRatioTo) && + toothed_previous_duration > durationBeforePrevious * TRIGGER_SHAPE(secondSyncRatioFrom) && + toothed_previous_duration < durationBeforePrevious * TRIGGER_SHAPE(secondSyncRatioTo) + ; -#if EFI_PROD_CODE +#if EFI_PROD_CODE || defined(__DOXYGEN__) if (engineConfiguration->isPrintTriggerSynchDetails) { #else if (printTriggerDebug) { #endif /* EFI_PROD_CODE */ float gap = 1.0 * currentDuration / toothed_previous_duration; -#if EFI_PROD_CODE +#if EFI_PROD_CODE || defined(__DOXYGEN__) scheduleMsg(logger, "gap=%f @ %d", gap, currentCycle.current_index); #else actualSynchGap = gap; - print("current gap %f c=%d prev=%d\r\n", gap, currentDuration, toothed_previous_duration); + float prevGap = 1.0 * toothed_previous_duration / durationBeforePrevious; + print("current gap %f/%f c=%d prev=%d\r\n", gap, prevGap, currentDuration, toothed_previous_duration); #endif /* EFI_PROD_CODE */ } @@ -248,6 +256,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no ; } + durationBeforePrevious = toothed_previous_duration; toothed_previous_duration = currentDuration; toothed_previous_time = nowNt; } diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index 3849350674..92af69154a 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -54,6 +54,7 @@ public: */ bool shaft_is_synchronized; + uint32_t durationBeforePrevious; uint32_t toothed_previous_duration; /** * this could be a local variable, but it's better for debugging to have it as a field diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index 82e85e1bb1..2518aff86d 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -47,6 +47,8 @@ TriggerShape::TriggerShape() : tdcPosition = 0; skippedToothCount = totalToothCount = 0; syncRatioFrom = syncRatioTo = 0; + secondSyncRatioFrom = 0.000001; + secondSyncRatioTo = 100000; memset(eventAngles, 0, sizeof(eventAngles)); memset(frontOnlyIndexes, 0, sizeof(frontOnlyIndexes)); memset(isFrontEvent, 0, sizeof(isFrontEvent)); @@ -153,6 +155,7 @@ TriggerState::TriggerState() { shaft_is_synchronized = false; toothed_previous_time = 0; toothed_previous_duration = 0; + durationBeforePrevious = 0; totalRevolutionCounter = 0; totalTriggerErrorCounter = 0; @@ -236,7 +239,7 @@ operation_mode_e TriggerShape::getOperationMode() { return operationMode; } -#if EFI_UNIT_TEST +#if EFI_UNIT_TEST || defined(__DOXYGEN__) extern bool printTriggerDebug; #endif @@ -245,7 +248,7 @@ void TriggerShape::addEvent(float angle, trigger_wheel_e const waveIndex, trigge efiAssertVoid(waveIndex!= T_SECONDARY || needSecondTriggerInput, "secondary needed or not?"); -#if EFI_UNIT_TEST +#if EFI_UNIT_TEST || defined(__DOXYGEN__) if (printTriggerDebug) { printf("addEvent %f\r\n", angle); } diff --git a/firmware/controllers/trigger/trigger_structure.h b/firmware/controllers/trigger/trigger_structure.h index 234cc69aef..10505472b2 100644 --- a/firmware/controllers/trigger/trigger_structure.h +++ b/firmware/controllers/trigger/trigger_structure.h @@ -49,6 +49,13 @@ public: float syncRatioFrom; float syncRatioTo; + /** + * Usually this is not needed, but some crazy triggers like 36-2-2-2 require two consecutive + * gaps ratios to sync + */ + float secondSyncRatioFrom; + float secondSyncRatioTo; + /** * that's the angle distance from trigger event #0 and actual engine TDC * see also globalTriggerAngleOffset diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index cec743e5c8..808997cdfa 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -273,5 +273,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20150910; + return 20150911; } diff --git a/hardware/CJ125_board/O2_input_CJ125.sch b/hardware/CJ125_board/O2_input_CJ125.sch new file mode 100644 index 0000000000..19ccfb387e --- /dev/null +++ b/hardware/CJ125_board/O2_input_CJ125.sch @@ -0,0 +1,1306 @@ +EESchema Schematic File Version 2 date 2/26/2012 7:38:24 PM +LIBS:power +LIBS:device +LIBS:conn +LIBS:linear +LIBS:regul +LIBS:74xx +LIBS:cmos4000 +LIBS:adc-dac +LIBS:memory +LIBS:xilinx +LIBS:special +LIBS:microcontrollers +LIBS:microchip +LIBS:analog_switches +LIBS:motorola +LIBS:intel +LIBS:audio +LIBS:interface +LIBS:digital-audio +LIBS:philips +LIBS:display +LIBS:cypress +LIBS:siliconi +LIBS:contrib +LIBS:project_specific_libs +LIBS:o5e-cache +EELAYER 25 0 +EELAYER END +$Descr User 11000 8500 +encoding utf-8 +Sheet 11 12 +Title "Open5xxxECU" +Date "27 feb 2012" +Rev "A-spinout-3" +Comp "http://open5xxxecu.org/ o5e" +Comment1 "2 channels of Wide O2 " +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +Wire Notes Line + 7100 4300 7100 4150 +Wire Notes Line + 7100 4150 7200 4150 +Wire Wire Line + 4250 3175 4250 5775 +Wire Wire Line + 5500 5500 5500 5575 +Wire Wire Line + 5500 5500 5125 5500 +Wire Wire Line + 5775 5150 5775 5200 +Wire Wire Line + 5775 5150 5300 5150 +Connection ~ 9775 5375 +Wire Wire Line + 9825 5375 9700 5375 +Wire Wire Line + 8575 5275 8575 5175 +Wire Wire Line + 7650 5175 7750 5175 +Wire Wire Line + 9775 5450 9775 5375 +Wire Wire Line + 8800 5575 8925 5575 +Wire Wire Line + 7700 5575 7650 5575 +Wire Wire Line + 7650 5475 8300 5475 +Wire Wire Line + 8825 6175 8825 6225 +Wire Wire Line + 7750 5975 7650 5975 +Wire Wire Line + 7750 5875 7650 5875 +Wire Wire Line + 7750 6075 7650 6075 +Wire Wire Line + 7750 6175 7650 6175 +Wire Wire Line + 7325 6975 9025 6975 +Wire Wire Line + 9025 6975 9025 5675 +Wire Wire Line + 9025 5675 7650 5675 +Connection ~ 6000 6375 +Wire Wire Line + 5950 6375 6050 6375 +Wire Wire Line + 5775 5200 6525 5200 +Connection ~ 6525 5275 +Wire Wire Line + 6525 5200 6525 5275 +Wire Wire Line + 6000 5675 5500 5675 +Wire Wire Line + 6000 5275 5775 5275 +Wire Wire Line + 5500 5575 6550 5575 +Wire Wire Line + 6500 5475 6550 5475 +Wire Wire Line + 4950 6175 4950 6225 +Wire Wire Line + 4250 5775 4000 5775 +Wire Wire Line + 6550 6075 6400 6075 +Wire Wire Line + 6400 6075 6400 6125 +Wire Wire Line + 6400 6125 6300 6125 +Wire Wire Line + 6400 4725 6400 4775 +Connection ~ 7650 4775 +Wire Wire Line + 7650 5075 7650 4725 +Wire Wire Line + 6900 4775 6550 4775 +Wire Wire Line + 6550 4775 6550 5075 +Wire Wire Line + 7300 4775 7650 4775 +Wire Wire Line + 5900 5975 5900 6125 +Wire Wire Line + 6400 5975 6550 5975 +Wire Wire Line + 6550 5775 4750 5775 +Connection ~ 4950 5775 +Wire Wire Line + 6550 6375 6550 6175 +Wire Wire Line + 6000 6775 6000 6825 +Wire Wire Line + 6500 5275 6550 5275 +Wire Wire Line + 6550 5675 6500 5675 +Wire Wire Line + 6000 5475 5975 5475 +Wire Wire Line + 5775 5275 5775 5375 +Wire Wire Line + 6150 5100 5775 5100 +Wire Wire Line + 6150 5100 6150 5175 +Wire Wire Line + 6150 5175 6550 5175 +Connection ~ 6400 5175 +Wire Wire Line + 6550 5875 5200 5875 +Wire Wire Line + 5200 5875 5200 6975 +Wire Wire Line + 5200 6975 6825 6975 +Wire Wire Line + 7650 5775 8825 5775 +Connection ~ 8825 5775 +Wire Wire Line + 8300 5475 8300 5575 +Wire Wire Line + 8300 5575 8200 5575 +Wire Wire Line + 8800 5475 8925 5475 +Wire Wire Line + 9775 5850 9775 5900 +Wire Wire Line + 9200 5375 7650 5375 +Wire Wire Line + 7650 5275 8175 5275 +Wire Wire Line + 8675 5175 8250 5175 +Connection ~ 8575 5175 +Wire Wire Line + 5775 5100 5775 5050 +Wire Wire Line + 5775 5050 5300 5050 +Wire Wire Line + 6550 5375 5450 5375 +Connection ~ 5775 5375 +Wire Wire Line + 5125 5625 5500 5625 +Wire Wire Line + 5500 5625 5500 5675 +Wire Wire Line + 5500 3025 5500 3075 +Wire Wire Line + 5500 3025 5100 3025 +Connection ~ 5775 2775 +Wire Wire Line + 5450 2775 6550 2775 +Wire Wire Line + 5350 2450 5775 2450 +Wire Wire Line + 5775 2450 5775 2500 +Connection ~ 8575 2575 +Wire Wire Line + 8250 2575 8675 2575 +Wire Wire Line + 7650 2675 8175 2675 +Wire Wire Line + 9175 2775 7650 2775 +Wire Wire Line + 9750 3250 9750 3300 +Wire Wire Line + 8800 2875 8925 2875 +Wire Wire Line + 8200 2975 8300 2975 +Wire Wire Line + 8300 2975 8300 2875 +Connection ~ 8825 3175 +Wire Wire Line + 7650 3175 8825 3175 +Wire Wire Line + 6825 4375 5200 4375 +Wire Wire Line + 5200 4375 5200 3275 +Wire Wire Line + 5200 3275 6550 3275 +Connection ~ 6400 2575 +Wire Wire Line + 6550 2575 6130 2575 +Wire Wire Line + 6130 2575 6130 2500 +Wire Wire Line + 6130 2500 5775 2500 +Wire Wire Line + 5775 2775 5775 2675 +Wire Wire Line + 6000 2875 5980 2875 +Wire Wire Line + 6550 3075 6500 3075 +Wire Wire Line + 6550 2675 6500 2675 +Wire Wire Line + 6000 4175 6000 4225 +Wire Wire Line + 6550 3775 6550 3575 +Connection ~ 4950 3175 +Wire Wire Line + 4750 3175 6550 3175 +Wire Wire Line + 6400 3375 6550 3375 +Wire Wire Line + 5900 3375 5900 3525 +Wire Wire Line + 7300 2175 7650 2175 +Wire Wire Line + 6550 2475 6550 2175 +Wire Wire Line + 6550 2175 6900 2175 +Wire Wire Line + 7650 2125 7650 2475 +Connection ~ 7650 2175 +Wire Wire Line + 6400 2125 6400 2175 +Wire Wire Line + 6300 3525 6400 3525 +Wire Wire Line + 6400 3525 6400 3475 +Wire Wire Line + 6400 3475 6550 3475 +Wire Wire Line + 4950 3575 4950 3625 +Wire Wire Line + 6500 2875 6550 2875 +Wire Wire Line + 6550 2975 5500 2975 +Wire Wire Line + 5775 2675 6000 2675 +Wire Wire Line + 5500 3075 6000 3075 +Wire Wire Line + 6525 2675 6525 2600 +Connection ~ 6525 2675 +Wire Wire Line + 6525 2600 5775 2600 +Wire Wire Line + 6050 3775 5950 3775 +Connection ~ 6000 3775 +Wire Wire Line + 7650 3075 9025 3075 +Wire Wire Line + 9025 3075 9025 4375 +Wire Wire Line + 9025 4375 7325 4375 +Wire Wire Line + 7750 3575 7650 3575 +Wire Wire Line + 7750 3475 7650 3475 +Wire Wire Line + 7750 3275 7650 3275 +Wire Wire Line + 7750 3375 7650 3375 +Wire Wire Line + 8825 3575 8825 3625 +Wire Wire Line + 8300 2875 7650 2875 +Wire Wire Line + 7700 2975 7650 2975 +Wire Wire Line + 8800 2975 8925 2975 +Wire Wire Line + 9750 2850 9750 2775 +Wire Wire Line + 7650 2575 7750 2575 +Wire Wire Line + 8575 2575 8575 2675 +Wire Wire Line + 9675 2775 9800 2775 +Connection ~ 9750 2775 +Wire Wire Line + 5350 2550 5775 2550 +Wire Wire Line + 5775 2550 5775 2600 +Wire Wire Line + 5100 2900 5500 2900 +Wire Wire Line + 5500 2900 5500 2975 +Wire Notes Line + 7150 6750 7050 6750 +Wire Notes Line + 7050 6750 7050 6900 +Text Notes 7150 6750 0 60 ~ 0 +82.5 ohm for LSU4.2\n200 ohm for LSU4.9 +Text Notes 7200 4150 0 60 ~ 0 +82.5 ohm for LSU4.2\n200 ohm for LSU4.9 +Text Label 6850 2175 1 60 ~ 0 +BATV +Text Label 6875 4775 1 60 ~ 0 +BATV +$Comp +L C C1211 +U 1 1 4E39E9D3 +P 8375 2675 +F 0 "C1211" V 8400 2850 50 0000 L CNN +F 1 "0.1uF" V 8400 2500 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "AVX,08055C104KAT2A" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,27C8438" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200V" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "CERAMIC" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8375 2675 + 0 1 1 0 +$EndComp +Text HLabel 9800 2775 2 60 Input ~ 0 +CJ125-1_UA +$Comp +L R R1223 +U 1 1 4E39E9D2 +P 9425 2775 +F 0 "R1223" V 9325 2775 50 0000 C CNN +F 1 "1k" V 9425 2775 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW08051K00FKTA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,05F1507" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "THICK FILM" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 9425 2775 + 0 1 -1 0 +$EndComp +$Comp +L R R1219 +U 1 1 4E39E9D1 +P 8550 2875 +F 0 "R1219" V 8500 2575 50 0000 C CNN +F 1 "100k" V 8550 2875 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW0805100KFKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,52K9808" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8550 2875 + 0 1 1 0 +$EndComp +$Comp +L C C1215 +U 1 1 4E39E9D0 +P 9750 3050 +F 0 "C1215" H 9825 3150 50 0000 L CNN +F 1 "0.01uF" H 9450 3150 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "avx,08055C103JAT2A " V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,96M1408" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "50v" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "tol" +F 10 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 9750 3050 + 1 0 0 1 +$EndComp +$Comp +L C C1209 +U 1 1 4E39E9CF +P 7100 2175 +F 0 "C1209" V 7025 2375 50 0000 L CNN +F 1 ".033uF" V 7025 1975 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 7100 2175 + 0 1 -1 0 +$EndComp +$Comp +L R R1211 +U 1 1 4E39E9CE +P 6300 3775 +F 0 "R1211" V 6400 3775 50 0000 C CNN +F 1 "1k" V 6300 3775 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW08051K00FKTA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,05F1507" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "THICK FILM" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6300 3775 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0156 +U 1 1 4E39E9CD +P 7650 2125 +F 0 "#PWR0156" H 7650 2125 30 0001 C CNN +F 1 "GND" H 7650 2055 30 0001 C CNN + 1 7650 2125 + -1 0 0 1 +$EndComp +$Comp +L R R1205 +U 1 1 4E39E9CC +P 6250 2675 +F 0 "R1205" V 6200 2975 50 0000 C CNN +F 1 "61.9" V 6250 2675 50 0000 C CNN +F 2 "SM0805" V 6430 2775 60 0001 C CNN +F 4 "vishay,CRCW080561R9FKEA" V 2430 4325 60 0001 C CNN "mfg,#" +F 5 "newark,53K0407" V 2430 4325 60 0001 C CNN "vend,#" +F 6 "-,-" V 2430 4325 60 0001 C CNN "Field3" +F 7 "-,-" V 2430 4325 60 0001 C CNN "Field4" +F 8 "125,mW" V 2430 4325 60 0001 C CNN "Field5" +F 9 "1,%" V 2430 4325 60 0001 C CNN "Field6" +F 10 "thick film" V 2430 4325 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2430 4325 60 0001 C CNN "Field8" + 1 6250 2675 + 0 1 -1 0 +$EndComp +$Comp +L R R1206 +U 1 1 4E39E9CB +P 6250 2875 +F 0 "R1206" V 6300 2575 50 0000 C CNN +F 1 "10k" V 6250 2875 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "BOURNS,CR0805-FX-1002ELF" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,02J2368" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "w" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6250 2875 + 0 -1 1 0 +$EndComp +$Comp +L C C1203 +U 1 1 4E39E9CA +P 6000 3975 +F 0 "C1203" H 6100 3875 50 0000 L CNN +F 1 ".033uF" H 5800 3875 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6000 3975 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR0157 +U 1 1 4E39E9C9 +P 9750 3300 +F 0 "#PWR0157" H 9750 3300 30 0001 C CNN +F 1 "GND" H 9750 3230 30 0001 C CNN + 1 9750 3300 + 1 0 0 -1 +$EndComp +$Comp +L R R1217 +U 1 1 4E39E9C8 +P 8000 2575 +F 0 "R1217" V 7900 2550 50 0000 C CNN +F 1 "100k" V 8000 2575 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW0805100KFKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,52K9808" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8000 2575 + 0 1 1 0 +$EndComp +$Comp +L C C1201 +U 1 1 4E39E9C7 +P 4950 3375 +F 0 "C1201" H 5025 3275 50 0000 L CNN +F 1 "1000pF" H 4625 3275 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "avx,08052C102KAT2A " V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "mouser,581-08052C102K" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200v" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "tol" +F 10 "x7r" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 4950 3375 + 1 0 0 -1 +$EndComp +$Comp +L R R1207 +U 1 1 4E39E9C6 +P 6250 3075 +F 0 "R1207" V 6300 3375 50 0000 C CNN +F 1 "6.8k" V 6250 3075 50 0000 C CNN +F 2 "SM0805" V 6430 3175 60 0001 C CNN +F 4 "vishay,CRCW08056K80FKEA" V 2430 4725 60 0001 C CNN "mfg,#" +F 5 "newark,53K0372" V 2430 4725 60 0001 C CNN "vend,#" +F 6 "-,-" V 2430 4725 60 0001 C CNN "Field3" +F 7 "-,-" V 2430 4725 60 0001 C CNN "Field4" +F 8 "125,mW" V 2430 4725 60 0001 C CNN "Field5" +F 9 "1,%" V 2430 4725 60 0001 C CNN "Field6" +F 10 "thick film" V 2430 4725 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2430 4725 60 0001 C CNN "Field8" + 1 6250 3075 + 0 1 1 0 +$EndComp +$Comp +L C C1207 +U 1 1 4E39E9C5 +P 6400 2375 +F 0 "C1207" H 6150 2475 50 0000 L CNN +F 1 "220pf" H 6150 2275 50 0000 L CNN +F 2 "SM0805" V 3480 3475 60 0001 C CNN +F 4 "avx,08051A221JAT2A" V 3480 3475 60 0001 C CNN "mfg,#" +F 5 "newark,96K4770" V 3480 3475 60 0001 C CNN "vend,#" +F 6 "-,-" V 3480 3475 60 0001 C CNN "Field3" +F 7 "-,-" V 3480 3475 60 0001 C CNN "Field4" +F 8 "100,V" V 3480 3475 60 0001 C CNN "Field5" +F 9 "5,%" V 3480 3475 60 0001 C CNN "Field6" +F 10 "Ceramic" V 3480 3475 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 3480 3475 60 0001 C CNN "Field8" + 1 6400 2375 + 1 0 0 1 +$EndComp +$Comp +L GND #PWR0158 +U 1 1 4E39E9C4 +P 6400 2125 +F 0 "#PWR0158" H 6400 2125 30 0001 C CNN +F 1 "GND" H 6400 2055 30 0001 C CNN + 1 6400 2125 + -1 0 0 1 +$EndComp +$Comp +L R R1201 +U 1 1 4E39E9C3 +P 4500 3175 +F 0 "R1201" V 4600 3175 50 0000 C CNN +F 1 "10k" V 4500 3175 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "BOURNS,CR0805-FX-1002ELF" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,02J2368" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "w" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 4500 3175 + 0 1 1 0 +$EndComp +$Comp +L C C1205 +U 1 1 4E39E9C2 +P 6100 3525 +F 0 "C1205" V 6000 3350 50 0000 L CNN +F 1 "0.1uF" V 6000 3700 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "AVX,08055C104KAT2A" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,27C8438" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200V" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "CERAMIC" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6100 3525 + 0 -1 -1 0 +$EndComp +$Comp +L R R1203 +U 1 1 4E39E9C1 +P 6150 3375 +F 0 "R1203" V 6200 3675 50 0000 C CNN +F 1 "27k" V 6150 3375 50 0000 C CNN +F 2 "SM0805" V 6330 3475 60 0001 C CNN +F 4 "vishay,CRCW080527K0FKEA" V 2330 5025 60 0001 C CNN "mfg,#" +F 5 "newark,53K0071" V 2330 5025 60 0001 C CNN "vend,#" +F 6 "-,-" V 2330 5025 60 0001 C CNN "Field3" +F 7 "-,-" V 2330 5025 60 0001 C CNN "Field4" +F 8 "125,mW" V 2330 5025 60 0001 C CNN "Field5" +F 9 "1,%" V 2330 5025 60 0001 C CNN "Field6" +F 10 "thick film" V 2330 5025 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2330 5025 60 0001 C CNN "Field8" + 1 6150 3375 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0159 +U 1 1 4E39E9C0 +P 4950 3625 +F 0 "#PWR0159" H 4950 3625 30 0001 C CNN +F 1 "GND" H 4950 3555 30 0001 C CNN + 1 4950 3625 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR0160 +U 1 1 4E39E9BF +P 6000 4225 +F 0 "#PWR0160" H 6000 4225 30 0001 C CNN +F 1 "GND" H 6000 4155 30 0001 C CNN + 1 6000 4225 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR0161 +U 1 1 4E39E9BE +P 5980 2875 +F 0 "#PWR0161" H 5980 2875 30 0001 C CNN +F 1 "GND" H 5980 2805 30 0001 C CNN + 1 5980 2875 + 0 1 1 0 +$EndComp +Text HLabel 5950 3775 0 60 Input ~ 0 +CJ125-1_UR +$Comp +L R R1213 +U 1 1 4E39E9BD +P 7075 4375 +F 0 "R1213" V 7175 4350 50 0000 C CNN +F 1 "82.5" V 7075 4375 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW080582R5FKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,53K0506" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 ".1%" V 1130 2600 60 0001 C CNN "tol" +F 10 "thin film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 7075 4375 + 0 1 1 0 +$EndComp +$Comp +L R R1220 +U 1 1 4E39E9BC +P 8550 2975 +F 0 "R1220" V 8600 3250 50 0000 C CNN +F 1 "470k" V 8550 2975 50 0000 C CNN +F 2 "SM0805" V 8730 3075 60 0001 C CNN +F 4 "vishay,CRCW0805470KFKEA" V 4730 4625 60 0001 C CNN "mfg,#" +F 5 "newark,53K0283" V 4730 4625 60 0001 C CNN "vend,#" +F 6 "-,-" V 4730 4625 60 0001 C CNN "Field3" +F 7 "-,-" V 4730 4625 60 0001 C CNN "Field4" +F 8 "125,mW" V 4730 4625 60 0001 C CNN "Field5" +F 9 "1,%" V 4730 4625 60 0001 C CNN "Field6" +F 10 "thick film" V 4730 4625 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 4730 4625 60 0001 C CNN "Field8" + 1 8550 2975 + 0 1 1 0 +$EndComp +$Comp +L R R1215 +U 1 1 4E39E9BB +P 7950 2975 +F 0 "R1215" V 8000 3250 50 0000 C CNN +F 1 "4.7k" V 7950 2975 50 0000 C CNN +F 2 "SM0805" V 8130 3075 60 0001 C CNN +F 4 "panasonic,ERA6AEB472V" V 4130 4625 60 0001 C CNN "mfg,#" +F 5 "newark,08N2175" V 4130 4625 60 0001 C CNN "vend,#" +F 6 "-,-" V 4130 4625 60 0001 C CNN "Field3" +F 7 "-,-" V 4130 4625 60 0001 C CNN "Field4" +F 8 "125,mW" V 4130 4625 60 0001 C CNN "Field5" +F 9 ".1,%" V 4130 4625 60 0001 C CNN "Field6" +F 10 "metal film" V 4130 4625 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 4130 4625 60 0001 C CNN "Field8" + 1 7950 2975 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0162 +U 1 1 4E39E9BA +P 8825 3625 +F 0 "#PWR0162" H 8825 3625 30 0001 C CNN +F 1 "GND" H 8825 3555 30 0001 C CNN + 1 8825 3625 + 1 0 0 -1 +$EndComp +$Comp +L C C1213 +U 1 1 4E39E9B9 +P 8825 3375 +F 0 "C1213" H 8550 3275 50 0000 L CNN +F 1 ".033uF" H 8625 3475 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8825 3375 + 1 0 0 1 +$EndComp +Text HLabel 7750 3575 2 60 Input ~ 0 +CJ125-1_SCK +Text HLabel 7750 3475 2 60 Input ~ 0 +CJ125-1_SO +Text HLabel 7750 3275 2 60 Input ~ 0 +CJ125-1_SS +Text HLabel 7750 3375 2 60 Input ~ 0 +CJ125-1_SI +$Comp +L GND #PWR0163 +U 1 1 4E39E9B8 +P 8675 2575 +F 0 "#PWR0163" H 8675 2575 30 0001 C CNN +F 1 "GND" H 8675 2505 30 0001 C CNN + 1 8675 2575 + 0 -1 -1 0 +$EndComp +Text Label 8925 2875 0 60 ~ 0 +UN-1 +Text Label 8925 2975 0 60 ~ 0 +IA-1 +Text Label 5800 2775 0 60 ~ 0 +IA-1 +Text Label 5775 2500 0 60 ~ 0 +UN-1 +$Comp +L CJ125 U1201 +U 1 1 4E39E9B7 +P 7100 3025 +F 0 "U1201" H 6950 3675 70 0000 C CNN +F 1 "CJ125" H 7000 2325 70 0000 C CNN +F 2 "SOIC24" H 7100 3025 60 0001 C CNN +F 4 "bosh,cj125" V 5655 4475 60 0001 C CNN "mfg,#" +F 5 "future,8746778" V 5655 4475 60 0001 C CNN "vend,#" +F 6 "-,-" V 5655 4475 60 0001 C CNN "Field3" +F 7 "-,-" V 5655 4475 60 0001 C CNN "Field4" +F 8 "-,-" V 5655 4475 60 0001 C CNN "Field5" +F 9 "-,-" V 5655 4475 60 0001 C CNN "Field6" +F 10 "wide O2" V 5655 4475 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 5655 4475 60 0001 C CNN "Field8" + 1 7100 3025 + 1 0 0 -1 +$EndComp +Text Label 5500 2975 0 60 ~ 0 +DIAHG-1 +Text Label 5500 3075 0 60 ~ 0 +DIAHD-1 +Text Label 5775 2600 0 60 ~ 0 +IP-1 +Text HLabel 5450 2775 0 60 Input ~ 0 +O2-1_IA_PIN +Text HLabel 5350 2550 0 60 Input ~ 0 +O2-1_IP_PIN +Text HLabel 5350 2450 0 60 Input ~ 0 +O2-1_UN_PIN +Text HLabel 5100 2900 0 60 Input ~ 0 +O2-1_DIAHG_PIN +Text HLabel 5100 3025 0 60 Input ~ 0 +O2-1_DIAHD_PIN +Text HLabel 9025 4275 2 60 Input ~ 0 +O2-1_VM_PIN +Text Label 8500 3175 2 60 ~ 0 +5v_reg +Text Label 4175 5775 2 60 ~ 0 +5v_reg +Text Label 8500 5775 2 60 ~ 0 +5v_reg +Text HLabel 9025 6875 2 60 Input ~ 0 +O2-2_VM_PIN +Text HLabel 5125 5625 0 60 Input ~ 0 +O2-2_DIAHD_PIN +Text HLabel 5125 5500 0 60 Input ~ 0 +O2-2_DIAHG_PIN +Text HLabel 5300 5050 0 60 Input ~ 0 +O2-2_UN_PIN +Text HLabel 5300 5150 0 60 Input ~ 0 +O2-2_IP_PIN +Text HLabel 5450 5375 0 60 Input ~ 0 +O2-2_IA_PIN +Text Label 5775 5200 0 60 ~ 0 +IP-2 +Text Label 5500 5675 0 60 ~ 0 +DIAHD-2 +Text Label 5500 5575 0 60 ~ 0 +DIAHG-2 +$Comp +L CJ125 U1202 +U 1 1 4C0A26E3 +P 7100 5625 +F 0 "U1202" H 6950 6275 70 0000 C CNN +F 1 "CJ125" H 7000 4925 70 0000 C CNN +F 2 "SOIC24" H 7100 5625 60 0001 C CNN +F 4 "bosh,cj125" V 5655 7075 60 0001 C CNN "mfg,#" +F 5 "future,8746778" V 5655 7075 60 0001 C CNN "vend,#" +F 6 "-,-" V 5655 7075 60 0001 C CNN "Field3" +F 7 "-,-" V 5655 7075 60 0001 C CNN "Field4" +F 8 "-,-" V 5655 7075 60 0001 C CNN "Field5" +F 9 "-,-" V 5655 7075 60 0001 C CNN "Field6" +F 10 "wide O2" V 5655 7075 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 5655 7075 60 0001 C CNN "Field8" + 1 7100 5625 + 1 0 0 -1 +$EndComp +Text Label 5775 5100 0 60 ~ 0 +UN-2 +Text Label 5800 5375 0 60 ~ 0 +IA-2 +Text Label 8925 5575 0 60 ~ 0 +IA-2 +Text Label 8925 5475 0 60 ~ 0 +UN-2 +$Comp +L GND #PWR0164 +U 1 1 4C09CD98 +P 8675 5175 +F 0 "#PWR0164" H 8675 5175 30 0001 C CNN +F 1 "GND" H 8675 5105 30 0001 C CNN + 1 8675 5175 + 0 -1 -1 0 +$EndComp +Text HLabel 7750 5975 2 60 Input ~ 0 +CJ125-2_SI +Text HLabel 7750 5875 2 60 Input ~ 0 +CJ125-2_SS +Text HLabel 7750 6075 2 60 Input ~ 0 +CJ125-2_SO +Text HLabel 7750 6175 2 60 Input ~ 0 +CJ125-2_SCK +$Comp +L C C1214 +U 1 1 4C09CCDE +P 8825 5975 +F 0 "C1214" H 8575 5875 50 0000 L CNN +F 1 ".033uF" H 8550 6075 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8825 5975 + 1 0 0 1 +$EndComp +$Comp +L GND #PWR0165 +U 1 1 4C09CCDD +P 8825 6225 +F 0 "#PWR0165" H 8825 6225 30 0001 C CNN +F 1 "GND" H 8825 6155 30 0001 C CNN + 1 8825 6225 + 1 0 0 -1 +$EndComp +$Comp +L R R1216 +U 1 1 4C09CB9D +P 7950 5575 +F 0 "R1216" V 8000 5800 50 0000 C CNN +F 1 "4.7k" V 7950 5575 50 0000 C CNN +F 2 "SM0805" V 8130 5675 60 0001 C CNN +F 4 "panasonic,ERA6AEB472V" V 4130 7225 60 0001 C CNN "mfg,#" +F 5 "newark,08N2175" V 4130 7225 60 0001 C CNN "vend,#" +F 6 "-,-" V 4130 7225 60 0001 C CNN "Field3" +F 7 "-,-" V 4130 7225 60 0001 C CNN "Field4" +F 8 "125,mW" V 4130 7225 60 0001 C CNN "Field5" +F 9 ".1,%" V 4130 7225 60 0001 C CNN "Field6" +F 10 "metal film" V 4130 7225 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 4130 7225 60 0001 C CNN "Field8" + 1 7950 5575 + 0 1 1 0 +$EndComp +$Comp +L R R1222 +U 1 1 4C09CB6F +P 8550 5575 +F 0 "R1222" V 8600 5850 50 0000 C CNN +F 1 "470k" V 8550 5575 50 0000 C CNN +F 2 "SM0805" V 8730 5675 60 0001 C CNN +F 4 "vishay,CRCW0805470KFKEA" V 4730 7225 60 0001 C CNN "mfg,#" +F 5 "newark,53K0283" V 4730 7225 60 0001 C CNN "vend,#" +F 6 "-,-" V 4730 7225 60 0001 C CNN "Field3" +F 7 "-,-" V 4730 7225 60 0001 C CNN "Field4" +F 8 "125,mW" V 4730 7225 60 0001 C CNN "Field5" +F 9 "1,%" V 4730 7225 60 0001 C CNN "Field6" +F 10 "thick film" V 4730 7225 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 4730 7225 60 0001 C CNN "Field8" + 1 8550 5575 + 0 1 1 0 +$EndComp +$Comp +L R R1214 +U 1 1 4C09CAFD +P 7075 6975 +F 0 "R1214" V 7175 6950 50 0000 C CNN +F 1 "82.5" V 7075 6975 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW080582R5FKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,53K0506" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 ".1%" V 1130 2600 60 0001 C CNN "tol" +F 10 "thin film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 7075 6975 + 0 1 1 0 +$EndComp +Text HLabel 5950 6375 0 60 Input ~ 0 +CJ125-2_UR +Text HLabel 4000 5775 0 60 Input ~ 0 +5v_reg +$Comp +L GND #PWR0166 +U 1 1 4C09C98A +P 5975 5475 +F 0 "#PWR0166" H 5975 5475 30 0001 C CNN +F 1 "GND" H 5975 5405 30 0001 C CNN + 1 5975 5475 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0167 +U 1 1 4C09C8AC +P 6000 6825 +F 0 "#PWR0167" H 6000 6825 30 0001 C CNN +F 1 "GND" H 6000 6755 30 0001 C CNN + 1 6000 6825 + 1 0 0 -1 +$EndComp +$Comp +L GND #PWR0168 +U 1 1 4C09C872 +P 4950 6225 +F 0 "#PWR0168" H 4950 6225 30 0001 C CNN +F 1 "GND" H 4950 6155 30 0001 C CNN + 1 4950 6225 + 1 0 0 -1 +$EndComp +$Comp +L R R1204 +U 1 1 4C09C82A +P 6150 5975 +F 0 "R1204" V 6200 6275 50 0000 C CNN +F 1 "27k" V 6150 5975 50 0000 C CNN +F 2 "SM0805" V 6330 6075 60 0001 C CNN +F 4 "vishay,CRCW080527K0FKEA" V 2330 7625 60 0001 C CNN "mfg,#" +F 5 "newark,53K0071" V 2330 7625 60 0001 C CNN "vend,#" +F 6 "-,-" V 2330 7625 60 0001 C CNN "Field3" +F 7 "-,-" V 2330 7625 60 0001 C CNN "Field4" +F 8 "125,mW" V 2330 7625 60 0001 C CNN "Field5" +F 9 "1,%" V 2330 7625 60 0001 C CNN "Field6" +F 10 "thick film" V 2330 7625 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2330 7625 60 0001 C CNN "Field8" + 1 6150 5975 + 0 1 1 0 +$EndComp +$Comp +L C C1206 +U 1 1 4C09C829 +P 6100 6125 +F 0 "C1206" V 6000 5950 50 0000 L CNN +F 1 "0.1uF" V 6000 6300 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "AVX,08055C104KAT2A" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,27C8438" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200V" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "CERAMIC" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6100 6125 + 0 -1 -1 0 +$EndComp +$Comp +L R R1202 +U 1 1 4C09C812 +P 4500 5775 +F 0 "R1202" V 4600 5775 50 0000 C CNN +F 1 "10k" V 4500 5775 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "BOURNS,CR0805-FX-1002ELF" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,02J2368" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "w" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 4500 5775 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0169 +U 1 1 4C09C7B0 +P 6400 4725 +F 0 "#PWR0169" H 6400 4725 30 0001 C CNN +F 1 "GND" H 6400 4655 30 0001 C CNN + 1 6400 4725 + -1 0 0 1 +$EndComp +$Comp +L C C1208 +U 1 1 4C09C77F +P 6400 4975 +F 0 "C1208" H 6150 5050 50 0000 L CNN +F 1 "220pf" H 6150 4875 50 0000 L CNN +F 2 "SM0805" V 3480 6075 60 0001 C CNN +F 4 "avx,08051A221JAT2A" V 3480 6075 60 0001 C CNN "mfg,#" +F 5 "newark,96K4770" V 3480 6075 60 0001 C CNN "vend,#" +F 6 "-,-" V 3480 6075 60 0001 C CNN "Field3" +F 7 "-,-" V 3480 6075 60 0001 C CNN "Field4" +F 8 "100,V" V 3480 6075 60 0001 C CNN "Field5" +F 9 "5,%" V 3480 6075 60 0001 C CNN "Field6" +F 10 "Ceramic" V 3480 6075 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 3480 6075 60 0001 C CNN "Field8" + 1 6400 4975 + 1 0 0 1 +$EndComp +$Comp +L R R1210 +U 1 1 4C09C74A +P 6250 5675 +F 0 "R1210" V 6300 5975 50 0000 C CNN +F 1 "6.8k" V 6250 5675 50 0000 C CNN +F 2 "SM0805" V 6430 5775 60 0001 C CNN +F 4 "vishay,CRCW08056K80FKEA" V 2430 7325 60 0001 C CNN "mfg,#" +F 5 "newark,53K0372" V 2430 7325 60 0001 C CNN "vend,#" +F 6 "-,-" V 2430 7325 60 0001 C CNN "Field3" +F 7 "-,-" V 2430 7325 60 0001 C CNN "Field4" +F 8 "125,mW" V 2430 7325 60 0001 C CNN "Field5" +F 9 "1,%" V 2430 7325 60 0001 C CNN "Field6" +F 10 "thick film" V 2430 7325 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2430 7325 60 0001 C CNN "Field8" + 1 6250 5675 + 0 1 1 0 +$EndComp +$Comp +L C C1202 +U 1 1 4C09C749 +P 4950 5975 +F 0 "C1202" H 4950 6100 50 0000 L CNN +F 1 "1000pF" H 4650 5875 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "avx,08052C102KAT2A " V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "mouser,581-08052C102K" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200v" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "tol" +F 10 "x7r" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 4950 5975 + 1 0 0 -1 +$EndComp +$Comp +L R R1218 +U 1 1 4BF6543D +P 8000 5175 +F 0 "R1218" V 7900 5150 50 0000 C CNN +F 1 "100k" V 8000 5175 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW0805100KFKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,52K9808" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8000 5175 + 0 1 1 0 +$EndComp +$Comp +L GND #PWR0170 +U 1 1 4BF65418 +P 9775 5900 +F 0 "#PWR0170" H 9775 5900 30 0001 C CNN +F 1 "GND" H 9775 5830 30 0001 C CNN + 1 9775 5900 + 1 0 0 -1 +$EndComp +$Comp +L C C1204 +U 1 1 4E467E06 +P 6000 6575 +F 0 "C1204" H 6100 6475 50 0000 L CNN +F 1 ".033uF" H 5725 6475 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6000 6575 + 1 0 0 -1 +$EndComp +$Comp +L R R1209 +U 1 1 4E467E05 +P 6250 5475 +F 0 "R1209" V 6300 5175 50 0000 C CNN +F 1 "10k" V 6250 5475 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "BOURNS,CR0805-FX-1002ELF" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,02J2368" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "w" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6250 5475 + 0 -1 1 0 +$EndComp +$Comp +L R R1208 +U 1 1 4BF6512C +P 6250 5275 +F 0 "R1208" V 6200 5575 50 0000 C CNN +F 1 "61.9" V 6250 5275 50 0000 C CNN +F 2 "SM0805" V 6430 5375 60 0001 C CNN +F 4 "vishay,CRCW080561R9FKEA" V 2430 6925 60 0001 C CNN "mfg,#" +F 5 "newark,53K0407" V 2430 6925 60 0001 C CNN "vend,#" +F 6 "-,-" V 2430 6925 60 0001 C CNN "Field3" +F 7 "-,-" V 2430 6925 60 0001 C CNN "Field4" +F 8 "125,mW" V 2430 6925 60 0001 C CNN "Field5" +F 9 "1,%" V 2430 6925 60 0001 C CNN "Field6" +F 10 "thick film" V 2430 6925 60 0001 C CNN "Field7" +F 11 "other,more,stuff" V 2430 6925 60 0001 C CNN "Field8" + 1 6250 5275 + 0 1 -1 0 +$EndComp +$Comp +L GND #PWR0171 +U 1 1 4BF650D1 +P 7650 4725 +F 0 "#PWR0171" H 7650 4725 30 0001 C CNN +F 1 "GND" H 7650 4655 30 0001 C CNN + 1 7650 4725 + -1 0 0 1 +$EndComp +$Comp +L R R1212 +U 1 1 4E467E02 +P 6300 6375 +F 0 "R1212" V 6400 6375 50 0000 C CNN +F 1 "1k" V 6300 6375 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW08051K00FKTA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,05F1507" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "THICK FILM" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 6300 6375 + 0 1 1 0 +$EndComp +Text HLabel 6700 4775 1 60 Input ~ 0 +BATV +$Comp +L C C1210 +U 1 1 4E467E00 +P 7100 4775 +F 0 "C1210" V 7025 4975 50 0000 L CNN +F 1 ".033uF" V 7025 4575 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "yageo,CC0805KRX7R8BB333" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,69C9599" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "25V" V 1130 2600 60 0001 C CNN "V" +F 7 "10%" V 1130 2600 60 0001 C CNN "tolerance" +F 8 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 9 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 7100 4775 + 0 1 -1 0 +$EndComp +$Comp +L C C1216 +U 1 1 4E467DFD +P 9775 5650 +F 0 "C1216" H 9850 5750 50 0000 L CNN +F 1 "0.01uF" H 9500 5750 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "avx,08055C103JAT2A " V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,96M1408" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "50v" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "tol" +F 10 "ceramic" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 9775 5650 + 1 0 0 1 +$EndComp +$Comp +L R R1221 +U 1 1 4E467DFB +P 8550 5475 +F 0 "R1221" V 8500 5200 50 0000 C CNN +F 1 "100k" V 8550 5475 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW0805100KFKEA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,52K9808" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "tolerance" +F 10 "thick film" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8550 5475 + 0 1 1 0 +$EndComp +$Comp +L R R1224 +U 1 1 4E467DFA +P 9450 5375 +F 0 "R1224" V 9350 5375 50 0000 C CNN +F 1 "1k" V 9450 5375 50 0000 C CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "vishay,CRCW08051K00FKTA" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,05F1507" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "125mW" V 1130 2600 60 0001 C CNN "W" +F 9 "1%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "THICK FILM" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 9450 5375 + 0 1 -1 0 +$EndComp +Text HLabel 9825 5375 2 60 Input ~ 0 +CJ125-2_UA +$Comp +L C C1212 +U 1 1 4BF34838 +P 8375 5275 +F 0 "C1212" V 8400 5450 50 0000 L CNN +F 1 "0.1uF" V 8400 5125 50 0000 L CNN +F 2 "SM0805" V 1130 2600 60 0001 C CNN +F 4 "AVX,08055C104KAT2A" V 1130 2600 60 0001 C CNN "mfg,mfg#" +F 5 "newark,27C8438" V 1130 2600 60 0001 C CNN "vend1,vend1#" +F 6 "" V 1130 2600 60 0001 C CNN "Field6" +F 7 "" V 1130 2600 60 0001 C CNN "Field7" +F 8 "200V" V 1130 2600 60 0001 C CNN "V" +F 9 "10%" V 1130 2600 60 0001 C CNN "TOL" +F 10 "CERAMIC" V 1130 2600 60 0001 C CNN "construct" +F 11 "other,more,stuff" V 1130 2600 60 0001 C CNN "misc" + 1 8375 5275 + 0 1 1 0 +$EndComp +$EndSCHEMATC diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index 5e5fa0b6e0..d39562ae27 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -201,91 +201,6 @@ void testMazda323(void) { assertEquals(0, eth.engine.triggerShape.getTriggerShapeSynchPointIndex()); } -void testMazdaMianaNbDecoder(void) { - printf("*************************************************** testMazdaMianaNbDecoder\r\n"); - - EngineTestHelper eth(MAZDA_MIATA_NB); - EXPAND_EngineTestHelper; - - engine_configuration_s *ec = eth.ec; - TriggerShape * shape = ð.engine.triggerShape; - assertEquals(12, shape->getTriggerShapeSynchPointIndex()); - - TriggerState state; - - int a = 0; - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 20 PASS_ENGINE_PARAMETER); - assertFalseM("0a shaft_is_synchronized", state.shaft_is_synchronized); - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 340 PASS_ENGINE_PARAMETER); - assertFalseM("0b shaft_is_synchronized", state.shaft_is_synchronized); - - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 360 PASS_ENGINE_PARAMETER); - assertFalseM("0c shaft_is_synchronized", state.shaft_is_synchronized); - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 380 PASS_ENGINE_PARAMETER); - assertFalseM("0d shaft_is_synchronized", state.shaft_is_synchronized); - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 400 PASS_ENGINE_PARAMETER); - assertTrueM("0e shaft_is_synchronized", state.shaft_is_synchronized); - - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 720 PASS_ENGINE_PARAMETER); - assertTrueM("0f shaft_is_synchronized", state.shaft_is_synchronized); - - a = 720; - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 20 PASS_ENGINE_PARAMETER); - assertTrueM("1a shaft_is_synchronized", state.shaft_is_synchronized); - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 340 PASS_ENGINE_PARAMETER); - assertTrueM("1b shaft_is_synchronized", state.shaft_is_synchronized); - - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 360 PASS_ENGINE_PARAMETER); - assertTrueM("1c shaft_is_synchronized", state.shaft_is_synchronized); - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 380 PASS_ENGINE_PARAMETER); - assertTrueM("1d shaft_is_synchronized", state.shaft_is_synchronized); - assertEquals(5, state.getCurrentIndex()); - - state.decodeTriggerEvent(SHAFT_PRIMARY_DOWN, a + 400 PASS_ENGINE_PARAMETER); - assertTrueM("1e shaft_is_synchronized", state.shaft_is_synchronized); - assertEquals(0, state.getCurrentIndex()); - - state.decodeTriggerEvent(SHAFT_PRIMARY_UP, a + 720 PASS_ENGINE_PARAMETER); - assertTrueM("1f shaft_is_synchronized", state.shaft_is_synchronized); - - event_trigger_position_s position; - assertEqualsM("globalTriggerAngleOffset", 276, ec->globalTriggerAngleOffset); - findTriggerPosition(&position, 0 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 7, 0); - - findTriggerPosition(&position, 180 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 13, 0); - - findTriggerPosition(&position, 360 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 17, 0.0); - - findTriggerPosition(&position, 444 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 0); - - findTriggerPosition(&position, 444.1 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 0.1); - - findTriggerPosition(&position, 445 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 1); - - findTriggerPosition(&position, 494 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 2, 20); - - findTriggerPosition(&position, 719 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 6, 65); - - ec->globalTriggerAngleOffset = 0; - findTriggerPosition(&position, 0 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 0); - - ec->globalTriggerAngleOffset = 10; - findTriggerPosition(&position, 0 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 10); - - findTriggerPosition(&position, -10 PASS_ENGINE_PARAMETER); - assertTriggerPosition(&position, 0, 0); -} - static void testTriggerDecoder2(const char *msg, engine_type_e type, int synchPointIndex, float channel1duty, float channel2duty) { printf("*************************************************** %s\r\n", msg); @@ -358,7 +273,6 @@ static void assertREquals(void *expected, void *actual) { assertEquals((float)(uint64_t)expected, (float)(uint64_t)actual); } -extern engine_pins_s enginePins; extern bool_t debugSignalExecutor; static void testRpmCalculator(void) { @@ -518,7 +432,7 @@ void testTriggerDecoder(void) { testTriggerDecoder2("bmw", BMW_E34, 0, 0.4667, 0.0); test1995FordInline6TriggerDecoder(); - testMazdaMianaNbDecoder(); + testTriggerDecoder2("Miata NB", MAZDA_MIATA_NB, 12, 0.0833, 0.0444); testTriggerDecoder2("test engine", TEST_ENGINE, 0, 0.0, 0.0); testTriggerDecoder2("testGY6_139QMB", GY6_139QMB, 0, 0.4375, 0.0);