- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some questions -
1) Given you want to measure 0 - 50 Khz (0 - 50 KRPM ?), what
resolution of the measurement do you want ?
2) Accuracy of measurement ?
3) Do you need to make 4 simultaneous measurments of RPM or could
you use a 4 channel mux and measure them sequentially ? If latter any
restrictions on latency of measurement ?
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding the UDBs: you are using a 16-bit counter, which needs 2 UDBs AFAIR. Since all other components don't need to be duplicated,, this means you need 8 UDBs to count for 4 channels - and the PSoC5 has 24. So there should be room to spare.
For the routing error - the FF counter can just count clocks, it works that way (says even so in the data sheet).
Regarding your second question: The code is quite difficult to follow with all these states. Mayb reduce the RPM_Convert_Process function into a simple loop that waits until the counter has captured (FIFO not empty) and then calculates the resulting RPM directly. Having done that you can directly display the value on the LCD.
Even better: use an ISR to read the capture value which is triggered by a capture event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank Dana and Hli for reply.
Dana, I think 16 Bits with 5Hz for Gate frequency will do the work for me and that is what I have tested with my application.
As of now 4 simultaneous measurement is required, so I will use separate counters and as hli said it will consume only 8 UDBs (I have tested with four 32 bit counters previously that is why I was out of UDB I think). But if four 16 bit counter will not serve purpose then I will definitely consider MUX.
Hli, for your confusion, sorry. Now I have taken bob’s example from this thread:
http://www.cypress.com/?app=forum&id=2232&rID=59444
and modified according to my Hardware.
Now see, schematic page “Measure”, I have made RPM_Out (P0[6]) and RPMSig_1 (P0[2]). I have made a wire link between this two pin on kit “CY8CKIT-050”. See on schematic page “Clocks”, Clock_3 = 15KHz. Now if I program kit, it shows 0 Hz on screen. Now if I connect direct wire on schematic page “Measure”, and delete the pins and program on kit it shows 15000 Hz.
Got it? Please help me with that. Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is confusion regarding the function of HW connection on a pin, hopefully
this will illuminate why your schematic wired connection not working -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dana for the reply, and sorry for the confusing posts of mine. I think Hardware connection setting is fine. Here I am attaching a picture, hoping that it will make my issue clearer to you.
Case 1)
RPM frequency is generated 12 KHz, Routed to PIN P0[6], through a external wire(jumper) connected to PIN P0[2]. Result working fine
Case 2)
RPM frequency is generated 15 KHz, Routed to PIN P0[6], through a external wire(jumper) connected to PIN P0[2]. Result working not OK.
Case 3)
RPM frequency is generated 15 KHz, directly connected on schematic with Frequency Counter. Result working not OK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You mentioned you wanted to minimize UDBs, this project measures PW as well
as period (therefore frequency) and uses a fixed function counter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks dana for the point. But I got confused. If you have some link or project related to that, I would request you to share it. Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
As I sees that the two issue I facing is different from one another so I think I should create second thread for second issue.
Here is the link for the second issue of "external link" problem.