Can a TCPWM component's output(line) generate floating point frequency?

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

cross mob
bugkiller
Level 2
Level 2
10 replies posted 50 sign-ins First like received

bugkiller_0-1671493808631.png

Hi, throughout processing my project, I need to generate floating point frequency(sort of 9.091kHz) from output line. Here's some example picture for better understanding to you guys. And I know by modifing period, I can change the output freqeuncy. But I got a warning from PSoC4 creator that I can only generate integer range freqeuncy, I guess?

 

bugkiller_1-1671494178987.png

 

From seeing this warning, I just wonder is it just warning? Or I can't get floating point frefqunecy? I hope it can.

Thanks, 

Best regards,

 

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

bugkiller,

The PWM component can ONLY subdivide the input frequency by integer period values.

If you feed the 24MHz into the PWM and use a Period of 2640, your output would be 9.090909K.

Is this what you are looking for?

Len_CONSULTRON_0-1671540873021.png

Here's a short list of input frequencies to the PWM and the Period values and resultant frequencies

Input Freq

Period Value

Result Freq
24MHz 2640 9.0909K
12MHz 1320 9.0909K
10MHz 1100 9.0909K
48MHz 5280 9.0909K

 

Remember in this configuration using the IMO as the source clock, you are only +/- 2% accurate to that frequency.

If you need higher accuracy, you need to go to a crystal to achieve > +/- 1%.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

3 Replies
NXTY_Tatebayasi
Level 5
Level 5
Distributor - NEXTY (Japan)
50 questions asked 25 likes received 250 sign-ins

Hi,bugliller -san

The component datasheet that the PWM output value depends on the PWM alignment setting or the TCPWM_SetPWMMode() API parameter.
Since this function is specified as a 32-bit unsigned integer, floating point cannot be considered an input.

Best Regards,

Chihiro Tatebayashi

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

bugkiller,

The PWM component can ONLY subdivide the input frequency by integer period values.

If you feed the 24MHz into the PWM and use a Period of 2640, your output would be 9.090909K.

Is this what you are looking for?

Len_CONSULTRON_0-1671540873021.png

Here's a short list of input frequencies to the PWM and the Period values and resultant frequencies

Input Freq

Period Value

Result Freq
24MHz 2640 9.0909K
12MHz 1320 9.0909K
10MHz 1100 9.0909K
48MHz 5280 9.0909K

 

Remember in this configuration using the IMO as the source clock, you are only +/- 2% accurate to that frequency.

If you need higher accuracy, you need to go to a crystal to achieve > +/- 1%.

Len
"Engineering is an Art. The Art of Compromise."

Thanks! you really save my day.

0 Likes