do you mean this ? /Here is how the code fragments above fit together:/ /;***************************************************/ /*********************/ /; */ /; Description: Lesson 6 example 1c */ /; */ /; Demonstr/ /ates use of Timer0 interrupt to perform a background task */ /; */ /; Flash an LED at exactly 1 Hz (50% duty cycle). */ /; / /*/ /;************************************************************************/ /; */ /; Pin assignments: */ /; / /GP2 =3D flashing LED */ /; */ /;************************************************************************/ On 1/07/2013 8:25 PM, David Meiklejohn wrote: > Electronic Consultation wrote: >> 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 .