Add serial write code from spec sheet