Waveform generation
11016522 · 2021-05-25
Assignee
Inventors
- Rolf AMBÜHL (Trondheim, NO)
- Vemund Kval Bakken (Trondheim, NO)
- Fredrik Jakobsen Fagerheim (Trondheim, NO)
Cpc classification
G06F1/025
PHYSICS
G06F1/022
PHYSICS
International classification
G06F7/00
PHYSICS
Abstract
A digital microprocessor device (2) has: a central processing unit; a memory (8); and an output signal module (4). The output signal module comprises: a counter (6) arranged to count to a predetermined count value; and at least one comparator (10a, 10b, 10c) arranged to change an output signal (14a, 14b, 14c) from a first output state to a second output state when the counter reaches a predetermined comparator value. The output signal module is arranged to load automatically from the memory at least one parameter selected from the group comprising: the predetermined count value, the predetermined comparator value and the first output state or the second output state, without receipt of an instruction from the central processing unit.
Claims
1. A digital microprocessor device having: a central processing unit; a memory; and an output signal module, arranged to operate without using the central processing unit, the output signal module comprising: a counter arranged to count to a predetermined count value; and at least one comparator arranged to change an output signal from a first output state to a second output state when said counter reaches a predetermined comparator value; wherein said device has an operating cycle wherein the period of said operating cycle comprises a time between successive instances of the counter reaching the predetermined count value, wherein said output signal module is arranged to load automatically from said memory said predetermined count value without receipt of an instruction from said central processing unit; the device being arranged such that the predetermined count value can be changed in every cycle.
2. The device as claimed in claim 1, arranged to construct a sequence of different outputs.
3. The device as claimed in claim 2, arranged to repeat the sequence.
4. The device as claimed in claim 1, comprising a plurality of comparators.
5. The device as claimed in claim 4, arranged to generate a composite output signal using outputs from more than one of said comparators.
6. The device as claimed in claim 4, wherein the plurality of comparators are arranged to use said counter.
7. The device as claimed in claim 4, arranged such that values for one or both of the predetermined comparator value or a polarity of the output signal are loaded from the memory for each of the respective comparators.
8. The device as claimed in claim 1, wherein the memory comprises data corresponding to at least a first sequence portion, a second sequence portion and a delay between said first and second sequence portions, the device being arranged to execute said first sequence portion and then execute the second sequence portion after said delay.
9. The device as claimed in claim 1, wherein the memory comprises random access memory (RAM) used by the central processing unit.
10. The device as claimed in claim 1, comprising a further peripheral arranged to store a set of parameters into the memory.
11. The device as claimed in claim 10, wherein the further peripheral is arranged to communicate with the output signal module via a Peripheral-Peripheral Interface (PPI).
12. The device as claimed in claim 1, arranged such that the parameter(s) are loaded when a specific count value is reached.
13. The device as claimed in claim 12 wherein the specific count value is the predetermined count value.
Description
(1) Certain embodiments of the invention will now be described, by way of example only, with reference to the accompanying drawings in which:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10) Turning first to
(11) In use the decoder module 4 loads in data from the RAM 8. This includes values for the thresholds and polarities to be applied by the comparators 10a-c and the maximum value to which the counter 6 should count. The counter 6 increments its output by one every clock cycle (clock not shown) which is shown by the top trace 7 in
(12) Once the counter output 7 reaches the maximum value COUNTERTOP, also set from the RAM 4, it returns to zero (or some other minimum value). This causes all the comparator outputs 14a-c to reset high.
(13) The resultant waveforms in the lower portion of
(14)
(15)
(16) As previously mentioned, the waveforms of
(17) Subsequently, at time 38 indicated by a pulse in a pattern clock 40, the threshold is raised to a higher value 42. It may be seen that if this value were to be applied immediately, the counter output 26 would almost immediately reach it, which gives rise to the risk of a glitch occurring in the output 32. Alternatively, therefore, the lower value 26 is maintained until the counter output 28 next reaches zero as indicated by the dashed line 44. This feature ensures that no glitch does occur in the output 32. Accordingly, the output 32 goes high at time 46 as dictated by the previous threshold value 26. As the newer threshold value 42 is significantly higher than the old threshold value 26, the counter 28 takes longer to reach it and therefore the output 32 remains high for a longer period of time—until time 48. Correspondingly, the output 32 remains low only for a short period until the counter output 28 has counted down to the new, higher threshold 42 at time 50.
(18) This higher duty cycle output continues for two full cycles. When the next pulse 52 of the pattern clock 40 occurs, the threshold is changed again, in this case being reduced to zero. However, as before, the change is not implemented until the counter output 28 has next reached the zero level at time 54. Since the threshold is also zero, the output 32 goes low and remains low until a further change in the threshold occurs.
(19) It can be seen therefore that by changing the threshold value dynamically, a relatively complex waveform 32 can be achieved. However, by ensuring that a change in threshold is not applied until a known point in the cycle (in this example when the counter reaches zero) glitch-free operation can be ensured.
(20)
(21)
(22) In the example shown in
(23) Finally
(24) In an advantageous implementation of the invention, a sequence may be loaded from an event source that is asynchronous with respect to the counter using the Peripheral-Peripheral Interface (PPI) which is described in greater detail in WO 2013/088121. For example in the case of a dimmer for a light, every time a button is pressed a general purpose input/output (GPIO) event is generated and it is routed to a NEXTSTEP task associated with the decoder module 4. New parameters controlling the output are loaded form the RAM 8 and the brightness of an LED controlled by the output will change automatically without any CPU intervention.
(25) As will be appreciated by those skilled in the art, the embodiments of the invention set out above give a highly useful and flexible method of producing complex output sequences by loading a small number of data values directly from RAM without having to use the CPU. The ability for example to change the duty cycle, polarity, and/or maximum counter value at each step is particularly beneficial in providing this flexibility. As the skilled person will appreciate, by avoiding having to use the CPU, significant power savings can be achieved without sacrificing this flexibility. It will of course be understood that the principles of the invention may be implemented in many different ways and the described embodiments are merely examples of these.