Patent ID: 12222746

DESCRIPTION

In the following extensive description, reference is made to the appended drawings, which form part of this description and in which, for the purposes of illustration, specific embodiments in which the disclosure can be carried out are shown. From this point of view, directional terminology such as “above”, “below”, “in front”, “behind”, “front”, “rear”, and so on is used with reference to the orientation of the figure(s) described. Since components of embodiments can be positioned in a number of different orientations, the directional terminology is used for illustration and is in no way restrictive. It goes without saying that other embodiments can be used and structural or logical changes can be made without departing from the protective scope of the present disclosure. It goes without saying that the features of the various exemplary embodiments described herein can be combined with one another, if not specifically otherwise stated. The following extensive description should therefore not be understood in the restrictive sense, and the protective scope of the present disclosure is defined by the appended claims.

Within the context of this description, the terms “connected”, “attached” and “coupled” are used to describe both a direct and also an indirect connection, a direct or indirect attachment and a direct or indirect coupling. In the figures, identical or similar elements are provided with identical designations, if this is expedient.

FIG.1andFIG.2each show a schematic illustration of a microcontroller100according to various exemplary embodiments. In the schematic illustrations, individual devices/circuits/elements of the microcontroller100and signals exchanged between them are illustrated. It should be understood that the devices/circuits/elements are coupled in a suitable way in order to transmit the signals, for example by means of appropriate electrically conductive connections.

Herein, various timing devices are described, which are typically also designated as a timing device or as a clock.

The microcontroller100can be set up to receive an external clock signal108, for example from an external timing device110which, for example, can be formed as a crystal or as another oscillator device.

To receive the external clock signal108, the microcontroller100can have at least one terminal contact106, for example two terminal contacts106, as illustrated inFIG.1andFIG.2.

The microcontroller100can further have an internal timing device102for generating an internal clock signal104. In various exemplary embodiments, the internal timing device102can expediently be formed (as indicated by way of example inFIG.2) as a “backup oscillator”. An internal timing device102with a backup oscillator function can be set up, for example, to provide an internal clock signal104(e.g. permanently), to which it is possible to resort in the event of failure of the useful clock signal (e.g. because of a missing external clock signal108and/or because of a fault in a clock changing device112(this is described in more detail below)). The internal clock signal104provided by the internal timing device102may typically be less precise and/or less stable in its properties than the external clock signal108, so that it may be unsuitable as a useful clock signal for permanent regular operation of the microcontroller100.

In various exemplary embodiments, the internal timing device102can be formed as an individual timing device—instead of as a backup oscillator or as an addition thereto.

In various exemplary embodiments, the microcontroller100also has a timer module114. The timer module114can, for example, have software and hardware modules and on the one hand can be set up to carry out timer module tasks which are usual, for example receiving and characterizing the internal clock signal104, providing a pulse width modulated signal, and so on. The timer module114can be set up to operate substantially independently of a (main) processor222, e.g. a CPU222, integrated in the microcontroller100.

On the other hand, the timer module114can be set up to provide the additional functions (and possibly further functions) explained in more detail herein.

In various exemplary embodiments, the timer module114can be electrically conductively connected to the at least one terminal contact106and to the internal timing device102. In particular, the electrically conductive (hardware) connection between an input of the timer module114and the at least one terminal contact106(accordingly at least one output of the external timing device110) can be novel as compared with microcontrollers100.

In various exemplary embodiments, the timer module114can be set up to determine a frequency of the external clock signal108after the microcontroller100has been switched on, for which purpose the timer module114can use the internal clock signal104.

In various exemplary embodiments, the microcontroller100can further have a clock changing device112. The clock changing device112can be connected (e.g. electrically conductively) to the at least one external terminal106, for example to receive the external clock signal108from the external timing device110.

