generate 1 Hz to 40 Hz signal

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeAa_335316
Level 4
Level 4
First like received

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
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        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
Level 10
Level 10
First like given 50 questions asked 10 questions asked

But that will never fit into the PSoC1 device CY8C28445.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Sorry Bob, I missed that this is PSoC1 forum. Please disregard.   
0 Likes
DeAa_335316
Level 4
Level 4
First like received

is i need Psoc5 for this project 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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