At 03:41 PM 8/14/01 +1200, you wrote: >I can see that the code is trying to set the timer to a negative value, but >don't understand why? Could anyone give me any pointers here. Probably a problem with the delay routine. Can you declare something as "unsigned" to get the range you need? ISTR that there are problems with the supplied delay routines for some clock frequencies (but I think for >4MHz). >Secondly, the iserial.c file contains an interrupt routine. This is pretty >much my first time dealing with interrupts, but from reading the hi-tech >picc lite manual I see that you can only have one ISR on the 16F84. This >leads me to the question, what happens if you are expecting interrupts from >multiple sources eg. timer, pins, etc... Is it best to just build one huge >ISR and use a switch statement (or something similar) to execute the >appropriate part depending on what caused the interrupt? Just poll the expected flags in the ISR.. interrupt void isr(void) { if (INT_FLAG1) { ... INT_FLAG =0; // reset the interrupt flag for this source } if (INT_FLAG2) {.. INT_FLAG2=0; // reset the interrupt flag for this source } } Primitive, yes, but remember the early PICs didn't have interrupts at all. 8-( 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 Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu