Hello!
In my system I am work with Input Capture. After reset Interrupt input capture not work. But on next time all work is correctly.
Help me, please.
Timer.tc[1].word = 0xFFFF;
Timer.tc[2].word = 0xFFFA;
Timer.tcnt.word = 0;
Timer.tios.byte = 0xFE;
Timer.tscr2.byte = 0x82;
Timer.tscr1.byte |= TEN;
Timer.tctl4.byte |= EDG0A;
Timer.ocpdstr.byte = 0xFE;
Timer.tie.byte = 0x05;
It's setting timer on start command...
Solved! Go to Solution.
S12XE has to timers, TIM and ECT. Are you sure your Timer struct belongs to ECT and not to TIM? It this is OK, then you should explain why do you think it works only 2nd time. Certainly your code is not enough to proove it. Also, what is your bus clock and how narrow is your external pulse and; voltage or MCU power supply and what is amplitude of your pulse.
S12XE has to timers, TIM and ECT. Are you sure your Timer struct belongs to ECT and not to TIM? It this is OK, then you should explain why do you think it works only 2nd time. Certainly your code is not enough to proove it. Also, what is your bus clock and how narrow is your external pulse and; voltage or MCU power supply and what is amplitude of your pulse.
Voltage - 4,97 V
Amplitude impulse - 0 - 5 V
Bus clock - 32 000 000 Hz
This system read pulse data from IR key.
Each team is always initialize the timer and at the end
it turns off and resets. I am put breakpoint on input capture and start. If not work input capture on long time - timer owerflow and work interrupt overflow... After first command, next all commands work input capture and all system work correctly.
THX.
Sorry, all work! I am not disable pin IR LED ! After first step I am down this pin and all time after it input capture work!
THX!