Цитата(Smen @ Oct 29 2015, 09:58)

Дык, п. 6.4 даташита.
Подозреваю, что проблема именно в атомарности операции.
В более современных чипах (например 887) эта проблема решена аппаратно, а в старых приходилось изгаляться.
P.S.: Кстати, насколько помню, рекомендовалось таймер, при этом, вообще выключать (в примере этого нет).
не понял, п 6.4 посвещён внешнему счёту вроде как
------------------
6.4 Timer1 Operation in
Asynchronous Counter Mode
If control bit T1SYNC (T1CON<2>) is set, the external
clock input is not synchronized. The timer continues to
increment asynchronous to the internal phase clocks.
The timer will continue to run during SLEEP and can
generate an interrupt on overflow, which will wake-up
the processor. However, special precautions in software
are needed to read/write the timer (Section 6.4.1).
In Asynchronous Counter mode, Timer1 cannot be
used as a time-base for capture or compare operations
-----------------------
тут же таймер используется с внутренней osc/4 и предделителем :8
T1CON инициализирован "00110101", согласно страницей даташита выше, бит 2 ( синхронизация внешней частоты ) игнорируется, если бит 1 = 0 (использование внутренней частоты )
-------------------
bit 7-6 Unimplemented: Read as ‘0’
bit 5-4 T1CKPS1:T1CKPS0: Timer1 Input Clock Prescale Select bits
11 = 1:8 Prescale value
10 = 1:4 Prescale value
01 = 1:2 Prescale value
00 = 1:1 Prescale value
bit 3 T1OSCEN: Timer1 Oscillator Enable Control bit
1 = Oscillator is enabled
0 = Oscillator is shut-off (the oscillator inverter is turned off to eliminate power drain)
bit 2 T1SYNC: Timer1 External Clock Input Synchronization Control bit
TMR1CS = 1:
1 = Do not synchronize external clock input
0 = Synchronize external clock input
TMR1CS = 0:
This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0.
bit 1 TMR1CS: Timer1 Clock Source Select bit
1 = External clock from pin RC0/T1OSO/T1CKI (on the rising edge)
0 = Internal clock (FOSC/4)
bit 0 TMR1ON: Timer1 On bit
1 = Enables Timer1
0 = Stops Timer1
----------------------
да даже и в этом случае, ну пусть сбои счёта происходили какие то, но не двойное же выполнение прерывания
зы: пока играюсь дальше с прошивкой, вроде вырисовывается зависимость, но опять же дурацкая какая то
Сообщение отредактировал ddd-ekb - Oct 29 2015, 06:05