Thanks for replying but what I really mean is to use PIC to calculate when the pin should turn high or low. the program will run to produce a continuous pulse for the servo in what way I can update and calculate the status of the pin as fast as possible ----- Original Message ----- From: Martin Hill To: Sent: Wednesday, May 17, 2000 7:53 PM Subject: Re: servo timing updating > I'm not entirely clear on what it is you want to do, but if you want to > update 16 outputs at the same time, then why not use latches to > hold the data externally, setup the data to go into the latches either > one per latch or by clocking the data in serially, then enable all of > them with a single pin, this way they all update at the same time just > using one instruction, so long as you know what the next state is > going to be so you can set the pins accordingly. > > Martin. > > > hi everyone > > > > what is the fastest way to update 16 pins at one time for servo motors( > > it must be timing sensitive. thats means that i need to keep track of the current time and the time to trigger > > the way i did is very long. > > > > compare current time with trigger time > > if equal > > check if pin is high or low, toggle and add either the on or off time > > else > > see next pin,last pin then incf clock > > the way i do will take around 20 cycle for updating a pin with a free running counter of 16 bits > > is there any way to do it in a faster manner?? > > > > > > > > thanks > > > > regards > > soon lee