The clock changing device112can be set up to change the external clock signal108such that it provides or can provide a useful clock signal116with predefined properties, in particular with at least a predefined frequency. The clock changing device112can, for example, have an oscillator, at least one clock divider, at least one phase-locked loop (PLL) and/or other and/or additional hardware and/or software elements, for example as known clock changing devices. In various exemplary embodiments, the at least one predefined frequency can be provided by the user, otherwise by the manufacturer. The at least one predefined frequency can, for example, have a (maximum) frequency at which, for example, a (main) processor222is to be operated during normal operation, and/or a frequency at which the main processor is to be operated in an energy-saving mode, and/or a frequency for operating peripheral devices. Furthermore, for example, an oversampling rate and/or further additional parameters can be provided and taken into account by the clock changing device112during the needs-based generation of the at least one useful clock signal116.

In various exemplary embodiments, the useful clock signal116can be fed to an optional clock signal distribution device118, which performs the distribution to devices and processes which need the useful clock signal116.

The timer module114can be set up, on the basis of the determined frequency of the external clock signal, to determine at least one parameter120by means of which the clock changing device112can be set up to change the external clock signal108into the useful clock signal116with the predefined frequency. The timer module114can provide the at least one determined parameter120to the clock changing device112.

The timer module114can be provided with all the parameters which it uses or needs to determine the at least one parameter120for setting up the clock changing device112while incorporating the determined frequency of the external clock signal.

One of the parameters which are provided to the timer module114can be a permissible range for the frequency of the external clock signal108. The permissible frequency range can be provided, for example, by the manufacturer, for example as a lower limiting frequency and an upper limiting frequency or, for example, only as an upper limiting frequency.

In various exemplary embodiments, additional parameters can be, for example, permissible wait state configurations and/or the frequency of the useful clock signal116. The frequency of the useful clock signal116can be retrieved from the timer module114or from the clock changing device112.

The additional parameters, for example the permissible range, the permissible wait state configurations and/or the frequency of the useful clock signal116can, for example, be stored in at least one memory, for example in at least one ROM, e.g. a flash memory or another type of non-volatile memory, e.g. at least one register, for example in a “User Configuration Block”, UCB, which can be written at the factory and/or by the user.

In the event of storage at the factory, the stored information can, if necessary, then be write-protected, so that a change by the user is prevented. In various exemplary embodiments, this may in particular be expedient for the permissible frequency range of the external clock signal108. The provision of the permissible wait state configurations and/or the frequency of the useful clock signal116by the manufacturer and/or by the user may be expedient, depending on the application.

The timer module114can retrieve the stored permissible range, for example when the microcontroller100is started or after it has been started. On the basis of a result of a comparison of the determined frequency with the permissible range, the timer module114can either determine the at least one parameter120and provide it to the clock changing device112(if a determined frequency lies in the permissible range) or (if a determined frequency lies outside the permissible range, which, for example, is provided by an unsupported crystal), carry out a predefined action, for example interrupting the regular starting/start-up process of the microcontroller100and triggering a further start-up in a specific mode, for example a mode in which the internal clock signal104is used as a timer, a locked mode, which prevents both changes and also a further start-up and, for example, can be overcome only by means of replacing the external timing device110by a reliable timing device110and switching on/starting up again or another relatively complicated process, and/or outputting a warning to the user, or additional or other predefined actions.

Various exemplary embodiments thus permit a user to be provided with a microcontroller100which can be set up with less effort, so that development time (and therefore costs) can be saved.

Furthermore, according to various exemplary embodiments, a boot-up time of the microcontroller100can be reduced, since the useful clock signal116can already be provided before the microcontroller100has been started up completely, i.e. during the execution of starting software.

Furthermore, according to various exemplary embodiments, outlay for checking software implemented by the user in the microcontroller100can be reduced, since all the parameters which have to be provided by the user in order to generate the useful clock signal116in the clock changing device112are determined by the microcontroller100itself, apart from the result to be achieved (e.g. the target frequency of the useful clock signal116).

