Timer Problem

General discussion on mikroC.
Post Reply
Author
Message
Pesticida
Posts: 88
Joined: 26 Sep 2008 08:02

Timer Problem

#1 Post by Pesticida » 13 Sep 2010 17:37

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!

User avatar
ranko.rankovic
Posts: 433
Joined: 11 Jun 2010 09:22

Re: Timer Problem

#2 Post by ranko.rankovic » 14 Sep 2010 11:13

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
Ranko Rankovic
mikroElektronika [Support Department]

Post Reply

Return to “mikroC General”