- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am experimenting with PSoc 4200's PWM.
While running the processor in 48Mhz, and with count of 255, I am getting ~180khz frequency. Is there something that I am not configuring correctly?
255 resolution won't be enough for my application.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, that will not work:
48MHz / 300 kHz = 160
This shows that you can get only 160 steps resolution instead of your wanted 4096 steps.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use a TCPWM component which is 16 bit wide and runs at max. 48MHz clock.
Another solution is the PWM component configured as 16 bit wide which runs at 43 MHz clock max.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. But I am using TCPWM with 48Mhz Clock feeding into the PWM. Setting PWM period to 255 with Prescaler x1, gives about ~180khz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That comes out to a clock period of about 266.667, with an error percentage of 4.575% difference from 255.
You wouldn't happen to be turning the PWM on/off, would you? Or modifying the period/count/settings? That might account for the difference in frequency...
You might need to change the settings within the TCPWM module; There is a setting to left-align, right-align, etc the PWM output, as well as inverting the outputs. And the values should be able to go up to 65535
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So what period and resolution do you need?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was hoping I could get 300khz with 12bit (4096) resolution. I guess this is not possible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, that will not work:
48MHz / 300 kHz = 160
This shows that you can get only 160 steps resolution instead of your wanted 4096 steps.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
muga_metal,
Take a look on DDS32 component demo in this thread
Need a programmable frequency generator
Unlike the PWM, which output frequency accuracy worsening as ~f^2, DDS has flat accuracy in entire working band (in expence of some jitter).
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content