End write function putBCDslong with debug