dcnivas
Newbie level 5
- Joined
- Jun 15, 2016
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 90
Hi i am having a problem with pic16f676 controller for detecting a analog input to RA0, RA1 & RA2 are connected to three analog AC inputs 50 hz frequenncy, three phase voltages 440 volts i reduced ac voltages by connecting series resistors. i ust i want its i/p coming or not (yes/No)
i have declare the following steps if have any further steps please let me know...
its working good in only RA0 and RA1 like R phase and Y phase input detecting but not working RA2 pin(B Phase ) i think its comparator out put pin itd not detecting input AC voltage is there any other declaration please let me know...
i have declare the following steps if have any further steps please let me know...
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #include<htc.h> #define_XTAL_FREQ 4000000 __CONFIG(0x3FF4) #define Rmain RA0; #define Ymain RA1; #define Bmain RA2; #define RphaseLed RC0; #define YphaseLed RC1; #define BphaseLed R2 char RphaseFlag=0; char YphaseFlag=0; char BphaseFlag=0; void main() { INTCON =0x00; CMCON=0x07; ANSEL=0x00; TRISA=0b001111; PORTA=0b001111; TRISC=0b000000; PORTC=0b000000; RphaseFlag=0;YphaseFlag=0;BphaseFlag=0; while(1) { if(Rmain ==1) RphaseFlag=1; if(Ymain ==1) YphaseFlag=1; if(Bmain ==1) BhaseFlag=1; if(RphaseFlag==1) RphaseLed=1; if(YphaseFlag==1) YphaseLed=1; if(BphaseFlag==1) BphaseLed=1; } }
its working good in only RA0 and RA1 like R phase and Y phase input detecting but not working RA2 pin(B Phase ) i think its comparator out put pin itd not detecting input AC voltage is there any other declaration please let me know...
Last edited by a moderator: