Dear Josh: Thank you very much for your reply. The similar code will trigger an 'overflow' bit when using other chips, such as PIC16F874. However, in PIC12F509, there is no such overflow bit. Therefore I am not able to detect when the counter get the number I pre-defined. I am very new to microchip. Hope you understand and really appreciate if you could give me more hint on it. Thanks. Delly Josh Koffman wrote: On 2/24/06, delly sunny wrote: > I would like to design a 1ms delay using timer interrupt. I have selected PIC12F508/509. However, my codes are not working. could anyone help me to point out my mistake? thank you very much! Define not working. Is the interval wrong? Are you never getting the interrupt? What is happening? Josh -- A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. -Douglas Adams -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --------------------------------- Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist