Thats how I would do it -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu]On Behalf Of Antonis Iliopoulos Sent: Saturday, 22 January 2005 6:25 AM To: Microcontroller discussion list - Public. Subject: RE: servos Dear Andrew, I have been playing with the delays. Would the delay below give me the 20 ms delay required between pulses? (4MHz clock) LIST P=16F627A ; processor include timer1 EQU 0X26 timer2 EQU 0X27 org 0x0005 goto Start ;********************************************************** ;Routine to setup ports as required ;********************************************************** Setup bcf status,rp0 bcf status,rp1 clrf portb bsf status,rp0 clrf trisb^0x80 bcf status,rp0 bcf status,rp1 return ;********************************************************** ;Routine to provide 20 ms delay ;********************************************************** Delay20ms movlw b'00001111' movwf timer1 Delayx4 movwf timer2 loop decfsz timer2,f goto loop decfsz timer1,f goto loop return ;********************************************************** Start call Setup again incf portb call Delay20ms goto again END Do you actually say that it easier with delays? I am not an experiencesd programmer. regards Antonis --------------------------------- ALL-NEW Yahoo! Messenger - all new features - even more fun! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist