jouyorin
Junior Member level 1
hello
i'm using pic16f877a to mesure ac voltage this is my circuit: but it can read only values between 80v to 240 v..however im doing the same circuit with arduio and it works ! i guess the problem is in adc gonfiguration of pic16f877a, but i can't solve it cauz this pic don't hav ANSEL and ANSELH ..i already try to modifie ADCON1 but no result..please can someone help me! thnx in advance.
cofig I/O pic16f877a:
TRISA = 0xFF;
PORTA = 0x00;
TRISB = 0x00;
PORTB = 0x00;
TRISC = 0x80;
PORTC = 0x00;
ADCON1 = 0x80;
i'm using pic16f877a to mesure ac voltage this is my circuit: but it can read only values between 80v to 240 v..however im doing the same circuit with arduio and it works ! i guess the problem is in adc gonfiguration of pic16f877a, but i can't solve it cauz this pic don't hav ANSEL and ANSELH ..i already try to modifie ADCON1 but no result..please can someone help me! thnx in advance.
cofig I/O pic16f877a:
TRISA = 0xFF;
PORTA = 0x00;
TRISB = 0x00;
PORTB = 0x00;
TRISC = 0x80;
PORTC = 0x00;
ADCON1 = 0x80;