- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im using the LPComparator PSoC4 Example and i feed a Square wave on Vplus of 200Khz, the interruption seen to make the program crash but when its a signal of 20Khz the interuption seen too be running perfectly.
There is anyway to avoid crash of the PSOC4 when using higher frequency ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remember interrupts should be kept very, very short, such as updating a variable for the main loop to handle.
If you use the LED, maybe we can't recognize the blinking in high frequency.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you mean by crash? Have you attached the debugger? Is it always in the interrupt?
It is possible you're spending all your time in your interrupt at the higher speed. Remember interrupts should be kept very, very short, such as updating a variable for the main loop to handle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you are right, its stay in the interrupt and never leave it or clear it. the only thing inside the interrupt is a led switching from on/off.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I'm not sure you'd be able to see the LED switching at that speed.
The LED will be on/off for all of 0.0000050 seconds. I'm pretty sure that's beyond the ability of the human eye to see. Even 20KHz should be too fast to see.
Are you doing a read/modify/write? Are you clearing the interrupt? What is your hfclock set to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you used the Oscilloscope to test the pin voltage to determine whether in and out of the interrupt?
Or could you tell us which way do you use to debug the status of the interrupt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, i use the scope and the debugger, to test all the input/output with break point and probing.
Depending of the hfclock, the frequency limit increase. I move the " GSR_ISR_ClearPending() " out of the interrupt and put it inside the main loop, add a delay, and now the program still not work at some higher frequency but it resume is action once the frequency going bellow 200Khz.
that a improvement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At this point I think it would be helpful if you posted your design (or a simplified example showing your problem.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remember interrupts should be kept very, very short, such as updating a variable for the main loop to handle.
If you use the LED, maybe we can't recognize the blinking in high frequency.