CPU = 16F876 MHZ = 10 CONFIG 16254 ;*********************************************** ; http://www.basicmicro.com ; Title : hpwm.bas ; Author : Dale Kubin ; Date : 04/29/02 ; HPWM command. Use the built in hardware Pulse ; Width Module on PICmicros. Ideal for controlling ; servos independent of CPU time. ;*********************************************** counter var long 'Used for the count command hpwm 1,9920,4960 'Set up a 2KHz signal (approx) 'hpwm 1,8,4 'Set up a 83KHz signal (approx) Loop: count B0,1000,counter 'Set up our counter on pin B0 for 1 second 'Display the results serout B1,i9600,[dec counter," Hz",10,13] goto loop