According to various exemplary embodiments, an error rate of the microcontroller100is reduced, since fewer documents (or chapters) have to be read and understood and the microcontroller100is either operated with the maximum frequency that is possible for it or else (in the event that the external clock signal108is provided with an impermissible frequency) is even not operated at all.

The wait states can, for example, be set from the start (e.g. at the factory but possibly also by the user) such that they are designed for this maximum frequency.

Two of the main errors which are currently caused by the user during the operation of microcontrollers100can therefore be avoided, namely erroneous settings of the timing device(s) and erroneous settings of the wait states.

This additionally means that fewer requests for support and/or reports of damage, which would possibly cause a high outlay on determination and assistance, arise at the manufacturer.

Likewise, outlay on development and review by the user is reduced.

Clearly, preparation and progress of an initialization of a microcontroller100according to various exemplary embodiments can be described as follows.

1) Firstly, a suitable software function for executing the following initialization functions is added to start-up firmware of the microcontroller100.

2) A hardware connection is produced within the microcontroller in order to connect a timer signal pin (the terminal contact106) to an input of a timer module114.

3) The timer module114can be used to measure the frequency of the external timing device110(e.g. the connected oscillator or crystal).

4) Maximum permitted specification settings (e.g. a maximum permissible frequency of the clock signal108provided by the external timing device110) are read from a non-volatile memory in the microcontroller100, in which they may have been stored by the manufacturer.
5) Envisaged settings, if present, are read from a non-volatile memory within the microcontroller100, in which they may have been stored by the user. If no envisaged settings have been provided by the user, envisaged settings provided by the manufacturer can be used.
6) All the settings of the clock changing device112are calculated, for example, divider settings which are needed for the setting of the clock signal distribution and for the phase-locked loop(s).
7) The wait state configurations, which are needed for accesses to non-volatile memories, are calculated on the basis of information provided in a non-volatile memory by the manufacturer.
8) The wait states are initialized on the basis of the settings previously read.
9) The timing system (for example the clock changing device112) is initialized with the calculated setting.

FIG.3shows a flowchart300of a method for initializing a microcontroller according to various exemplary embodiments.

The method can include switching on the microcontroller (also designated as “power-on reset”, PORST) (310), initialization of an oscillator for starting up the microprocessor (320), execution of the various initialization tasks (330), a determination as to whether a crystal oscillator start-up period has elapsed (340), wherein the execution of the initialization tasks of330is repeated until the result from340states that the crystal oscillator start-up period has elapsed.

The timer module for measuring the frequency of the clock signal of the external crystal or an external oscillator is then set up (350), device specifications for timing conditions are read from a memory (e.g. from a “User Configuration Block”, UCB) (360) and a check is made (370) as to whether the memory contains user-specific timer configuration settings (e.g. under UCB_CLOCK). If this is so, the timer settings are retrieved from UCB_CLOCK (380B). If this is not so, a frequency provided in the memory (e.g. in the UCB) is retrieved as the target frequency of a useful clock signal (380A).

Then, the timing and wait state settings are set up (390) and various initialization tasks are executed (395). This completes the firmware start-up (399).

FIG.4shows a flowchart400of a method for initializing a microcontroller according to various exemplary embodiments.

The method can include a generation of an internal clock signal in a microcontroller-internal timing device (410), a determination by means of the internal clock signal (420) of a frequency of an external clock signal provided to the microcontroller, and a determination of at least one parameter by means of which the clock changing device can be set up to change the external clock signal into a useful clock signal with a predefined frequency (430).

Some exemplary embodiments are specified in summary below.

Exemplary embodiment 1 is a microcontroller which has an internal timing device for generating an internal clock signal, at least one terminal contact for receiving an external clock signal, a clock changing device and a timer module, which is electrically conductively connected to the at least one terminal contact and to the internal timing device and, after the microcontroller has been switched on, is set up to determine a frequency of the external clock signal by means of the clock signal, and to determine at least one parameter by means of which the clock changing device can be set up to change the external clock signal into at least one useful clock signal with a predefined frequency.

