dear sir my project is scr power control using 8051 for zero crossing detection i hav used ua741 which gives a square wave of 10ms(0 and 1 after every 10ms) but i m not able to detect dis square wave(0 and 1) with 8051 sir plz help me in this regard i will be thankful to u my code example is
#include<reg51.h> sbit t1=P2^1; sbit zcd=P2^2; sbit t2=P2^3; void main() { zcd=1; while(1) { while(zcd) t1=1; while(!zcd) t2=1; } } dis code is jst for example
Don't you find it a bit boring to have an infinite loop that can only assign logic high to output pins - never logic low. Wouldn't it be more interesting if your output pins actually shows a square wave based on any detected input signal?
so wt is the criteria for detecting logic 1 ang 0 from a separate circuit ?
What is the criteria for _driving_ an output pin sometimes high and sometimes low? It doesn't matter what your program detects - it isn't designed to give any interesting output allowing you to know if it detects the input signal or not...
zero crossing detection ... i hav used ua741
not 'wrong', but it would be better to use a comparator than an OP-Amp.
as far as your approach, I second the other posts.
Erik
thanks.......