Page 1 of 1

Timer Problem

Posted: 13 Sep 2010 17:37
by Pesticida
Hello,

I'm using a 18F452 with 20 Mhz,IConfigure The Timer 1 as follow:

Code: Select all

// Timer1 Registers: 
// Prescaler=1:2; TMR1 Preset=65511; Freq=100.000,00Hz; Period=10,00 µs
T1CON.T1CKPS1 = 0;// bits 5-4  Prescaler Rate Select bits
T1CON.T1CKPS0 = 1
T1CON.T1OSCEN = 1;// bit 3 Timer1 Oscillator Enable Control: bit 1=on
T1CON.T1SYNC  = 1;// bit 2 Timer1 External Clock Input Synchronization Control bit: 1=Do not synchronize external clock input
T1CON.TMR1CS  = 0;// bit 1 Timer1 Clock Source Select bit: 0=Internal clock (FOSC/4) / 1 = External clock from pin T1CKI (on the rising edge)
T1CON.TMR1ON  = 1;// bit 0 enables timer
TMR1H = 0xFF;     // preset for timer1 MSB register
TMR1L = 0xE7;     // preset for timer1 LSB register
The Timer is Working,but is blocking all te other things why?

What I do Wrong?


Thanks fpr any Help


Regards Pesti

Edited by Administrator: Added Code Tag!

Re: Timer Problem

Posted: 14 Sep 2010 11:13
by ranko.rankovic
Hello Pesticida,

Can you please attach whole project in zip or rar archive to this thread. This part of code doesn't tell us some other things that are needed for solving this problem.
But I suggest that you have turned on timer overflow interrupt, which is causing your MCU to not function as you wish.

Best regards