Exemplary embodiment 2 is a microcontroller according to exemplary embodiment 1, wherein the timer module is also set up to determine a permissibility of the frequency and, in the event of determining that the frequency is impermissible, to interrupt the starting process of the microcontroller.

Exemplary embodiment 3 is a microcontroller according to exemplary embodiments 1 or 2 which also has at least one storage device.

Exemplary embodiment 4 is a microcontroller according to exemplary embodiment 3, wherein the storage device is a non-volatile storage device.

Exemplary embodiment 5 is a microcontroller according to exemplary embodiment 3 or 4, wherein the timer module is also set up to store the at least one parameter in the at least one storage device.

Exemplary embodiment 6 is a microcontroller according to one of exemplary embodiments 3 to 5, wherein at least one permissibility parameter for the determination of the permissibility of the frequency is stored in the at least one storage device, for example by the manufacturer.

Exemplary embodiment 7 is a microcontroller according to one of exemplary embodiments 3 to 6, wherein the predefined frequency is stored in the at least one storage device, for example by the user.

Exemplary embodiment 8 is a microcontroller according to one of exemplary embodiments 1 to 7 which also has at least one main processor.

Exemplary embodiment 9 is a microcontroller according to exemplary embodiment 8 which is set up to generate the useful clock signal after the determination of the at least one parameter and to provide the useful clock signal to the main processor.

Exemplary embodiment 10 is a microcontroller according to one of exemplary embodiments 1 to 9, wherein the at least one parameter includes a clock divider parameter.

Exemplary embodiment 11 is a microcontroller according to one of exemplary embodiments 1 to 10, which is also set up to configure a phase-locked loop and/or a wait state on the basis of the at least one parameter.

Exemplary embodiment 12 is a method for initializing a microcontroller. The method includes generating an internal clock signal in a microcontroller-internal timing device, by means of the internal clock signal, determining the frequency of an external clock signal provided to the microcontroller and determining at least one parameter by means of which the clock changing device can be set up to change the external clock signal into a useful clock signal with a predefined frequency.

Exemplary embodiment 13 is a method according to exemplary embodiment 12, which also includes determining a permissibility of the frequency and, in the event of determining that the frequency is impermissible, interrupting a starting process of the microcontroller.

Exemplary embodiment 14 is a method according to exemplary embodiment 12 or 13 which also includes at least one storage device.

Exemplary embodiment 15 is a method according to exemplary embodiment 14, wherein the storage device is a non-volatile storage device.

Exemplary embodiment 16 is a method according to exemplary embodiment 14 or 15 which also includes storing the at least one parameter in the at least one storage device.

Exemplary embodiment 17 is a method according to one of exemplary embodiments 14 to 16 which also includes storing at least one permissibility parameter for the determination of the permissibility of the frequency in the at least one storage device, for example by the manufacturer.

Exemplary embodiment 18 is a method according to one of exemplary embodiments 14 to 17 which also includes storing the predefined frequency in the at least one storage device, for example by the user.

Exemplary embodiment 19 is a method according to one of exemplary embodiments 12 to 18, wherein the microcontroller also has at least one main processor.

Exemplary embodiment 20 is a method according to exemplary embodiment 19 which also includes generating the useful clock signal and providing the useful clock signal to the main processor following the determination of the at least one parameter.

Exemplary embodiment 21 is a method according to one of exemplary embodiments 12 to 20, wherein the at least one parameter includes a clock divider parameter.

Exemplary embodiment 22 is a method according to one of exemplary embodiments 12 to 21, which also includes configuring a phase-locked loop and/or a wait state on the basis of the at least one parameter.

Further advantageous refinements of the device can be gathered from the description of the method and vice versa.