- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iam new to psoc .can any help me how to measure frequency input from function generator and the output is of enabling port by logic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the Timer component in PSoC Creator and take the Timer example project (available in PSoC Creator) which shows how to use the Capture and Terminal Count interrupts. You can modify for your purposes for measuring the frequency (for small frequencies - reading the period, for large frequencies - counting the number of pulses).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
iam not getting the readcapture value can you please send me the logic how to get the freq some code pls
- 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
thanks for idea but the problem is iam not getting the read counter value and the debugging is stopped while function generator input is given to the port .iam using Psoc 4200m series kit .help me with the frequency measurement while function generator input is given to port and it has to perform some logic based on freq value . top design pls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Be a little bit more precise what works and what does not work.
Bob
- 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
Do not use Pin P0_7: It is connected to the user switch. Pressing the switch will shorten your function generator output to ground. See schematics.
CC_ISR_flag must be declared as "volatile" See here.
The frequent reload of the counter and _StartEx of the interrupt handler will interfere with the normal frequency measure. Both are needed at project initialization only. Your counter is already configured for resetting at the right times.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the problem iam facing is that the function freq() is not returning any value .
as per your suggestion i am changing the port to 0.0. and the CC_ISR_Flag defined as Volatile .
can you please get me the code such that it has to measure the freq whenever it is called . iam new to psoc please help me with it
- 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
the program is in the infinite for loop and not executing any statements .may be my approach is wrong can any give me the help to perform the frequency measurement task .new design with minimal code pls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you telling that the frequ() function is not called??? check (using a breakpoint) if the capture interrupt fires. When not, scope your input signal.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
by the following code i can get the time stamp and freq but i dont want the freq all the time i want to write it in a function and whenever called the function it has to return the freq .
the code which has edited and the other with timer and counter has not worked at all .
i donno why readcapture() or Readcounter () is not updating while debugging the value is 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not possible to help you without the complete project. As I see you reverted some of the corrections I made, so your file contains some errors.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that is the working code but this will continuously display the time stamp in through uart .
but my requirement is whenever required only it should give the freq value
ex.only at the time of button press it has give the freq value and some logic like below some set freq led has to glow
- 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
what more you have to do is query the UserSwitch_Read() == 0 and then call for display the value
Glowing of LED is best done using the PriSM component.
Bob