At 10:55 PM 5/3/2005 -0700, you wrote: >Denny & Byron, > >Thanks very much for the response. I understand that I am probably >setting myself up with a handicap by using the 12f675, but that is >what I have so I'm trying it out first. Okay, by going for one interrupt per cycle, I think it can be made to work. isr:movwf w_temp ; save context swapf STATUS,W bcf STATUS,RP0 bsf GPIO,0 ; bring pin high movwf status_temp incf counter,F ; used by background program for timing bcf INTCON,2 ; clear timer interrupt flag nop nop nop nop nop nop movlw .250 bsf GPIO,0 ; bring pin low movwf TMR0 swapf status_temp,W ; restore context movwf STATUS swapf w_temp,F swapf w_temp,W retfie In simulation, it gives about 37.7kHz at 44% or so duty cycle with a 4MHz clock. (remember to 'calibrate' the internal oscillator in your code) The background routine runs like a 60kHz or so PIC, so very slow, but not insane. If you eliminate some of the nops above you'll get faster background operation but less duty cycle. If you're driving the LED directly you might want to swap bsf and bcf and sink current, because the PIC is better at sinking current. The 'counter' byte rolls over every 6.78ms or so, and can be used to control your slower timing in the background routine. You would detect the rollover by looking at the msb of counter. That would allow several hundred instructions to execute in each background loop before you'd miss a rollover. A single byte in the background routine could time up to 1.7 seconds or so. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist