- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project where I am trying to use an interrupt-triggered PWM which controls the configuration of the onboard LED and output the results. I have attached my project as a .zip and was hoping for some advice as to what I am doing incorrectly? The main files to look at here are main_cm0p.c and LightControl.c (I don't suspect that the header files are the source of my issues)
I have consulted others with some PSoC 6 experience, and the feedback I received was that this code should work fine. My issue is that after running the code, the LED does not even flash at all.
Am I missing something here? Any and all advice would be greatly appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have debugged this project, and found below issue:
--'Interrupt Source' in LightTimer is not selected, this causes LightTimerHandler never triggered.
--line#178(LightControl.c): if(cycles == 0 && new_cycles > 0) never reached, this cause PWM A/B/C never started.
--comment lines :LightOutputA_SetCompare0(0) & LightOutputB_SetCompare0(0) & LightOutputC_SetCompare0(0)
in LightControl_Init(), and then RGB LED is lighted.
Please check your code logic and make proper modifying accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The interrupt source of the LightTimer component is not configured for Overflow/Underflow.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I configured the interrupt source for Overflow/Underflow, nothing changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You disable the lighttimer and I cannot find a place where you enable it again.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My apologies, there should be a line of code underneath line 190 in LightControl.c:
LightTimer_Start();
However, adding that still does not solve the issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure that line 190 will ever be reached???
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have debugged this project, and found below issue:
--'Interrupt Source' in LightTimer is not selected, this causes LightTimerHandler never triggered.
--line#178(LightControl.c): if(cycles == 0 && new_cycles > 0) never reached, this cause PWM A/B/C never started.
--comment lines :LightOutputA_SetCompare0(0) & LightOutputB_SetCompare0(0) & LightOutputC_SetCompare0(0)
in LightControl_Init(), and then RGB LED is lighted.
Please check your code logic and make proper modifying accordingly.