- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using a timer and counter for measuring the speed of a motor in RPM. I am not getting the proper connections for counting the incoming pulses.
The sensor is mounted on the motor which gives one pulse per rotation. I want to convert it in to RPM. The sensor used is MOC 7811 which is attached in the attachments. Please help me !!
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The simplest idea:
- use a timer component to create one pulse per second (or use a global signal component to get the pulse-per-second signal)
- use a comparator to create a proper input signal from your sensor (e.g. sensor between input and ground, and a resistor between input and Vcc)
- use a counter component (UDB), configure as up-counter, capture on input, reload on capture
- connect clock to the BUS_CLK
- connect the count input to the comparator
- connect the capture input to the 1Hz timer
- connect an ISR component to the interrupt output of the counter
- on interrupt, read the capture value from the counter, multiply it by 60, finished
Any optimization (e.g. do period measurement or reciprocal frequency measurement) is left as excercise to the reader 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@dana: counting the number of questions regarding frequency measurement in the last time, you should compile your answers together and prepare an appnote 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then in adition to comunity components we could have Comunity App Notes too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@hli, basic ap note like this should come out of Cypress in my humble opinion,
and cover various ways with a counter one can do the measurements. Take into
account timing, max count rates for method chosen.
Last person to do it, was quite instructive, was Dave Van Ess on PSOC 1.
My vote is Cypress do it.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@dana: I should use larger smileys...
Surely such AppNotes should come from Cypress, especially when the question gets asked so otfen. But I just saw that you always provided so much useful information for this topic. Maybe I should compile a blog post out of this, since I already have one explaining the CPLD implementation of a reciprocal counter...