Hi Nicholas, Try this link http://www.romanblack.com/one_sec.htm The code can be easily adapted for any time delay. Zero average error. Clever stuff. Have used it lots. From Roman Black, a very missed past contributer on this list. Rgs Ian. > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Nicholas > Sent: Monday, 8 March 2004 12:23 am > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]:How to write timer function for PIC18F452? > > > I have written my main program with PIC-C already. Are we > able to write ASM > code in C source code? Can they be complier togather as .c file? > I don't have any idea how to start writng the timer sub routine. > > > ----- Original Message ----- > From: "Jan-Erik Soderholm" > To: > Sent: Sunday, March 07, 2004 11:58 AM > Subject: Re: [PIC]:How to write timer function for PIC18F452? > > > > Nicholas wrote : > > > > > Is it called timer sub-routine in C language? It is a > > > sub-routine in the C-lauguage. I don't know how to > > > write in C language. > > > > What about "Chapter 5. Sample Application" in the > > "MPLAB. C18 C COMPILER USER S GUIDE" ?? > > > > And have you thought of just writing a short ASM > > code to do this ? > > > > Jan-Erik. > > > > -- > > 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: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads