??? 07/09/10 20:05 Read: times |
#177204 - Another potential problem Responding to: ???'s previous message |
You should try the tests described in my second response since from your descrition it works but your hardware does not.
However, there is something else which needs clarification. Most zero crossing detectors that I have seen provide a positive going edge at the start of one half cycle and then a negative going edge on the second half cycle. If this is how your zero crossing detector works, then your software will only activate P1.3 every second half cycle. Also Avni Modi said: Tell me something I don't know. You don't mention your clock frequency, how can we see that your timing is accurate? It would help if you actually read and understand what I said.
first to complete 1 cycle 20 milisecond time period is required.
and for half cycle there is 10 milisecond. 1 cycle=360 degree Avni Modi said: Once again you did not understand (or even pay attention to )what I originally said. I get what you are trying to do, despite that is a "scribble" and there are potential problems with it. Let me summarise:
In our program there are three loop. port p3.0 bit WILL zer0 [MOV A,0B0H] [CJNE A,#11111110B] at the zero crossing then p1.3 remain low for 2 milisecond and then after high..becouse triac is off after one complete cycle if gate signal is not present. in second loop,port p3.1 bit WILL zer0 [MOV A,0B0H] [CJNE A,#11111101B] at the zero crossing then p1.3 remain low for 5 milisecond and then after high..becouse triac is off after one complete cycle if gate signal is not present. in third loop,port p3.5 bit WILL zer0 [MOV A,0B0H] [CJNE A,#11011111B] at the zero crossing then p1.3 remain low for 7 milisecond and then after high..becouse triac is off after one complete cycle if gate signal is not present. 1. You do not synchronise on an edge 2. If any other pin on P3 is pulled low (P3.3, p3.4, p3.6, p3.7) or if P3.0, P3.1 and P3.5 are connected in parallel, you will not detect the zero crossing level in any of the 3 tests. 3. See my comment on the edge detection at the start of this reply 4. You should use subroutines more effectively. 5. Use only one input for the zero crossing so you can more effectively detect an edge. Choose the desired delay by some input selection method like DIP combination on some digital inputs. |