diff --git a/extras/Timings/NEC_timings.svg b/extras/Timings/NEC_timings.svg index 99d4d6f..e9dc323 100644 --- a/extras/Timings/NEC_timings.svg +++ b/extras/Timings/NEC_timings.svg @@ -1 +1 @@ -M1M0 maxM0M1 minM1min > 3/4 M1 M1min > 75% of M1Lets use 70% of M1 for a 30% toleranceM0max < 3/2 M0 M0max < 150% of M0Lets use 130% of M0 for a 30% toleranceM1max and M0min are not constrained byother values, (as well as LMmax and RMmin)lets set all of them with a tolerance of 30%.Bit Mark 0:M0max = 1.3 M0M0min = 0.7 M0(M0 = 1125 µs)Repetition Mark:RMmin = 0.7 RMRMmax = RM + Rt(RM = 2812.5 µs)(Rt = 803.6 µs) Gap:GapMin = 0.7 Gap1GapMax = 1.3 Gap2(Gap1 = 48937.5 µs)(Gap2 = 105187.5 µs)Note:The OnRise mode was too ristrictive withthe leading/repeating marks tolerances.With Rt at 11% of RM, Lt could not be higher than 8.33% of LM. Now both Rt and LT are at 28.6%Leading Mark:LMmax = 1.3 LMLMmin = RMmax + 1 (LM = 5062.5 µs)If both marks have the same tolerance percentage,then: Lt / LM = Rt / RM Lt × RM = Rt × LMand because RM+Rt+Lt=LM Rt = LM-RM-Lt Substituting into the previous equation we get:Lt × RM = (LM-RM-Lt) × LMand after solving for Lt:Lt=(LM² - LM × RM) / (RM+LM)Knowing that: Rt+Lt=2.25LM=5.0625 and RM=2.8125 we get:Lt = 1.4464 and Rt = 0.8036(Lt is 28.6% of LM and Rt is 28.6% of RM)Bit Mark 1:M1min = 0.7 M1M1max = 1.3 M1(M1 = 2250 µs)0LSBMSBMSBMSBAddress~AddressLSBCommand~CommandLSBMSBLSB00000000000000011111111111111119msx16x24x8562.5µs4.5msLeading Mark (13.5ms)x (8x2 + 8x4)Address frame (27ms)x (8x2 + 8x4)Command frame (27ms)x 120Signal frame (67.5ms)End(0.56ms)67.5msSignal frame108msRepetition period108msRepetition period40.5msGap1108 - 11.25 = 96.75msGap211.25msRepetition markRepetitionmarkx21.125msx42.250ms9msBit Marks tolerancesNEC ProtocolTolerances summaryRepetition Mark lenghtLeading Mark & Repetition Marks tolerancesx16x5562.5µsRepetition Mark(2.8125ms)Start Pulse before RMStart Pulse before LMLMRM maxRtLtLM mimRM9msx16x9562.5µsLeading Mark (5.0625ms)x (8x2 + 8x4)Address frame (27ms)x (8x2 + 8x4)Command frame (27ms)x 105Signal frame (59.0625ms)59.0625msSignal frame108msRepetition period108msRepetition period48.9375msGap1108 - 2.8125 = 105.1875msGap2Repetition mark1.125ms2.250msOnFall Mode2.25ms \ No newline at end of file +M1M0 maxM0tM1tM0M1 minBit Mark 0:M0max = 1.3 M0M0min = 0.7 M0(M0 = 1125 µs)Repetition Mark:RMmin = 0.7 RMRMmax = RM + Rt(RM = 2812.5 µs)(Rt = 803.6 µs) Gap:GapMin = 0.7 Gap1GapMax = 1.3 Gap2(Gap1 = 48937.5 µs)(Gap2 = 105187.5 µs)Note:The OnRise mode was too ristrictive withthe leading/repeating marks tolerances.With Rt at 11% of RM, Lt could not be higher than 8.33% of LM. Now both Rt and Lt are at 28.6%Leading Mark:LMmax = 1.3 LMLMmin = RMmax + 1 (LM = 5062.5 µs)If both marks have the same tolerance percentage,then: Lt / LM = Rt / RM Lt × RM = Rt × LMand because RM+Rt+Lt = LM Rt = LM-RM-Lt By substituting into the previous equation we get:Lt × RM = (LM - RM - Lt) × LMand after solving for Lt:Lt = (LM² - LM × RM) / (RM+LM)And knowing that: Rt + Lt = 2.25LM = 5.0625 and RM = 2.8125 we get:Lt = 1.4464 and Rt = 0.8036(Lt is 28.6% of LM and Rt is 28.6% of RM)As in the leading marks, if both bit marks have the same tolerance percentage, then:M1t = (M1² - M1 × M0) / (M0 + M1)And knowing that: M0t + M1t = 1.125M1 = 2.250 and M0 = 1.125 we get:M1t = 0.75 and M0t = 0.375(M1t is 33.33% of M1 and M0t is 33.33% of M0)The maximum tolerance for the bit marks is then 33.33%, but let's only use 30%.M1max and M0min are not constrained byother values, (as well as LMmax and RMmin)so lets set all of them with a tolerance of 30%.Bit Mark 1:M1min = 0.7 M1M1max = 1.3 M1(M1 = 2250 µs)0LSBMSBMSBMSBAddress~AddressLSBCommand~CommandLSBMSBLSB00000000000000011111111111111119msx16x24x8562.5µs4.5msLeading Mark (13.5ms)x (8x2 + 8x4)Address frame (27ms)x (8x2 + 8x4)Command frame (27ms)x 120Signal frame (67.5ms)End(0.56ms)67.5msSignal frame108msRepetition period108msRepetition period40.5msGap1108 - 11.25 = 96.75msGap211.25msRepetition markRepetitionmarkx21.125msx42.250ms9msBit Marks tolerancesNEC ProtocolTolerances summaryRepetition Mark lenghtLeading Mark & Repetition Marks tolerancesx16x5562.5µsRepetition Mark(2.8125ms)Start Pulse before RMStart Pulse before LMLMRM maxRtLtLM mimRM9msx16x9562.5µsLeading Mark (5.0625ms)x (8x2 + 8x4)Address frame (27ms)x (8x2 + 8x4)Command frame (27ms)x 105Signal frame (59.0625ms)59.0625msSignal frame108msRepetition period108msRepetition period48.9375msGap1108 - 2.8125 = 105.1875msGap2Repetition mark1.125ms2.250msOnFall Mode2.25ms1.125ms \ No newline at end of file