It looks like your second question has already been answered. To solve your first problem you need to arrange things so that their computation does not cause and overflow. Here's what I came up with: #define XTAL 4000000 #define TCY (XTAL / 4) #define BRATE 1200 #define RX_OVERSAMPLE 8 #define TIMER_VALUE (TCY / (BRATE * RX_OVERSAMPLE)) vs. #define TIMER_VALUE (XTAL / (4 * BRATE * RX_OVERSAMPLE)) -----Original Message----- From: James Fitzsimons [mailto:jamesfit@paradise.net.nz] Sent: Monday, August 13, 2001 8:42 PM To: PICLIST@mitvma.mit.edu Subject: [PIC]:help with hi-tech code and building libraries Hi all, I am a total PIC newbie and have a couple of questions. I am trying to develop my first PIC project in Hi-tech C. I want to create a library using the delay.c delay.h and iserial.c (attached) files. The problem is I can't create the .obj file for the iserial.c file as I keep getting the following errors. Warning[000 ] file c:\mydocu~1\personal\robotics\picstu~1\librarys\serial~1\iserial.c 114 : arithmetic overflow in constant expression Warning[000 ] file c:\mydocu~1\personal\robotics\picstu~1\librarys\serial~1\iserial.c 162 : arithmetic overflow in constant expression 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. 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? Thanks for any help you can provide! Regards, James Fitzsimons -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu