At 09:34 PM 1/9/98 +0000, you wrote: >Hello Everyone- > >I am new to PICS and have an R/C Servo project I am working on. I learn best >by studying servo code written in assembly or Pbasic. If anyone has servo code >they are willing to share please send it to me at your earliest convenience. > >Thank you > >Jon Petty This is in parallax assembler (ack!), for 16c84 using 500kHz resonator. "Timing" controls position of servo. ;======================================================== ; SERVO Routine ; This can be entered at ; go_right or go_center ; The time thru this routine is ; constant. It is currently apprx. 1/3 sec. ; ; Defines used: RED = output LED ; SERVO = servo line ; #L_Right = right timing value ; Variables : Temp, Timing, Count ;======================================================== go_right setb RED mov Temp,stay_time mov Timing,right_time clr Count jmp Servo_Loop ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= go_center clrb RED go_center2 mov Temp,stay_time mov Timing,center_time clr Count jmp Servo_Loop ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Servo_Loop djnz Count,$ ;delay 256x45us=11ms djnz Count,$ ;delay 256x45us=11ms mov Count,#58 ;Precise timing value djnz Count,$ mov w,/Timing ;delay to make mov Count,w ;total delay 256 inc Count djnz Count,$ setb SERVO mov Count,Timing ;Timing delay djnz Count,$ clrb SERVO djnz Temp,Servo_Loop ;Jump back to first loop clrb RED ret