servo controller ic
Here is a subroutine that waits 4x [numberin W] PIC cycle, include call + return. Good for servo control @4MHz clock (1µs cycle)
Set an output to 1, first put 250 in w (movlw .250), call the routine (call DlyFourW), then put the length from 0 to 255, re-call DlyFourW and finally set output pin to 0
DlyFourW
ADDLW 0FFh
BTFSS STATUS, Z
GOTO DlyFourW
NOP
RETURN
You can control the 18 servo one by one, this means from 18x1 to 18x2 ms, this gives # a normal repeat rate for each servo output
One PIC with enough pins is largely enough :lol:
Take just another pin for control input (RS232 for example)