add the following to initialize port E

PEADDR=0x02;//alt function
    PECTL=0x00;//no alt function
    PEADDR=0x01;//data dir
    PECTL=0x00;//set all 8 bits to O/P
    PEADDR=0x03;//O/P control function
    PECTL=0x00;//set to push pull ratherthan open drain
    PEADDR=0x00;//prevents inadvertent changes to sub registers