simple one-wire code generation