trying to use a chips pins as digital i/o when they are still configured as analogue is never a recipe for success