-----Original Message----- From: Larry Bradley [mailto:lhbradley@IGS.NET] Sent: Wednesday, 23 April 2003 5:30 AM To: PICLIST@MITVMA.MIT.EDU Subject: CCP compare function I'm trying to use the CCP module on a 628 to generate 10ms interrupts. = I've done this before using timer1, preloading it with a value then reloading = in the interrupt routine. It works, but I thought I would try it with the = CCP module, since it isn't necessary to keep reloading the timer in the interrupt routine. Using a 20 mHz xtal, setting the CCP registers to 50,000 should generate = an interrupt every 10 msec. I use the interrupt to accumulate hours, mins = and seconds for a time-of-day clocks. When I compare the time from the PIC with the time from my GPS, over about 14 hours, my time is about 7 = seconds too fast. Changing the CCP value to 50007 makes the clock track the GPS time just fine. The xtal is a nominal 25 ppm device - this could account for 1 or 2 = counts in 50000, but not 7, I wouldn't think Has anyone else played with timer1 and the CCP in this fashion? Larry Bradley Orleans (Ottawa), Ontario, CANADA -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics