> Also after some thinking about it the fixed pulses aren't what I need By that I guess you mean it's not necessary to have the timing external ? I'll back-track a little and say that a pot-controlled 555 feeding pulses into INT0 would be OK for an off-PIC speed control, but you could get just the same effect with a pot on an ADC pin > I have gone through your math and I think I understand it. After reading > the data sheet, it would appear that when I start the timer, I need to > write '2' into the timer as it won't increment for 2 cycles after being > set. In your application I wouldn't worry about it Divide the crystal frequency by 4 to get the instruction cycle frequency. In your case, 20MHz crystal => 5MHz => 200ns per instruction Divide that by 256 to find out how long it takes TMR0 to roll over (optionally apply a pre-scaler to slow the rollover rate) The interrupt is generated as the timer rolls over from FF to 00. With the interrupt rate based solely on the timer free-running there's no need to re-load. It will simply keep counting 00 to FF and around again over and over. Choice of crystal (decimal or hex) determines the base rate You could go right down to a 32.768kHz crystal and still generate enough IRQs / sec for your needs. This would also use less battery power, but compared to the solenoid is probably insignificant > Is there anything bad going to happen when I switch interrupts on and > off, and switch the edge for my interrupt/RB0 (I'd like to determine > when the trigger is released) Nothing bad should happen, if you can ascertain what state the program and registers is going to be in at all times. ie cover all the bases, idiot- proofing etc. This means keeping track of where s/w flow is at, clearing IRQ flags, having no loose ends and so on. You don't need to switch IRQs on and off. What you can do is act/not act on them. For example, TMR0 is running all the time in the background, but if you don't need solenoid drive at a particular time (ie the trigger's not pressed), just ignore it ********** Don't forget - you're in charge !! *********** > I know there are some things that can cause a device reset... See my other post about Vcc noise -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics