'PIC16F15257 ISSUE with different output pin voltages

Anyone have an idea as to why a pic will have very different output voltages on certain pins ?? I use multiple outputs on one switch and sometimes the one pin will show 4 to 5 volts output in one switched circuit and below 1 volt in another swithced circuit and 2-3 in another, etc ! the IO's in use sometimes share a register, but sometimes do not.

Tried switching from analog to digital outputs, same problem.

I setup a test setup using one switch and 12 outputs ,8 to a single led and 4 to 2 ,2 channel cmos compatible high-side power transistors, at one time and that MOSTLY worked, so I do not think that it is a power issue. 3 pins showed low voltage but two of those are two that I just added into the mix. Tried two different pics that were new and the same number, and both do it. Any thoughts ?? On the code I just added (only a small segment of what I had done), RIGHT has the most issues. JUST DID A DC VOLTAGE TEST; when RIGHT is on: RD2 has 4.8v -RD3 has .98.. When all are on. They all show around 4.8 except RD2 shows 2.9 -RD3 shows 1.64 and RB3 shows1.45,and up shows 4.8 on RD2 and 2.4 on RD3. So one pin (RD3) is actually lower with less outputs on ??

#include "mcc_generated_files/mcc.h"

/*
                         Main application
 */
void main(void)
{
    // initialize the device
    SYSTEM_Initialize();

         while ( RA3 == 0 ) /*POWER LED OFF*/     
    {/*B*/ 
               /*SWITCH TURNS ON RA3 pwr LITE AND RA7 backlite PLUS OTHER FUNCTIONS BELOW IT*/    
        /*tap on POWER */  if (RE1 == 0) RA3 = 1, RA7 = 1;
 
          while  (RA7 == 1) /*POWER LED SENSED AS ON and ALLOWS FUNCTIONS IN BRACKETS "C" TO WORK*/
            {/*C*/ /*all standard functions */    
        /*OFF */{ if (RD5 == 0)  RA3 = 0,RA7 = 0, RA0 = 0, RA1 = 0 , RA5 = 0, RA6 = 0, RC1 = 0, RD2 = 0, RD3 = 0, RC7 = 0, RB4 = 0, RD7 = 0;}
        /*TURNS OFF OTHER FUNCTIONS BELOW IF THEY ARE ON
        
        /* (UP) (MOMENTARY) RD7 COIL 5 & RB1 COIL 7*/ 
                { if (RD0 == 0) RD3 = 1 , RD7 = 1, RA5 = 0, RA0 = 0;  else  RD3 = 0, RD7 = 0 ;}               
        /*(DOWN)(LOCKING) RA0 FLOAT LIGHT & RA0 & COIL 6 RA5*/
                { if (RC2 == 0) RA5 = 1 , RA0 = 1 ;} 
        /*RIGHT  RC0 to  4 RBO + 7 RB1*/
                { if (RB3 == 0) RD2 = 1 , RD3 = 1;  else  RD2 = 0, RD3 = 0;}
                
        /* LEFT  RD1 IS SWITCH TO (2OUT RC7 + 7OUT RB1)*/ 
                { if(RD1 == 0)  RC7 = 1 , RD3 = 1;  else  RC7 = 0, RD3= 0 ;} 
                { if (RA4 == 0) RA0 = 1, RA1 = 1 , RA5 = 1, RA6 = 1, RC1 = 1, RD2 = 1, RD3 = 1, RC7 = 1, RB4 = 1, RD7 = 1;}
            /*C*/      /*on this test line - RB1, RD2 AND RD3 ARE THE WEAK OUTPUTS*/
          }         /*THESE 3 AND RB0 ALSO WILL NOT LOCK LIKE THE REST DO ON IN THIS STATEMENT*/
  
    }/*B*/

}/*A*/




Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source