Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/20/01 13:26
Read: times


 
#9488 - RE: Measuring frequency and phase angle
The LCD bit is not significant Its quite easy.
The power consumption is not significant.
Basically I was going to code it this way:
A 0-5V square wave coming in on P3.4 and another one coming in on P3.5. I was going to use timer0 to count the # of events ( 0->1 transitions ) on P3.4 and use timer1 to count the event on P3.5. Then I was going to use timer2 to count for an interval ,say 5 seconds, and then stop all timers. Then calculate the frequency by dividing the number of events in timer0 ( it doesnt matter which one the frequncy will be the same on each port ) by the time interval in timer2.
Then to calculate the phase angle I would subtract the # of events in timer1 from the #of events in timer0 and then multply the result by 2pi and then divide by the time interval.

I'm not too sure if this would work and am not too sure how to write the code

Any help??


List of 17 messages in thread
TopicAuthorDate
Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE: Measuring frequency and phase angle            01/01/70 00:00      
RE:measure time with interrupt            01/01/70 00:00      

Back to Subject List