Electronic Consultation wrote: >=20 > What I'm trying to do is creating 1s interrupt on the background with > Timer0, I have set Timer0 to B2 and I need a counter for it. > It's state machine turn on and turn off LED in one second, but the "one > second" comes from Timer0 interrupt, Do you get what I mean ? Again, take a look at my tutorials at http://www.gooligum.com.au/tut_midrange.html, especially lesson 6 which includes the exact example you're looking for: flashing an LED at 1 Hz, using a Timer0 interrupt. That code is for a 4 MHz processor clock while you want 20 MHz, but the principle is the same and modifying my code to work at 20 MHz would be a good exercise to ensure that you understand it. Regards, David Meiklejohn www.gooligum.com.au --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .