I made a reduced size test program and still got the same results. Finally, with nothing else to try I changed the SERIN pin from PORTB.7 to another pin I was not using (PORTC.1). Works like a charm.
I guess it is either a bad chip or some obscure setting for portb.7 I missed. Thanks for all the help.
Bookmarks