Stell doch mal das Ganze Programm rein.
So wie es in deinem Pic ist (Port B).
Dann kann man dir evtl. besser helfen.

Gruß David