Hi all, firstly I would like to thank those on the list that have provided = feedback and assitance to me on my recent postings. I am (hopefully) getting close to the end of my first PIC project! I = have a couple of questions regarding hardware and software design. My = project consists of a bit banged serial port, timer, encoder counter, = and psuedo PWM to drive two modified hobby servos. This is all done on a = 16F84. From reading this list I understand it is good practice to keep = interrupt service routines short, and use flags which are polled in the = main loop. I am thinking about using this method for the timer, and the = serial port. The code would look something like: main() { while (1) { if (timer_flag) do something } } interrupt void isr() { if interrupt cause by timer set timer_flag =3D 1; } and the same for the serial i/o... is this good coding style for PIC's? Secondly, if this is the solution I end up using then I am probably = going to want to tie at least three incoming lines to the RB0/INT pin = (two encoders and the Rx line for the serial port). How would I = multiplex (is that the right word??) these lines togeather? What = component(s) would I use to do this? I am thinking that every time an interrupt occured on RB0 I could just = check the values of the other i/o pins to see what caused the interrupt. Sorry for the long winded e-mail, turns out this project was a little = more involved than I first thought it would be ;-) Thanks very much for any advice, kind regards, James Fitzsimons -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body