dcnivas
Newbie level 5
- Joined
- Jun 15, 2016
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 90
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; } }
can you show the code?
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 RC2 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; } }
Sir how to detect these three phase inputs are same or different phase because i have given same phase voltages to RA0 and RA1 pins but its shows logic 1 otherwise is there any comparison config register these are same phase or different phase input voltagescan you show the code?
can you show the code?
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 RC2; 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; } }
I repeat: Please post the schematic you are using so we can see which points you are checking voltages across.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?