- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I have a hw design where i use a CYBLE-222014 and some PWM controlled LED's.
My problem is that one of my LEDS is hw wired to pin 4.0, which is not routeble from PsoC Creater.
How can i from code make it posible to adjust PWM on PIN 4.0 ?
Solved! Go to Solution.
- Labels:
-
PSoC 4 MCU
- Tags:
- PSoC 4 MCU
- pwm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please refer to the attached project about how to change the compare value. From your issue description, you only want to fade the brightnessss of the LED, it means that you want to led on in less time in a duty cycle. I attached a project to change the compare value.
It is suggested that you change your design to let the LED in the port0-port3 pin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, it is impossible to adjust the pin to PWM line or line_n, because the digital signal connect has two ways, one is dedicated pin, the other is through the DSI, the Port4 can't have the ability.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Isn't it possible to make a interrupt for each compare and then in this intterupt routine control the led.
I have tried my self but the interrupt triggers not on compare
- 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
LinglingG_46 thank you for the attached project.
This projekt also visualize my problem, i can't adjust the duty cyle of my led, if i change the timer compare value i still got and interrupt with same interval. How can adjsut the pwm of the interrupt?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What do you want to develop? Does the issue have no related to PWM and the dedicated pin?
Or you can detail your questions, maybe we can give you a similar code example. How do you want to adjust the duty cycle of your LED?
If you want to change the compare value and period value, you only need to call the API in the cc interrupt handler just like below codes:
PWM_WriteCompare(PWM_ReadCompare() + BRIGHTNESS_CHANGE);
PWM_WritePeriod(PWM_ReadPeriod() + BRIGHTNESS_CHANGE);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will just want to fade the brightnessss of the LED, which is placed on a none routble pin. On a CYBLE-222014.
I will try to adjust the period as well later.
But if I only change the compare value, it does not have any inpact on the dutycycle.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Im not able to got this solution to work. Which target have you tried this code with. ?
Im using af cyble-222014
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
please refer to the attached project about how to change the compare value. From your issue description, you only want to fade the brightnessss of the LED, it means that you want to led on in less time in a duty cycle. I attached a project to change the compare value.
It is suggested that you change your design to let the LED in the port0-port3 pin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the CC interrupt handler to change the LED status to solve the un-dedicated issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not it actually do some fading, but very very random up Down and off. I need to put a value from 0-255 to control the led itensity. How Can i do that?