cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

Anonymous
Not applicable

I'm using PSoC Creator 3.3. and Psoc4-042. Working on the BLE project with led blinking. I'm facing error from the clock and PWM at the 100Hz frequency. The error window is attached in the files. Please kindly look after.

   

This error is not only is this program, I'm facing this error in every program i was doing at 100Hz Hardware handling. 

   

 

   

Thank you 

   

Br- Gaurav Badgujar

0 Likes
1 Solution
Bob_Marlowe
Expert II

Changed clock to 1kHz

   

changed PWM width to 16 bits

   

changed PWM period to 999 (1 second)

   

changed compare value to 499

   

changed main() to start the PWM

   

 

   

Bob

View solution in original post

0 Likes
6 Replies
Bob_Marlowe
Expert II

Welcome in the forum, Gaurav!

   

The cause of the error is listed in the first line of your compiler output. The clock divider is 16 bit wide. Hence the max divisor is 65536. From your HFCLK of 48MHz you would need a divider of 480,000.

   

Workaround: Change the PWM period and compare values to 10 times higher and use a 1kHz input clock.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks, Bob

   

please guide me for 1Hz PWM output.

   

what will be the Period value and Compare value and the clock i/p?

   

0 Likes
Bob_Marlowe
Expert II

Best would be to post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

Furthermore a bit of explanation what you want to perform with your project (apart from blinking an LED at 1 Hz) could give you some more hints.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Look for the Workspace02.cywrk_.Archive01.zip

   

Please give me the simplest solution and how does it work for 1Hz

   

 

   

Thanks

0 Likes
Bob_Marlowe
Expert II

Changed clock to 1kHz

   

changed PWM width to 16 bits

   

changed PWM period to 999 (1 second)

   

changed compare value to 499

   

changed main() to start the PWM

   

 

   

Bob

View solution in original post

0 Likes
Anonymous
Not applicable

It is working for me.

   

thank you, Bob.

0 Likes