cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

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 ?

0 Likes
Reply
5 Replies
Esteemed Contributor

Use the PrISM component, or a PWM and vary its compare value.

   

 

   

   

 

   

Regards, Dana.

0 Likes
Reply
Esteemed Contributor II

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

0 Likes
Reply
Esteemed Contributor

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.

0 Likes
Reply
Esteemed Contributor

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.

0 Likes
Reply
Anonymous
Not applicable

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

0 Likes
Reply