- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.. I want to control the intensity of the led ... off state to low intensity then gradually it will increase its intensity to the peak and then again it should reduce and gets off.
How can i perform this task? What component should i use ?
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the PrISM component, or a PWM and vary its compare value.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To succesively change the intensity of an LED follow Dana's advice and additionally use a timer that interrupts at certain times, so that you can change the PrISM's density value or the PWM's compare value.
Do not forget to read the Timer's status register in the interrupt handler to clear the interrupt.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can avoid reading the Timer status register by attaching an ISR component
to Tc output of timer. And set up timer to just run continuously, no ISR.
Regards, Dana.
Or eliminate the timer and use the M3 core systick to gen the ISR, save resources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Some systick related stuff -
http://www.cypress.com/?id=4&rID=94607 PSOC 4 Systick
http://www.cypress.com/?docID=49253 AN90799 (Systick as well)(
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
or use 2 pwms with slightly diffferent values of compare and period, and connect to a simple xor gate I think, use the output of the gate to drive the led.
it will look like its breathing.
yup just tested it, works 🙂 its one of the things that altera trys to get you to do for fpga's, so it works good on the psoc5lp too should work on 3 4 and 5lp