- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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%.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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%.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! you really save my day.