Hi,
I want to use Timer1 interrupt for every 1 msec.But if we seclect Interrupt component in
that after selecting timer1 interupt and changing in proerties i am not able to get exactly for 1 msec.
Can you please provide how i need to configure register.
Thanks & Regards
Keshav
Information Needed on Timer1
-
- Posts: 18
- Joined: Fri Feb 26, 2010 5:05 am
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Information Needed on Timer1
Hello
You can get different interrupt rates by using the calulator available from here.
http://users.picbasic.org/projects/PicT ... merCal.htm
By changing the timer offset value and the prescaler you should be able to get a whole number or at least a low percentage of error.
The timer offset value will need to be written to the interrupt count registers at the start of your service routine to allow the updated timeout period to be set.
Using a C code icon the code would look similar to this.
tmr1l = 0x12;
tmr1h = 0x01;
You can get different interrupt rates by using the calulator available from here.
http://users.picbasic.org/projects/PicT ... merCal.htm
By changing the timer offset value and the prescaler you should be able to get a whole number or at least a low percentage of error.
The timer offset value will need to be written to the interrupt count registers at the start of your service routine to allow the updated timeout period to be set.
Using a C code icon the code would look similar to this.
tmr1l = 0x12;
tmr1h = 0x01;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel