We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am using ADUC842.
Continuous pulse is being fed at port P2.6
I need to calculate rising edges of the pulse for 10ms time interval..
how should i proceed?
pls help.
Regards Mayuri
TMOD = 0x05; // TIMER 0 , MODE 1 SELECTED TL0 = 0x89; // 14 ms timer TH0 = 0xFA; // 14 ms timer
while(1) { do { TR0 = 1;
P1 = TLO;//reading the count in port } while(TF0 == 0); TR0 = 0; TF0 = 0; } } I am using timer as counter for counting pulses.... Is this logic fine?
I guess you just refuses to read up on how to post source code on this forum.
So we better refuse to read what you post too.
Didn't you notice the different look in my post?
#include <stdio.h> void main(void) { printf("Hello world!\n"); for (;;) ; }
And by the way - why don't you test your code instead of asking "is this logic fine"? Code having so few lines really do not take too long to test. You just can't develop applications without debugging.
Is this logic fine?
Why would you think the logic is fine?
You can make it a two timer/counter solution or a one timer/counter solution.