How to configure a pcm to write to it periodically?