You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(there will be 7 DCC timer1 ticks in which to do this.)
81
85
82
86
*/
83
-
constint Tcs=28; // (26+32)/2 would be half way spec Desired time from idealised setup call (at previous DCC timer interrupt) to the cutout but choose even
84
-
constint cutoutDuration = 450; // As chosen by most
85
-
const byte delayBeforeCutout=58+58+Tcs; // Expected time from idealised setup call (at previous DCC timer interrupt) to the cutout. This is the time we need to wait before we can set pin 9 high. We will then set pin 9 low at the next tick which is cutoutDuration later. This value should be reduced to reflect the Timer1 value measuring the time since the previous hardware interrupt.
87
+
constint Tcs=28; // NMRA spec is 26..32
88
+
constint cutoutDuration_uS = 450; // As chosen by most
89
+
constuint16_t delayBeforeCutout_uS=58+58+58+Tcs;
90
+
constuint16_t timer1_ticks_per_uS = 8;
91
+
constuint16_t timer2_uS_per_tick = 2;
86
92
87
93
// Set Timer2 to CTC mode with set on compare match
0 commit comments