My suggestion, use LCD.BAS from Melabs. It's made to work with PBC and you can modify it for your special need
download it here