- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am tring to measure pulse rate by gating the the input pulses for a fixed time (0.5 mS) by using a 16 bit gating timer(T1) and the incoming pulses are counted by a 16 bit counter(C1). I noticed an error in the pulse count. Eigther by reducing the gating time or multiplying the result with some fraction i may get the corrected resul like that i thought.
When i tried to multiply the counter's result with a fraction i couln't get the correct result. (i defined the counter's result as int variable). could you please suggest?
regards,
gopal
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try typecasting the counter output to float. For example if you are trying to multiply the Count by a fraction 0.75:
int Count;
float Result;
Result = (float)Count * 0.75;
Best Regards,
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried with typecasting then also i was an error. The mistake i committed was before manipulating the counter data i didn't stop the counter. thanks for your reply.
regards
gopal