cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1

DeAa_335316
New Contributor II

I am using CY8C28445. I am facing problem with TIMER. I want to generate 1 Hz to 40 Hz signal in two pins and change PWM signal with certain period of time.

   

Example:

   

TIME | PIN0 Freq. | PIN0 PWM |   PIN1 Freq. |    PIN1PWM | Alternate Mode  
T0   |    2Hz            |             50% |              2Hz |               50% | 0   
T1   |    3Hz            |             50% |            15Hz |               20% | 0  
T2   |  30.5Hz         |             40% |           2.5Hz |               50% | 0  
T3   |    2Hz            |             50% |              2Hz |               50% | 1
Alternate Mode activate gives 180 degree phase shift b/w PIN0 and PIN1.

0 Likes
6 Replies
Bob_Marlowe
Expert II

You need two PWMs and a Timer.

   

Use the timer with a corresponding interrupt and count smallest time to have a clock. At the different Tn caunts set the PWMs period and compare value accordingly. For the phase shift load PWM2's initial count-register as required.

   

 

   

Bob

0 Likes
odissey1
Honored Contributor II
        Deepack, A while back I posted a project generating tunable frequency http://www.cypress.com/forum/psoc-5-device-programming/generate-variable-frequency Check if it suit your needs. Output is generated by DDS instead of Timer, so that any frequency is achievable with resolution of Fclock/2^24. The DDS module has second output with variable phase 0-360deg, which could be used also, e.g. for duty cycle change.   
0 Likes
Bob_Marlowe
Expert II

But that will never fit into the PSoC1 device CY8C28445.

   

 

   

Bob

0 Likes
odissey1
Honored Contributor II
        Sorry Bob, I missed that this is PSoC1 forum. Please disregard.   
0 Likes
DeAa_335316
New Contributor II

is i need Psoc5 for this project 

0 Likes
Bob_Marlowe
Expert II

When the board-count of the project is small, the impact of using a not-so-cheap chip will be supressed by the state-of-the-art CPU-design the PSoC4 or PSoC5 devices have got. So when you are free to choose I would always consider using one of those chips.

   

 

   

Bob

0 Likes