almost working slave mode. need tighter timing, will rewrite in asm.