There is nothing wrong with your code, it is something in PBP.
You code works with other two port chips.

Contact Melabs and ask for Darrel