- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to use PWM as a clock divider?
i tried to use it for changing clock frequency in run time. to achieve 921600 clock frequency i used the configuration as shown below but its not getting. I have given 48 MHz to clock input. What can be the problem?
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
48 Mhz / .9216 Mhz = 52.083333333333333333333333333333 as a divisor,
but you have 25 as a divisor, but that does not create the 1.083 uS shown
in configurator, which tells me your clock is set to 24 Mhz, which would result
in .9216 Mhz = 1.083 uS.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But why don't you use a normal clock block? You can change it during runtime too (via the Clock_SetDivider method).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As hli pointed out sometimes we (I) miss the obvious
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually I tried changing runtime clock by using function
Clock_SetDivider(11);
and I have set source clock for 115200 [ 115200 * 8 = 921600 ]. Acording to datasheet by using above function my Uart should work on 9600 isnt it?
but its not working so.
In which sequence functions of clock should I use for changing freq runtime?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The clock to the UART should be 8X( or 16X )of the baud rate, so for 9600 baud, you clock to the UART should be 76800( or 153600).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nilesh,
When using the Clock_SetDivider( ) API, please ensure that the clock "Source" in the configuration tab is chosen appropriately. When left as "Auto", Creator might select the source which you might not have expected. Hence, setting the divider might result in unexpected output frequency.
Did you check the clock output on an oscilloscope? What frequency did you observe it to be?
Thanks,
Gautam Das