The present disclosure relates to microcontrollers, in particular microcontrollers with integrated clock control units.
Most microcontroller clock schemes are based on binary dividers of a standard clock. For instance, on conventional microcontroller products if a 16 MHz base clock may be used as the system clock. However, a user may scale down this frequency, in particular for low power applications. Also, peripheral devices may be supplied with clock signals derived from such a system clock by division of 2n, wherein n>1. For example, in the above case the following frequencies may be selected for a system clock or other clock signals derived from the system clock: [8, 4, 2, 1, 0.5, 0.25, 0.03125] MHz. These selectable output frequencies are based on a divider of [2, 4, 8, 16, 32, 64, 512], respectively.
There exists a need for microcontroller with a more flexible configurability of a digital clock source that can be used as a system clock and/or as a clock source for peripheral devices or other uses.
According to an embodiment, a microcontroller may comprise a numerical controlled oscillator receiving a primary clock signal and being configured to provide an internal system clock.
According to a further embodiment, the numerical oscillator may receive a reference clock r(x) and a numerical value q and provides an output clock, wherein the numerical value is provided by a register. According to a further embodiment, the output clock f(q)=r(x)*A; wherein A is a numeric oscillator transfer function. According to a further embodiment, the system clock can be used to operate the central processing core of the microcontroller. According to a further embodiment, at least one other internal clock can be derived from the internal system clock. According to a further embodiment, the microcontroller may further comprise another numerical controlled oscillator to provide for a second internal clock. According to a further embodiment, the microcontroller may comprise a selection unit operable to select the primary clock signal from at least one internal and at least one external clock signal. According to a further embodiment, the numerical controlled oscillator may comprise an adder having a first input coupled with an increment register, and an accumulator being clocked by the primary clock signal having an input coupled with an output of the accumulator and an output coupled with the second input of the accumulator, wherein an overflow output of the accumulator provides said internal system clock signal. According to a further embodiment, the microcontroller may further comprise a multiplexer receiving a plurality of clock signals and being controlled to select one the plurality of clock signals as the primary clock signal. According to a further embodiment, the increment register is buffered. According to a further embodiment, the microcontroller may further comprise an AND gate with a first input coupled with said overflow output and a second input receiving the primary clock signal, wherein an output of the AND gate provides the system clock. According to a further embodiment, the microcontroller may further comprise a multiplexer receiving the output of the numerical controlled oscillator and a plurality of external and internal clock signals, wherein the multiplexer is controlled by a configuration register to select the internal clock. According to a further embodiment, the primary clock can be provided by an internal oscillator of said microcontroller. According to a further embodiment, the internal oscillator can be an RC-oscillator with digital trimming capabilities.
According to another embodiment, a method for operating a microcontroller may comprise: Selecting a primary clock signal from a plurality of clock signals; feeding the primary clock signal to a numerical controlled oscillator; configuring the numerical controlled oscillator to generate a numerical controlled clock signal; and providing the numerical controlled clock signal as an internal system clock for the microcontroller.
According to a further embodiment of the method, the numerical oscillator may receive a reference clock r(x) and a numerical value q and provides an output clock, wherein the numerical value is provided by a register. According to a further embodiment of the method, the output clock f(q)=r(x)*A; wherein A is a numeric oscillator transfer function. According to a further embodiment of the method, the numerical oscillator transfer function may comprise an operation selected from an adding, a multiplying, a dividing, a subtracting, and a logarithmic function. According to a further embodiment of the method, the system clock can be used to operate the central processing core of the microcontroller. According to a further embodiment of the method, at least one other internal clock can be derived from the internal system clock. According to a further embodiment of the method, the numerical controlled oscillator may perform the step of: adding an increment value to an accumulator wherein the accumulator is being clocked by the primary clock signal having an input coupled; and generating an overflow output signal by the accumulator which provides said internal system clock signal. According to a further embodiment of the method, the method may further perform the steps: providing a plurality of external and internal clock signals, and selecting one of the plurality of external and internal clock signals or the output signal of the numerical controlled oscillator as the internal system clock. According to a further embodiment of the method, the primary clock can be provided by an internal oscillator of said microcontroller. According to a further embodiment of the method, the internal oscillator can be an RC-oscillator with digital trimming capabilities.
According to various embodiments, a different type of on-chip clock peripheral can be used to provide for a programmable clock source. For example a numerically controlled oscillator (NCO) according to various embodiments can be used as a digital source clock provider. According to various embodiments, a numerically controlled oscillator is a module with two inputs, a reference clock r(x) and a numeric value q.
In
For example, as a peripheral an NCO is known to provide the user with a fixed duty-cycle, frequency controlled output. For example, microcontroller PIC10F320 comprises an NCO peripheral to generate a signal with a fixed duty cycle or to provide a pulse width control. Such a signal can then be used in an application in which the microcontroller is used.
However, according to various embodiments, such a numerical controlled oscillator can also be used to provide a system clock. Hence a clock signal developed by the NCO can be applied to system clocks of a microcontroller.
The system clock is the clock which drives operation of the microcontroller module. The system clock is typically derived from an analog clock source such as a main oscillator which can be an internal oscillator or external oscillator. According to various embodiments, the primary clock signal of the main microcontroller oscillator is then tied into the NCO, which then drives the system clock from its output.
The NCO is a digital solution to the problem, where clock sources tend to be analog solutions (for example internal RC oscillators, crystal oscillators, etc.). Also, according to various embodiments, there are two needs that are being solved. One is a variable clock source that can be controlled digitally, which is accomplished by the NCO peripheral. The other is that internal clock frequencies of a microcontroller are binary multiples, so the step size between larger frequencies is larger and larger as frequency increases. The NCO can be applied to fill in the gaps between these frequency increases to allow the user to optimize performance issues like: power, specific frequency, etc.
NCO clocks could be applied to different modules individually to allow for programmable timings by the user. Thus, it can be used advantageously as a system clock, watchdog timer frequency source, peripheral clock source, etc. An NCO system clock allows users to optimize performance, choose intermediate frequencies from binary weighted values.
This application claims the benefit of U.S. Provisional Application No. 61/729,699 filed on Nov. 26, 2012, entitled “MICROCONTROLLER WITH DIGITAL CLOCK SOURCE”, which is incorporated herein in its entirety.
Number | Date | Country | |
---|---|---|---|
61729699 | Nov 2012 | US |