I want to make a clock by using Timer1. I made all the other code exept that I don't know how to use Timer1. Is there some simple explanation how to use Timer1, i.e. what registers bits I have to set and how to count a second, and after that count of second how to cause interrupt.
@birdman0_o :What chip and what language, I have code for the 16f628a in asm using four 7 segment displays
The PIC is 16f877 , I use MPLAB 8,40 and write code in assembly. I already done all hardware work and made code that use WDT but is terribly inaccurate. So I am suggested to use Timer1 whitch I newer used before. So I ask for advice.
Thank you. I made it.
Now I have to make it tick accurately every second. It is now that ticks about 1.1 second or so. What do I do?
I have quartz 4MHz.
Have a read of the "special event trigger" in the datasheet. It explains how it works. If it's still not clear then ask a specific question. Or, you could just use it.
They just return the low or high byte of the (16bit) expression. In this case the expression is 1 million (the instructions per second) divided by 100 to get a 10mS time period. You could do the maths yourself and get 10,000, then convert to hex, 0x2710 and split it into the two numbers, 0x27 and 0x10. I prefer to let the assembler do the maths for me.