JP6935691B2 - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP6935691B2
JP6935691B2 JP2017134558A JP2017134558A JP6935691B2 JP 6935691 B2 JP6935691 B2 JP 6935691B2 JP 2017134558 A JP2017134558 A JP 2017134558A JP 2017134558 A JP2017134558 A JP 2017134558A JP 6935691 B2 JP6935691 B2 JP 6935691B2
Authority
JP
Japan
Prior art keywords
duty
command
level
output
storage unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017134558A
Other languages
Japanese (ja)
Other versions
JP2019016974A (en
Inventor
裕理 堤
裕理 堤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2017134558A priority Critical patent/JP6935691B2/en
Publication of JP2019016974A publication Critical patent/JP2019016974A/en
Application granted granted Critical
Publication of JP6935691B2 publication Critical patent/JP6935691B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)

Description

本発明は、パルス幅変調信号(以下、PWM信号と称す)を生成する電子制御装置に関する。 The present invention relates to an electronic control device that generates a pulse width modulated signal (hereinafter referred to as a PWM signal).

従来、PWM信号を生成する電子制御装置は、CPUがPWMタイマのカウント動作を開始指示することで動作開始し、PWMタイマのカウント値がデューティ設定レジスタの記憶値に達したときにPWM信号のレベルを戻し、PWMタイマのカウント値が周期設定レジスタの記憶値に達したときにPWMタイマの一周期分のカウント動作を終了するように構成されている(例えば、特許文献1参照)。 Conventionally, an electronic control device that generates a PWM signal starts operation when the CPU gives an instruction to start counting operation of the PWM timer, and when the count value of the PWM timer reaches the stored value of the duty setting register, the level of the PWM signal Is returned, and when the count value of the PWM timer reaches the stored value of the cycle setting register, the counting operation for one cycle of the PWM timer is terminated (see, for example, Patent Document 1).

この特許文献1記載によれば、現在の周期を記憶する周期設定レジスタ(REGC)、次回のPWM用周期設定レジスタ(BFREGC)、デューティ設定レジスタ(REGD)、次回のPWM用デューティ設定レジスタ(BFREGD)、を備えており、次回のPWM用周期設定レジスタの記憶値を周期設定レジスタに転送したり、次回のPWM用デューティ設定レジスタの記憶値をデューティ設定レジスタに転送したりすることが可能になっている。 According to the description of Patent Document 1, a cycle setting register (REGC) for storing the current cycle, a cycle setting register for the next PWM (BFREGC), a duty setting register (REGD), and a duty setting register for the next PWM (BFREGD). , It is possible to transfer the stored value of the next PWM cycle setting register to the cycle setting register and transfer the stored value of the next PWM duty setting register to the duty setting register. There is.

特開2001−16081号公報Japanese Unexamined Patent Publication No. 2001-16081

ところで、この種の電子制御装置は、例えばアプリケーションなどの上位層からPWM信号の指令周期を保持したまま、即時出力固定要求(例えば、即時オン固定要求又は即時オフ固定要求)を受付けることがあり、これらの即時出力固定要求を受け付けると、即時にPWM信号の出力レベルを即時出力固定要求に応じた指令固定レベル(例えば、オンレベル、オフレベル)に強制的に変更させることが要望されている。 By the way, this kind of electronic control device may accept an immediate output fixed request (for example, an immediate on fixed request or an immediate off fixed request) while maintaining a command cycle of a PWM signal from an upper layer such as an application. Upon receiving these immediate output fixed requests, it is required to immediately forcibly change the output level of the PWM signal to the command fixed level (for example, on level, off level) corresponding to the immediate output fixed request.

しかしながら、発明者らが特許文献1記載の技術を用いて即時出力固定要求の技術を実現したものの、各種レジスタ(記憶部)に多数回アクセスする必要を生じており、複雑な制御を実行しなければならず、多大な処理時間を要することが判明している。このため、処理時間を極力少なくすることが望まれている。 However, although the inventors have realized the technique of immediate output fixed request by using the technique described in Patent Document 1, it is necessary to access various registers (storage units) many times, and complicated control must be executed. It has been found that it requires a large amount of processing time. Therefore, it is desired to reduce the processing time as much as possible.

本発明の目的は、各種記憶部に対し多数回アクセスしなくても良くなり、即時出力固定要求を受け付けたときにPWM信号の出力レベルを即時出力固定要求に応じた指令固定レベルに即座に設定できるようにした電子制御装置を提供することにある。 An object of the present invention is that it is not necessary to access various storage units many times, and when an immediate output fixed request is received, the output level of the PWM signal is immediately set to a command fixed level corresponding to the immediate output fixed request. The purpose is to provide an electronic control device that enables it.

請求項1記載の発明によれば、指令周期記憶部、現在デューティ記憶部、次回デューティ記憶部、カウンタ、出力部、エッジ極性切替部、及び次回デューティ値設定部、を備える。ここで指令周期記憶部はPWM信号の指令周期を記憶する。現在デューティ記憶部は、現在のPWM信号の指令デューティ値を記憶する。次回デューティ記憶部は、現在デューティ記憶部に記憶値を転送可能に構成され次回のPWM信号の指令デューティを記憶する。カウンタは、指令周期記憶部に記憶された指令周期に対応した周期カウント値までカウントする。 According to the invention of claim 1, the command cycle storage unit, the current duty storage unit, the next duty storage unit, the counter, the output unit, the edge polarity switching unit, and the next duty value setting unit are provided. Here, the command cycle storage unit stores the command cycle of the PWM signal. The current duty storage unit stores the command duty value of the current PWM signal. The next duty storage unit is configured to be able to transfer a stored value to the current duty storage unit, and stores the command duty of the next PWM signal. The counter counts up to the cycle count value corresponding to the command cycle stored in the command cycle storage unit.

出力部は、通常時、カウンタにより初期値からカウント開始した時に第1レベルとしカウンタのカウント値が現在デューティレジスタの指令デューティに応じたデューティ値に達した時に第2レベルとし、カウンタのカウント値が周期レジスタの指令周期に応じた周期カウント値に達した時に再度第1レベルとする。即時出力固定要求を受け付けたときには、エッジ極性切替部は指令周期記憶部にPWM信号の指令周期を保持したまま当該即時出力固定要求の指令固定レベルに応じて、出力部の出力レベルにライズ/フォールのエッジ極性の変更有無を切替える。そして、次回デューティ値設定部は、即時出力固定要求の指令固定レベルに応じた固定デューティ値を次回デューティ記憶部に設定するときにはエッジ極性切替部によるエッジ極性の変更有無に応じた固定デューティ値に設定するようにしている。 Normally, the output unit is set to the first level when the counter starts counting from the initial value, and is set to the second level when the counter count value reaches the duty value corresponding to the command duty of the current duty register, and the counter count value is set to the second level. When the cycle count value corresponding to the command cycle of the cycle register is reached, the first level is set again. When the immediate output fixed request is received, the edge polarity switching unit raises / falls to the output level of the output unit according to the command fixed level of the immediate output fixed request while holding the command cycle of the PWM signal in the command cycle storage unit. Toggles whether or not the edge polarity of is changed. Then, when the next duty value setting unit sets a fixed duty value according to the command fixed level of the immediate output fixed request in the next duty storage unit, the fixed duty value is set according to whether or not the edge polarity is changed by the edge polarity switching unit. I try to do it.

したがって、エッジ極性切替部によるエッジ極性の変更有無に応じた固定デューティ値を設定することでPWM信号の出力レベルを即時出力固定要求に応じた指令固定レベルに即座に設定できるようになり、各種記憶部(例えば、指令周期記憶部、現在デューティ記憶部、次回デューティ記憶部)に多数回アクセスする必要がなくなり、即時出力固定要求を受け付けたときにも指令固定レベルに即座に設定できるようになる。 Therefore, by setting the fixed duty value according to whether or not the edge polarity is changed by the edge polarity switching unit, the output level of the PWM signal can be immediately set to the command fixed level according to the immediate output fixed request, and various types of storage can be performed. It is no longer necessary to access the units (for example, the command cycle storage unit, the current duty storage unit, and the next duty storage unit) many times, and even when an immediate output fixed request is received, the command fixed level can be set immediately.

第1実施形態に係る電子制御装置の内部構成を概略的に示すブロック図Block diagram schematically showing the internal configuration of the electronic control device according to the first embodiment PWM制御部の内部構成を概略的に示すブロック図Block diagram schematically showing the internal configuration of the PWM control unit 通常のPWM出力回路の出力状態と各記憶部の値の変化を示すタイミングチャートTiming chart showing the output status of a normal PWM output circuit and the change in the value of each storage unit. 強制デューティマッチ設定時の流れを示すタイミングチャートTiming chart showing the flow when forced duty match is set 即時固定要求を受け付けたときに実行する処理内容を示すフローチャートFlowchart showing the processing content to be executed when an immediate fixed request is received 即時オン固定要求を受け付けたときのPWM出力回路の出力状態と各記憶部の値の変化を示すタイミングチャートTiming chart showing the output status of the PWM output circuit and the change in the value of each storage unit when an immediate on-fix request is received. 即時オフ固定要求を受け付けたときのPWM出力回路の出力状態と各記憶部の値の変化を示すタイミングチャートImmediate off Timing chart showing the output status of the PWM output circuit and the change in the value of each storage unit when a fixed request is received. 第2実施形態について、即時固定要求を受け付けた後に通常出力復帰要求を受け付けた場合の処理内容を示すフローチャートRegarding the second embodiment, a flowchart showing a processing content when a normal output return request is received after receiving an immediate fixed request. 即時オフ固定要求を受け付けた後に通常出力復帰要求を受け付けた場合のタイミングチャートImmediate off Timing chart when a fixed output request is accepted and then a normal output return request is accepted 即時オン固定要求を受け付けた後に通常出力復帰要求を受け付けた場合のタイミングチャートTiming chart when a normal output return request is received after receiving an immediate on fixed request

以下、本発明の電子制御装置の幾つかの実施形態について図面を参照しながら説明する。第2実施形態以降においては、第1実施形態と同一又は類似部分に同一又は類似符号を付して必要に応じて説明を省略し、第2実施形態以降では第1実施形態と異なる部分を中心に説明する。 Hereinafter, some embodiments of the electronic control device of the present invention will be described with reference to the drawings. In the second and subsequent embodiments, the same or similar parts as those in the first embodiment are designated by the same or similar reference numerals, and the description thereof will be omitted as necessary. Explain to.

(第1実施形態)
図1から図7は第1実施形態の説明図を示している。図1は車両に搭載された多数の電子制御装置(ECU)のうちの一部の電子制御装置1と、センサ2,3及びソレノイド4との接続関係を示している。
(First Embodiment)
1 to 7 show explanatory views of the first embodiment. FIG. 1 shows a connection relationship between a part of electronic control units 1 among a large number of electronic control units (ECUs) mounted on a vehicle, and sensors 2, 3 and solenoid 4.

電子制御装置1は、例えばエンジンECUとして機能するもので内部にマイクロコンピュータ(以下、マイコンと略す)5、入力回路6、及び出力回路7を備える。この電子制御装置1には車速センサ2及び回転数センサ3が接続されている。車速センサ2は、車両の速度に応じた信号を検出しこの検出信号を電子制御装置1に出力する。回転数センサ3は、クランクセンサ(図示せず)の回転数に応じた信号を検出しこの検出信号を電子制御装置1に出力する。 The electronic control device 1 functions as, for example, an engine ECU, and includes a microcomputer (hereinafter abbreviated as a microcomputer) 5, an input circuit 6, and an output circuit 7 inside. A vehicle speed sensor 2 and a rotation speed sensor 3 are connected to the electronic control device 1. The vehicle speed sensor 2 detects a signal corresponding to the speed of the vehicle and outputs this detection signal to the electronic control device 1. The rotation speed sensor 3 detects a signal corresponding to the rotation speed of the crank sensor (not shown) and outputs this detection signal to the electronic control device 1.

マイコン5は、制御指令主体となるCPU8、及び、このCPU8による指令を受けて実質的に制御するPWM制御部9を備え、さらにRAM、ROM、EEPROM等による記憶部(図示せず)を備える。この記憶部は非遷移的実態的記録媒体として用いられる。このマイコン5は、車速センサ2及び回転数センサ3から入力回路6を通じて検出信号をCPU8に入力し、CPU8は、記憶部に記憶されたプログラムに応じてソレノイド4をPWM駆動制御するために必要な値を演算処理する。CPU8は記憶部に記憶されたプログラムを実行することに応じて、次回デューティ値設定部、強制デューティマッチ設定部としての機能を実現する。CPU8は、この値をPWM制御部9に出力し、PWM制御部9は出力回路7を通じてPWM信号を出力しソレノイド4をPWM駆動制御する。 The microcomputer 5 includes a CPU 8 that is a main body of control commands, and a PWM control unit 9 that substantially controls by receiving commands from the CPU 8, and further includes a storage unit (not shown) by RAM, ROM, EEPROM, or the like. This storage unit is used as a non-transitional actual recording medium. The microcomputer 5 inputs a detection signal from the vehicle speed sensor 2 and the rotation speed sensor 3 to the CPU 8 through the input circuit 6, and the CPU 8 is required to PWM drive and control the solenoid 4 according to the program stored in the storage unit. Compute the value. The CPU 8 realizes functions as a next duty value setting unit and a forced duty match setting unit in response to executing a program stored in the storage unit. The CPU 8 outputs this value to the PWM control unit 9, and the PWM control unit 9 outputs a PWM signal through the output circuit 7 to control the solenoid 4 by PWM drive.

図2はPWM制御部9の内部構成を概略的に示すブロック図である。PWM制御部9は、指令周期記憶部及び現在周期記憶部としての現在周期レジスタ10、次回周期記憶部としての次回周期レジスタ11、現在デューティ記憶部としての現在デューティレジスタ12、次回デューティ記憶部としての次回デューティレジスタ13、タイマカウンタ(カウンタ相当)14、第1比較器15、第2比較器16、強制デューティマッチ指令記憶部としての強制デューティマッチ生成レジスタ17、エッジ極性切替部18、及び、出力部としてのPWM出力回路19、によるブロックを備える。 FIG. 2 is a block diagram schematically showing the internal configuration of the PWM control unit 9. The PWM control unit 9 includes a command cycle storage unit, a current cycle register 10 as a current cycle storage unit, a next cycle register 11 as a next cycle storage unit, a current duty register 12 as a current duty storage unit, and a next duty storage unit. Next time duty register 13, timer counter (counter equivalent) 14, first comparer 15, second comparer 16, forced duty match generation register 17 as forced duty match command storage unit, edge polarity switching unit 18, and output unit The block is provided by the PWM output circuit 19 as the above.

現在周期レジスタ10及び現在デューティレジスタ12はCPU8から直接的に読取可能であるものの書換不能なレジスタであり、次回周期レジスタ11及び次回デューティレジスタ13は書換可能なレジスタであり、次回周期レジスタ11の記憶値を現在周期レジスタ10に対し転送命令により転送可能になっており、次回デューティレジスタ13の記憶値を現在デューティレジスタ12に対し転送命令により転送可能になっている。 Period register 10 and the current duty register 12 now is a rewritable register of what can be directly read from the CPU 8, the next cycle register 11 and the next duty register 13 Ri rewritable register der, the next cycle register 11 The stored value can be transferred to the current cycle register 10 by a transfer command, and the stored value of the next duty register 13 can be transferred to the current duty register 12 by a transfer command.

このため、現在周期レジスタ10、現在デューティレジスタ12の記憶値を更新、書換えるためには、一旦、次回周期レジスタ11、次回デューティレジスタ13に値を書換えた後、これらのレジスタ11,13の値をそれぞれ現在周期レジスタ10、現在デューティレジスタ12にリロードする。 Therefore, in order to update and rewrite the stored values of the current cycle register 10 and the current duty register 12, once the values are rewritten to the next cycle register 11 and the next duty register 13, the values of these registers 11 and 13 are rewritten. Is reloaded into the current cycle register 10 and the current duty register 12, respectively.

タイマカウンタ14は、CPU8からクロック信号を入力するとカウントアップする。タイマカウンタ14は、入力されるクロック信号の立上り又は立下りエッジ発生回数をカウントする。第1比較器15は、タイマカウンタ14のカウンタ値と現在デューティレジスタ12の記憶値とを比較し、タイマカウンタ14のカウンタ値が現在デューティレジスタ12の記憶値を下回っているときには、通常時、第1レベル(例えば「1」)を比較結果としてエッジ極性切替部18に出力し、タイマカウンタ14のカウンタ値が現在デューティレジスタ12の記憶値以上になると、通常時、第2レベル(例えば「0」)を比較結果としてエッジ極性切替部18に出力する。 The timer counter 14 counts up when a clock signal is input from the CPU 8. The timer counter 14 counts the number of rising or falling edges of the input clock signal. The first comparator 15 compares the counter value of the timer counter 14 with the stored value of the current duty register 12, and when the counter value of the timer counter 14 is lower than the stored value of the current duty register 12, it is normally the first. When one level (for example, "1") is output to the edge polarity switching unit 18 as a comparison result and the counter value of the timer counter 14 becomes equal to or higher than the current storage value of the duty register 12, the second level (for example, "0") is normally used. ) Is output to the edge polarity switching unit 18 as a comparison result.

この第1比較器15は、強制デューティマッチ生成レジスタ17を強制デューティ指令記憶部として接続している。この強制デューティマッチ生成レジスタ17は、CPU8によりデューティマッチ指令用のフラグが設定されることに応じて、タイマカウンタ14のカウンタ値が現在デューティレジスタ12の記憶値よりも下回っていてもタイマカウンタ14のカウント値を現在デューティレジスタ12の指令デューティに強制的に見做しマッチさせる機能を備えており、第1比較器15の比較結果を第2レベル(例えば「0」)に変更してエッジ極性切替部18に出力する強制指令用のレジスタである。 The first comparator 15 connects the forced duty match generation register 17 as a forced duty command storage unit. In the forced duty match generation register 17, even if the counter value of the timer counter 14 is lower than the current storage value of the duty register 12, the timer counter 14 has a flag for the duty match command set by the CPU 8. It has a function to forcibly consider and match the count value with the command duty of the current duty register 12, and change the comparison result of the first comparator 15 to the second level (for example, "0") to switch the edge polarity. This is a compulsory command register to be output to unit 18.

第2比較器16は、タイマカウンタ14のカウンタ値と現在周期レジスタ10の記憶値とを比較し、例えばタイマカウンタ14のカウンタ値が現在周期レジスタ10の記憶値を下回っているときには、通常時、第2レベル(例えば「0」)を比較結果としてエッジ極性切替部18に出力し、タイマカウンタ14のカウンタ値が現在周期レジスタ10の記憶値以上になると、通常時、第1レベル(例えば「1」)を比較結果としてエッジ極性切替部18に出力する。エッジ極性切替部18は、CPU8から入力される極性切替命令によりライズ/フォールのエッジ極性を切替可能になっている。このエッジ極性切替部18は第1及び第2比較器15及び16の出力及び極性切替命令に応じて出力レベル「ON」「OFF」の何れかを設定しPWM出力回路19に出力する。 The second comparator 16 compares the counter value of the timer counter 14 with the stored value of the current cycle register 10, and when, for example, the counter value of the timer counter 14 is lower than the stored value of the current cycle register 10, the second comparator 16 is normally used. When the second level (for example, "0") is output to the edge polarity switching unit 18 as a comparison result and the counter value of the timer counter 14 becomes equal to or higher than the stored value of the current cycle register 10, the first level (for example, "1") is normally used. ”) Is output to the edge polarity switching unit 18 as a comparison result. The edge polarity switching unit 18 can switch the rise / fall edge polarity by a polarity switching command input from the CPU 8. The edge polarity switching unit 18 sets either the output level "ON" or "OFF" according to the output of the first and second comparators 15 and 16 and the polarity switching command, and outputs the output to the PWM output circuit 19.

このため、PWM出力回路19が設定された出力レベル(例えばオンレベル「ON」、オフレベル「OFF」)を出力すると、出力回路7は、この出力レベル「ON」「OFF」に対応した電圧をソレノイド4に印加することで当該ソレノイド4をPWM駆動制御できる。
前述した構成の動作の具体例について図3以降の図面を参照しながら説明する。
Therefore, when the PWM output circuit 19 outputs the set output level (for example, on level “ON”, off level “OFF”), the output circuit 7 outputs a voltage corresponding to the output levels “ON” and “OFF”. By applying the voltage to the solenoid 4, the solenoid 4 can be controlled by PWM drive.
A specific example of the operation of the above-described configuration will be described with reference to the drawings of FIGS. 3 and 3 onward.

<通常動作について>
通常時、CPU8が、次回周期レジスタ11及び次回デューティレジスタ13にそれぞれ値を設定し、現在周期レジスタ10、及び現在デューティレジスタ12に値が転送されると、PWM制御部9は、これらのレジスタ10〜13に記憶された値に基づいて動作しPWM信号を出力する。
<About normal operation>
Normally, when the CPU 8 sets values in the next cycle register 11 and the next duty register 13, and the values are transferred to the current cycle register 10 and the current duty register 12, the PWM control unit 9 sends these registers 10. It operates based on the values stored in ~ 13 and outputs a PWM signal.

例えば図3に示すように、CPU8が、次回周期レジスタ11にT、次回デューティレジスタ13にT/2を指令周期および指令デューティとして設定し、さらに、現在周期レジスタ10にT、現在デューティレジスタ12にT/2が転送された場合を例に挙げて説明する。前述したように、エッジ極性切替部18によるエッジ極性はライズ/フォールに切替設定可能になっているが、例では初期状態をライズエッジとする。 For example, as shown in FIG. 3, the CPU 8 sets T in the next cycle register 11 and T / 2 in the next duty register 13 as command cycles and command duties, and further sets T in the current cycle register 10 and T in the current duty register 12. The case where the T / 2 is transferred will be described as an example. As described above, the edge polarity by the edge polarity switching unit 18 can be switched and set to rise / fall, but in the example, the initial state is set to the rise edge.

タイマカウンタ14は、CPU8からクロック信号が与えられると初期値(例えば0)からカウントアップし、現在周期レジスタ10の記憶値Tに達するまでカウントする(図3の期間Ta,Tb等参照)。 When a clock signal is given from the CPU 8, the timer counter 14 counts up from the initial value (for example, 0) and counts until the stored value T of the current cycle register 10 is reached (see periods Ta, Tb, etc. in FIG. 3).

タイマカウンタ14がカウント開始すると、第2比較器16は、現在周期レジスタ10の記憶値Tとタイマカウンタ14のカウンタ値とを比較し、タイマカウンタ14のカウンタ値が現在周期レジスタ10の記憶値Tを下回るときに第2レベル「0」を出力する。第1比較器15は、現在デューティレジスタ12の記憶値T/2とタイマカウンタ14のカウンタ値とを比較し、タイマカウンタ14のカウンタ値が現在デューティレジスタ12の記憶値T/2を下回るときに第1レベル「1」を出力する。このため、エッジ極性切替部18は、第1比較器15により出力される第1レベル「1」をライズエッジ出力することでオンレベル「ON」を出力し、これに応じて、PWM出力回路19はオンレベル「ON」を出力する(図3の期間Ta参照)。 When the timer counter 14 starts counting, the second comparator 16 compares the stored value T of the current cycle register 10 with the counter value of the timer counter 14, and the counter value of the timer counter 14 is the stored value T of the current cycle register 10. The second level "0" is output when the value falls below. The first comparator 15 compares the current storage value T / 2 of the duty register 12 with the counter value of the timer counter 14, and when the counter value of the timer counter 14 is lower than the current storage value T / 2 of the duty register 12. The first level "1" is output. Therefore, the edge polarity switching unit 18 outputs the on-level “ON” by outputting the rise edge of the first level “1” output by the first comparator 15, and in response to this, the PWM output circuit 19 Outputs the on-level "ON" (see period Ta in FIG. 3).

タイマカウンタ14のカウント値がT/2に達すると、この値T/2が現在デューティレジスタ12の記憶値T/2に一致するため、第1比較器15は第2レベル「0」を出力する。なお、タイマカウンタ14のカウント値が、デューティに対応した値に一致することを、以下では必要に応じて「デューティマッチ」と称する。 When the count value of the timer counter 14 reaches T / 2, this value T / 2 currently matches the stored value T / 2 of the duty register 12, so that the first comparator 15 outputs the second level "0". .. It should be noted that the fact that the count value of the timer counter 14 matches the value corresponding to the duty is hereinafter referred to as "duty match" as necessary.

エッジ極性切替部18は、第1比較器15により出力される第2レベル「0」をライズエッジ出力することでオフレベル「OFF」を出力し、これに応じて、PWM出力回路19はオフレベル「OFF」を出力する。これにより、タイマカウンタ14のカウンタ値が、現在デューティレジスタ12の指令デューティに応じたデューティ値T/2に達した時にオフレベル「OFF」を出力する(図3の期間Tb参照)。 The edge polarity switching unit 18 outputs an off level “OFF” by outputting a rise edge of the second level “0” output by the first comparator 15, and the PWM output circuit 19 corresponds to the off level. Output "OFF". As a result, when the counter value of the timer counter 14 reaches the duty value T / 2 corresponding to the command duty of the duty register 12, the off level “OFF” is output (see the period Tb in FIG. 3).

さらに、タイマカウンタ14のカウント値がTに達すると、この値Tが現在周期レジスタ10の記憶値Tに一致するため、第2比較器16が第1レベル「1」を出力する。なお、タイマカウンタ14のカウント値が、周期に対応した値に一致することを、以下では必要に応じて「周期マッチ」と称する。 Further, when the count value of the timer counter 14 reaches T, this value T matches the stored value T of the current cycle register 10, so that the second comparator 16 outputs the first level “1”. It should be noted that the fact that the count value of the timer counter 14 matches the value corresponding to the cycle is hereinafter referred to as "cycle match" as necessary.

タイマカウンタ14は、この第2比較器16の出力レベル「1」を入力し、タイマカウンタ14を初期値(例えば0)にクリアする。CPU8は、このクロック信号のカウント値Tを計数して周期マッチすると、一周期経過したと判断し、次回周期レジスタ11の記憶値を現在周期レジスタ10にリロードさせると共に、次回デューティレジスタ13の記憶値を現在デューティレジスタ12にリロードさせる。 The timer counter 14 inputs the output level “1” of the second comparator 16 and clears the timer counter 14 to an initial value (for example, 0). When the CPU 8 counts the count value T of this clock signal and makes a cycle match, it determines that one cycle has elapsed, reloads the stored value of the next cycle register 11 into the current cycle register 10, and reloads the stored value of the next duty register 13. Is currently reloaded into the duty register 12.

したがって、通常時には、タイマカウンタ14が初期値0からカウントをスタートすると、PWM出力回路19は、初期値からカウント開始した時に第1レベル「1」としタイマカウンタ14のカウント値が現在デューティレジスタ12の指令デューティに応じたデューティ値に達した時に第2レベル「0」とし、タイマカウンタ14のカウント値が現在周期レジスタ10の指令周期Tに応じた周期カウント値に達した時に再度第1レベル「1」を出力する。 Therefore, normally, when the timer counter 14 starts counting from the initial value 0, the PWM output circuit 19 sets the first level to "1" when counting starts from the initial value, and the count value of the timer counter 14 is currently set to the duty register 12. When the duty value corresponding to the command duty is reached, the second level is set to "0", and when the count value of the timer counter 14 reaches the cycle count value corresponding to the command cycle T of the current cycle register 10, the first level "1" is set again. Is output.

したがって、図3の期間Ta、Tbの中で、次回デューティレジスタ13が値T/2に設定されているときには、期間Tcの始期に、次回デューティレジスタ13の値T/2が現在デューティレジスタ12に転送されることになり、PWM出力回路19は、期間Tc,Tdにおいても周期T、デューティ値T/2(デューティ比50%)のPWM信号を出力する。 Therefore, in the periods Ta and Tb of FIG. 3, when the next duty register 13 is set to the value T / 2, the value T / 2 of the next duty register 13 becomes the current duty register 12 at the beginning of the period Tc. The PWM output circuit 19 outputs a PWM signal having a period T and a duty value T / 2 (duty ratio 50%) even during the periods Tc and Td.

CPU8は、期間Tcまたは期間Tdにおいて次回デューティレジスタ13に値T/4を設定すると、その次のPWM信号の出力期間Te,Tfにおいて、この次回デューティレジスタ13の値T/4が現在デューティレジスタ12に転送されることになる。このため、PWM出力回路19は、期間Te,Tfにおいて周期T、デューティ値T/4(デューティ比25%)のPWM信号を出力する。 When the CPU 8 sets the value T / 4 in the next duty register 13 in the period Tc or the period Td, the value T / 4 of the next duty register 13 is the current duty register 12 in the output periods Te and Tf of the next PWM signal. Will be transferred to. Therefore, the PWM output circuit 19 outputs a PWM signal having a period T and a duty value T / 4 (duty ratio 25%) in the periods Te and Tf.

なお、ここでは詳細説明を省略するが、CPU8が次回周期レジスタ11に値Tとは異なる値(例えば2・Tとする)を設定することで、次周期のPWM信号の出力開始タイミングにおいて、この次回周期レジスタ11の値2・Tが現在周期レジスタ10にリロードされる。このとき、PWM出力回路19は、周期2・TのPWM信号を出力することになる。 Although detailed description is omitted here, the CPU 8 sets a value different from the value T (for example, 2.T) in the next cycle register 11 at the output start timing of the PWM signal in the next cycle. The value 2 · T of the next cycle register 11 is reloaded into the current cycle register 10. At this time, the PWM output circuit 19 outputs a PWM signal having a period of 2 · T.

<強制デューティマッチの基本的機能>
CPU8が強制デューティマッチ生成レジスタ17にフラグ設定すると、第1比較器15は、この強制デューティマッチ生成レジスタ17のセットフラグに応じてタイマカウンタ14と現在デューティレジスタ12のコンペアマッチを強制的に発生させることができる。
<Basic function of forced duty match>
When the CPU 8 sets a flag in the forced duty match generation register 17, the first comparator forcibly generates a compare match between the timer counter 14 and the current duty register 12 according to the set flag of the forced duty match generation register 17. be able to.

したがって図4に示すように、PWM出力回路19がオンレベル「ON」を出力しているときに、CPU8が強制デューティマッチ生成レジスタ17にフラグセットすると、第1比較器15の比較結果に拘わらず、第1比較器15は強制的に第2レベル「0」を出力するようになり、エッジ極性切替部18は、第1比較器15の出力「0」をライズエッジ極性として出力することでオフレベル「OFF」を出力し、これに応じて、PWM出力回路19はオフレベル「OFF」を次回のPWM信号を発生開始させるまで出力し続ける。これにより、特に次回デューティレジスタ13に次回の値を設定することなく出力レベルをオフレベル「OFF」に固定でき、特に固定オフレベル「OFF」を出力するときに即時性が要求されるときには都合がよい。なお、この強制デューティマッチ生成レジスタ17のフラグは、強制デューティマッチ設定処理を終了することでハードウェア的に即時クリアされる(図4のFlagSET参照)。 Therefore, as shown in FIG. 4, when the CPU 8 sets the flag in the forced duty match generation register 17 while the PWM output circuit 19 is outputting the on-level “ON”, regardless of the comparison result of the first comparator 15. , The first comparator 15 forcibly outputs the second level "0", and the edge polarity switching unit 18 turns off by outputting the output "0" of the first comparator 15 as the rise edge polarity. The level "OFF" is output, and in response to this, the PWM output circuit 19 continues to output the off level "OFF" until the next PWM signal is started to be generated. As a result, the output level can be fixed to the off level "OFF" without setting the next value in the duty register 13 next time, which is particularly convenient when immediacy is required when outputting the fixed off level "OFF". good. The flag of the forced duty match generation register 17 is immediately cleared in terms of hardware by ending the forced duty match setting process (see FlagSET in FIG. 4).

<即時固定要求に応じた出力レベル固定機能>
前述のとおり、CPU8が、強制デューティマッチ生成レジスタ17にフラグ設定すると、タイマカウンタ14と現在デューティレジスタ12とのコンペアマッチを強制的に発生させることができるが、PWM出力回路19がオフレベル「OFF」を出力しているときにオンレベル「ON」の出力に強制的に切替える場合には、強制デューティマッチ生成レジスタ17にフラグ設定しても、第1比較器15は第2レベル「0」を強制的に出力し続けることになりPWM出力回路19はオフレベル「OFF」を出力し続けることになってしまう。
<Output level fixing function according to immediate fixing request>
As described above, when the CPU 8 sets a flag in the forced duty match generation register 17, a compare match between the timer counter 14 and the current duty register 12 can be forcibly generated, but the PWM output circuit 19 is turned off. When the output is forcibly switched to the on-level "ON" output while the "" is being output, the first comparator 15 sets the second level "0" even if the flag is set in the forced duty match generation register 17. The output will be forcibly continued, and the PWM output circuit 19 will continue to output the off level "OFF".

このため本実施形態では利便性を高めるため、アプリケーションによる上位層からの即時固定要求の指令固定レベルのオンレベル「ON」,オフレベル「OFF」の何れにも対応するため、CPU8は、図5のフローチャートに示す処理を実行する。 Therefore, in order to improve convenience in the present embodiment, the CPU 8 corresponds to both the on-level “ON” and the off-level “OFF” of the command fixed level of the immediate fixing request from the upper layer by the application. Execute the process shown in the flowchart of.

まず図5に示すように、CPU8は、即時固定要求の指令固定レベルがオンレベル「ON」であるか、オフレベル「OFF」であるかを判定する(S100)。このときCPU8は、S100において指令固定レベルがオンレベル「ON」であれば、一旦、デューティ比を100%に設定し(S101)てから、S103に移行する。すなわち、現在周期レジスタ10の記憶値が値Tに設定されていれば、CPU8は、この周期の値Tのデューティ比100%に対応するデューティ値Tを次回デューティレジスタ13にセットしてからS103に移行する。逆にCPU8は、S100において指令固定レベルがオフレベル「OFF」であれば、デューティ比を0%に設定し(S102)てから、S103に移行する。すなわちCPU8は、S102において次回デューティレジスタ13に値0をセットしてS103に移行する。 First, as shown in FIG. 5, the CPU 8 determines whether the command fixed level of the immediate fixing request is the on level “ON” or the off level “OFF” (S100). At this time, if the command fixed level is the ON level "ON" in S100, the CPU 8 once sets the duty ratio to 100% (S101), and then shifts to S103. That is, if the stored value of the current cycle register 10 is set to the value T, the CPU 8 sets the duty value T corresponding to the duty ratio 100% of the value T of this cycle to the next duty register 13 and then sets it to S103. Transition. On the contrary, if the command fixed level is the off level "OFF" in S100, the CPU 8 sets the duty ratio to 0% (S102) and then shifts to S103. That is, the CPU 8 sets the value 0 in the duty register 13 next time in S102 and shifts to S103.

<S103の処理時点にて余裕時間を確保できない場合>
ここでCPU8は、S103の処理を実行している時点で、周期マッチまでの時間が予め定められた余裕時間以上あるか否かを判定し(S103)、余裕時間以上なければ(NO)、この処理ルーチンを抜け、次回周期レジスタ11及び次回デューティレジスタ13の転送処理まで待機する。ここで、この「余裕時間以上ある」条件とは、「次回の周期マッチの予定時刻から現在時刻を減算した時間」と「設定に必要な時間」とを比較して前者が後者の時間以上ある条件を示している。
<When the spare time cannot be secured at the time of processing S103>
Here, the CPU 8 determines whether or not the time until the periodic match is equal to or longer than the predetermined margin time (S103) at the time of executing the process of S103, and if it is not longer than the margin time (NO), this It exits the processing routine and waits until the transfer processing of the next cycle register 11 and the next duty register 13. Here, the condition that "there is more than the margin time" is that the former is more than the latter time by comparing "the time obtained by subtracting the current time from the scheduled time of the next periodic match" and "the time required for setting". The conditions are shown.

一旦処理ルーチンを抜けて転送処理に移行すると、次周期のPWM信号の出力開始タイミングにおいて、次回周期レジスタ11及び次回デューティレジスタ13の値が、それぞれ現在周期レジスタ10及び現在デューティレジスタ12にリロードされる。 Once the processing routine is exited and the transfer processing is started, the values of the next cycle register 11 and the next duty register 13 are reloaded into the current cycle register 10 and the current duty register 12, respectively, at the output start timing of the PWM signal in the next cycle. ..

これによりPWM出力回路19は、デューティ比100%又は0%のPWM信号、すなわちオンレベル「ON」又はオフレベル「OFF」を固定的に出力する。CPU8は、周期マッチまでの時間<余裕時間となるときに、少なくとも次回のPWM信号の出力開始タイミングにて即時固定要求に応えることができ、この固定レベル「ON」又は「OFF」を出力できるようになる。 As a result, the PWM output circuit 19 fixedly outputs a PWM signal having a duty ratio of 100% or 0%, that is, an on-level “ON” or an off-level “OFF”. The CPU 8 can respond to an immediate fixed request at least at the next PWM signal output start timing when the time until the periodic match <the margin time, and can output this fixed level "ON" or "OFF". become.

<S103の処理時点にて余裕時間を確保できる場合>
他方CPU8は、S103の処理を実行している時に、周期マッチまでの時間が余裕時間以上ある場合には(S103:YES)、設定されているデューティ比に応じた処理を実行する(S105a,S106a,S107:S105b,S106b)。
<When a margin time can be secured at the time of processing S103>
On the other hand, when the processing of S103 is being executed, if the time until the periodic match is longer than the margin time (S103: YES), the CPU 8 executes the processing according to the set duty ratio (S105a, S106a). , S107: S105b, S106b).

<<即時固定要求の指令固定レベルがオンレベル「ON」の場合:図6>>
図5において、指令固定レベルがオンレベル「ON」であり、S101においてデューティ比が100%に設定されたときには、CPU8はS104にてYESと判定し、エッジ極性切替部18に極性変更指令し(S105a)、エッジ極性変更フラグをオンし(S106a)、次回のデューティ比を0%に対応したタイマカウンタ14の値、すなわち値0に設定し(S107)、強制デューティマッチ生成レジスタ17にフラグ設定する(S108)。
<< When the command fixed level of the immediate fixing request is on level "ON": Fig. 6 >>
In FIG. 5, when the command fixed level is the on level “ON” and the duty ratio is set to 100% in S101, the CPU 8 determines YES in S104 and issues a polarity change command to the edge polarity switching unit 18 ( S105a), turn on the edge polarity change flag (S106a), set the next duty ratio to the value of the timer counter 14 corresponding to 0%, that is, the value 0 (S107), and set the flag in the forced duty match generation register 17. (S108).

CPU8はS105aにおいてエッジ極性変更指令すると、図6に示すように、エッジ極性切替部18はライズエッジをフォールエッジに切替変更する。そしてCPU8は、S106aにおいてエッジ極性変更フラグをオンし、S107においてデューティ比を0%に設定するため次回デューティレジスタ13に値0をセットする。そしてCPU8は、S108において強制デューティマッチ生成レジスタ17にフラグ設定すると、第1比較器15の比較結果に拘わらず、第1比較器15は強制的に第2レベル「0」を出力する。エッジ極性切替部18は、第1比較器15の出力レベル「0」をフォールエッジ出力することでオンレベル「ON」を出力し、これに応じてPWM出力回路19はオンレベル「ON」を出力する(図6のタイミングt1参照)。なお、この強制デューティマッチ生成レジスタ17のフラグはハードウェア的に即時クリアされる。 When the CPU 8 gives an edge polarity change command in S105a, as shown in FIG. 6, the edge polarity switching unit 18 switches and changes the rise edge to the fall edge. Then, the CPU 8 turns on the edge polarity change flag in S106a, and sets the value 0 in the next duty register 13 in order to set the duty ratio to 0% in S107. Then, when the CPU 8 sets a flag in the forced duty match generation register 17 in S108, the first comparator 15 forcibly outputs the second level "0" regardless of the comparison result of the first comparator 15. The edge polarity switching unit 18 outputs the on-level “ON” by outputting the output level “0” of the first comparator 15 as a fall edge, and the PWM output circuit 19 outputs the on-level “ON” accordingly. (See timing t1 in FIG. 6). The flag of the forced duty match generation register 17 is cleared immediately in terms of hardware.

この後、次の周期マッチのときには、図6のタイミングt2に示すように、次回デューティレジスタ13の記憶値0が現在デューティレジスタ12にリロードされデューティ比が0%とされ、このタイミングt2以降においても、即時固定要求に応じて出力されているオンレベル「ON」が継続して出力され続ける。 After that, at the time of the next cycle match, as shown in the timing t2 of FIG. 6, the stored value 0 of the next duty register 13 is reloaded to the current duty register 12 and the duty ratio is set to 0%, and even after this timing t2. , The on-level "ON" that is output in response to the immediate fixed request continues to be output.

これにより、即時固定要求の指令固定レベルのオンレベル「ON」に応じて、PWM出力回路19はオンレベル「ON」を出力し続ける。このように、オンレベル「ON」を出力し続けるとき、現在周期レジスタ10および次回周期レジスタ11は変更されないため、要求受付時の指令周期Tを保ったまま、周期マッチを繰り返すことになる。 As a result, the PWM output circuit 19 continues to output the on-level "ON" in response to the on-level "ON" of the command fixed level of the immediate fixing request. In this way, when the on-level "ON" is continuously output, the current cycle register 10 and the next cycle register 11 are not changed, so that the cycle match is repeated while maintaining the command cycle T at the time of receiving the request.

<<即時固定要求の指令固定レベルがオフレベル「OFF」の場合:図7>>
図5において、指令固定レベルがオフレベル「OFF」であるときに、S102においてデューティ比が0%に設定されているときには、この指令固定レベル「OFF」が実際にPWM出力回路19が出力しているオフレベル「OFF」と等しくなる。このためエッジ極性切替部18によるエッジ切替処理は不要となる。
<< When the command fixing level of the immediate fixing request is the off level "OFF": Fig. 7 >>
In FIG. 5, when the command fixed level is the off level “OFF” and the duty ratio is set to 0% in S102, the command fixed level “OFF” is actually output by the PWM output circuit 19. Equal to the off level "OFF". Therefore, the edge switching process by the edge polarity switching unit 18 becomes unnecessary.

したがってCPU8は、エッジ極性切替部18による極性を保持し(S105b:破線記載)、エッジ極性変更フラグをオフのままとする(S106b:破線記載)。この破線記載部分はプログラムコード上で示されることはなく実質的に処理時間を要することはない。そしてCPU8は強制デューティマッチ生成レジスタ17にフラグ設定する(S108)。 Therefore, the CPU 8 maintains the polarity by the edge polarity switching unit 18 (S105b: described with a broken line), and leaves the edge polarity change flag off (S106b: described with a broken line). The portion described by the broken line is not shown on the program code, and the processing time is substantially not required. Then, the CPU 8 sets a flag in the forced duty match generation register 17 (S108).

CPU8は、S105bにてエッジ極性を保持し、S106bにて極性変更フラグをオフのまま保持し、S108において強制デューティマッチ生成レジスタ17にフラグをセットする。すると、第1比較器15の比較結果に拘わらず、第1比較器15は強制的に第2レベル「0」を出力するようになり、エッジ極性切替部は、第1比較器15の出力「0」をライズエッジ出力することでオフレベル「OFF」を出力し続ける。これに応じてPWM出力回路19はオフレベル「OFF」を出力する(図7のタイミングt3参照)。 The CPU 8 holds the edge polarity in S105b, keeps the polarity change flag off in S106b, and sets the flag in the forced duty match generation register 17 in S108. Then, regardless of the comparison result of the first comparator 15, the first comparator 15 forcibly outputs the second level "0", and the edge polarity switching unit outputs the output "0" of the first comparator 15. By outputting "0" as a rise edge, the off-level "OFF" is continuously output. In response to this, the PWM output circuit 19 outputs an off level “OFF” (see timing t3 in FIG. 7).

この後、次の周期マッチのときには、次回デューティレジスタ13の値0が現在デューティレジスタ12にリロードされ、その後においてもオフレベル「OFF」が出力され続けることになる(図7のタイミングt4以降参照)。これにより即時オフ固定要求に応じてPWM出力回路19がオフレベル「OFF」を出力し続けることになる。このようにオフレベル「OFF」を出力し続けるときもまた、現在周期レジスタ10および次回周期レジスタ11は変更されないため、要求受付時の指令周期Tを保ったまま周期マッチを繰り返すことになる。 After that, at the time of the next cycle match, the value 0 of the next duty register 13 is reloaded to the current duty register 12, and the off level "OFF" continues to be output even after that (see the timing t4 and later in FIG. 7). .. As a result, the PWM output circuit 19 continues to output the off level "OFF" in response to the immediate off fixing request. Even when the off-level "OFF" is continuously output in this way, the current cycle register 10 and the next cycle register 11 are not changed, so that the cycle match is repeated while maintaining the command cycle T at the time of receiving the request.

このように、CPU8が更新設定すべきレジスタが、次回デューティレジスタ13、エッジ極性切替部18の設定レジスタ、強制デューティマッチ生成レジスタ17だけであり、レジスタのアクセス回数を減らすことができると共に制御を簡素化でき、現在周期レジスタ10および現在デューティレジスタ12に書換不能なマイコン5を採用した場合においても、現在周期Tを固定しながら即時出力固定要求に即時対応できるようになる。 In this way, the only registers that the CPU 8 should update and set are the next duty register 13, the setting register of the edge polarity switching unit 18, and the forced duty match generation register 17, so that the number of register accesses can be reduced and control is simplified. Even when a non-rewritable microcomputer 5 is used for the current cycle register 10 and the current duty register 12, it is possible to immediately respond to an immediate output fixed request while fixing the current cycle T.

<本実施形態の概念的なまとめ>
要するに、本実施形態によれば次のような構成、作用効果を備える。現在周期レジスタ10はPWM信号の指令周期(例えばT)を記憶しており、現在デューティレジスタ10は現在のPWM信号の指令デューティ(例えばT/2)を記憶している。次回デューティレジスタ13は、現在デューティレジスタ12に記憶値を転送可能に構成されている。タイマカウンタ14は、現在周期レジスタ10に記憶された指令周期に対応した周期カウント値(例えばT)までカウントする。
<Conceptual summary of this embodiment>
In short, according to the present embodiment, it has the following configuration and action / effect. The current cycle register 10 stores the command cycle (for example, T) of the PWM signal, and the current duty register 10 stores the command duty (for example, T / 2) of the current PWM signal. The next duty register 13 is currently configured to be able to transfer a stored value to the duty register 12. The timer counter 14 counts up to a cycle count value (for example, T) corresponding to the command cycle stored in the current cycle register 10.

通常時、PWM出力回路19は、タイマカウンタ14が初期値からカウント開始した時にオンレベル「ON」とし、このタイマカウンタ14のカウント値が指令デューティに応じたデューティ値(例えばT/2)に達した時に再度オフレベル「OFF」とする。さらにタイマカウンタ14のカウント値が現在周期レジスタ10の指令周期Tに応じた周期カウント値Tに達した時に再度オンレベル「ON」を出力する。 Normally, the PWM output circuit 19 sets the ON level to "ON" when the timer counter 14 starts counting from the initial value, and the count value of the timer counter 14 reaches a duty value (for example, T / 2) according to the command duty. When it is done, the off level is set to "OFF" again. Further, when the count value of the timer counter 14 reaches the cycle count value T corresponding to the command cycle T of the current cycle register 10, the ON level “ON” is output again.

またエッジ極性切替部18は、即時出力固定要求を受け付けたときに現在周期レジスタ10にPWM信号の指令周期Tを保持したまま当該即時出力固定要求の指令固定レベルに応じて、出力レベルのライズ/フォールのエッジ極性の変更有無を切替える(S105a,S105b)。 Further, when the edge polarity switching unit 18 receives the immediate output fixed request, the edge polarity switching unit 18 raises the output level according to the command fixed level of the immediate output fixed request while holding the command cycle T of the PWM signal in the current cycle register 10. Whether or not the edge polarity of the fall is changed is switched (S105a, S105b).

そしてCPU8は、指令固定レベル「ON」「OFF」に応じた固定デューティ値を次回デューティレジスタ13に設定するが、この固定デューティ値を設定するときにはエッジ極性切替部18によるエッジ極性の変更有無に応じた固定デューティ値「0」を次回デューティレジスタ13に設定している(S102,S107)。 Then, the CPU 8 sets a fixed duty value according to the command fixed level “ON” or “OFF” in the next duty register 13, but when setting this fixed duty value, it depends on whether or not the edge polarity is changed by the edge polarity switching unit 18. The fixed duty value "0" is set in the next duty register 13 (S102, S107).

例えば、指令固定レベルがオンレベル「ON」であるときには、エッジ極性切替部18によりエッジ極性をフォールエッジに変更しつつ(S105a)、次回デューティレジスタ13に固定デューティ値「0」を設定している(S107)。逆に、例えば指令固定レベルがオフレベル「OFF」であるときには、エッジ極性切替部18によりエッジ極性をライズエッジに保持しつつ(S105b)、次回デューティレジスタ13に固定デューティ値「0」を設定している(S102)。このため、指令固定レベル「ON」「OFF」を受け付けたときにエッジ極性の変更有無に応じた指令デューティ値「0」を次回デューティレジスタ13に設定することで、PWM出力回路19によるPWM信号の出力レベルをそれぞれオンレベル「ON」又はオフレベル「OFF」に固定できる。 For example, when the command fixed level is the on level “ON”, the edge polarity switching unit 18 changes the edge polarity to the fall edge (S105a), and sets the fixed duty value “0” in the next duty register 13. (S107). On the contrary, for example, when the command fixed level is the off level "OFF", the fixed duty value "0" is set in the next duty register 13 while holding the edge polarity at the rise edge by the edge polarity switching unit 18 (S105b). (S102). Therefore, by setting the command duty value "0" according to whether or not the edge polarity is changed when the command fixed levels "ON" and "OFF" are received in the next duty register 13, the PWM signal by the PWM output circuit 19 can be obtained. The output level can be fixed to the on level "ON" or the off level "OFF", respectively.

これにより、エッジ極性切替部18によりエッジ極性を必要に応じて変更すると共に、次回デューティレジスタ13に固定デューティ値「0」を設定することでPWM信号の出力レベルを即座にオンレベル「ON」又はオフレベル「OFF」に固定できる。これにより、レジスタへのアクセス回数を少なくすることができ処理速度を向上できる。 As a result, the edge polarity is changed as necessary by the edge polarity switching unit 18, and the output level of the PWM signal is immediately turned on or turned “ON” by setting the fixed duty value “0” in the duty register 13 next time. Can be fixed to the off level "OFF". As a result, the number of times the register is accessed can be reduced and the processing speed can be improved.

例えば指令固定レベルがオンレベル「ON」であるときには、CPU8は、エッジ極性切替部18によりエッジ極性を変更した後に、強制デューティマッチ生成レジスタ17にフラグ設定する。このため、指令固定レベル「ON」とデューティマッチの発生後の出力状態「OFF」が異なる場合であっても、即時に出力レベルをオンレベル「ON」に固定できる。 For example, when the command fixed level is the ON level “ON”, the CPU 8 sets a flag in the forced duty match generation register 17 after changing the edge polarity by the edge polarity switching unit 18. Therefore, even if the command fixed level “ON” and the output state “OFF” after the occurrence of the duty match are different, the output level can be immediately fixed to the on level “ON”.

例えば指令固定レベルがオフレベル「OFF」であるときには、CPU8は、エッジ極性切替部18によりエッジ極性を保持している条件下において、強制デューティマッチ生成レジスタ17にフラグ設定する。このため、デューティ比の設定と強制デューティマッチの設定処理を行うだけで、即時に出力レベルをオフレベル「OFF」に固定できる。 For example, when the command fixed level is the off level “OFF”, the CPU 8 sets a flag in the forced duty match generation register 17 under the condition that the edge polarity is maintained by the edge polarity switching unit 18. Therefore, the output level can be immediately fixed to the off level "OFF" simply by setting the duty ratio and setting the forced duty match.

また、本実施形態によれば、エッジ極性切替部18によりエッジ極性を必要に応じて変更して強制デューティマッチ生成レジスタ17にフラグ設定して強制的にデューティマッチさせ、次回デューティレジスタ13に設定されたデューティ値「0」を現在デューティレジスタ12に転送することで、PWM出力回路19が固定的な出力レベル「ON」又は「OFF」を即時出力できるようになる。したがって、たとえ現在周期レジスタ10及び現在デューティレジスタ12が読取可能で書換不能であったとしても要求を満たすことができる。 Further, according to the present embodiment, the edge polarity switching unit 18 changes the edge polarity as necessary, sets a flag in the forced duty match generation register 17, forcibly performs duty matching, and sets it in the next duty register 13. By transferring the current duty value "0" to the current duty register 12, the PWM output circuit 19 can immediately output a fixed output level "ON" or "OFF". Therefore, even if the current cycle register 10 and the current duty register 12 are readable and unrewritable, the requirement can be satisfied.

(第2実施形態)
図8から図10は、第2実施形態の追加説明図を示している。第2実施形態では、即時出力固定要求を受け付けたときに当該即時出力固定要求の指令固定レベルに応じてエッジ極性切替部18によりエッジ極性を変更した後、即時出力固定要求を解除し通常出力に復帰するための通常出力復帰要求を受け付けたときには、エッジ極性を復元しているところに特徴を備える。本実施形態ではCPU8がエッジ極性復元部としての機能を備える。
(Second Embodiment)
8 to 10 show additional explanatory views of the second embodiment. In the second embodiment, when the immediate output fixed request is received, the edge polarity is changed by the edge polarity switching unit 18 according to the command fixed level of the immediate output fixed request, and then the immediate output fixed request is released to the normal output. When the normal output return request for recovery is received, the feature is that the edge polarity is restored. In this embodiment, the CPU 8 has a function as an edge polarity restoration unit.

第1実施形態に示したように、CPU8が即時出力固定要求を受け付けたときには、エッジ極性切替部18により指令固定レベルに応じてエッジ極性をフォールエッジ/ライズエッジに変更又は保持する。このため、PWM出力回路19の出力レベルが固定された後であっても、さらに設定した周期及び設定デューティ比に応じて通常のPWM信号を出力復帰したいときに復帰できるようにすることが望ましい。そこで本実施形態においては、CPU8は、指令固定レベルに出力を固定した後に通常出力復帰要求を受け付けたとき、図8に示す処理を実行することで通常の処理に復帰できるようにしている。 As shown in the first embodiment, when the CPU 8 receives the immediate output fixing request, the edge polarity switching unit 18 changes or holds the edge polarity to fall edge / rise edge according to the command fixing level. Therefore, even after the output level of the PWM output circuit 19 is fixed, it is desirable that the normal PWM signal can be restored when the output is desired to be restored according to the set cycle and the set duty ratio. Therefore, in the present embodiment, when the CPU 8 receives the normal output return request after fixing the output to the command fixed level, the CPU 8 can return to the normal process by executing the process shown in FIG.

<即時オフ固定要求「OFF」を受け付けた後に通常出力復帰要求を受け付けた場合>
図9は即時オフ固定要求を受け付けた後に通常出力復帰要求を受け付けたときのタイミングチャートを概略的に示している。この図9は、タイミングt11以降において周期T1且つデューティ値T1/2(デューティ比50%)のPWM信号をオンレベル「ON」から出力し、タイミングt12において現在デューティレジスタの値T1/2に応じて出力をオフレベル「OFF」に変化させた後に、タイミングt13において即時オフ固定要求を受付け、さらにその後、タイミングt14において周期T2且つデューティ値T2/2(デューティ比50%)のPWM信号を出力復帰要求を受け付けた場合の例を示している。
<When the normal output return request is received after receiving the immediate off fixed request "OFF">
FIG. 9 schematically shows a timing chart when a normal output return request is received after receiving an immediate off fixed request. In FIG. 9, a PWM signal having a period T1 and a duty value T1 / 2 (duty ratio 50%) is output from the on level “ON” after the timing t11, and at the timing t12, according to the current duty register value T1 / 2. After changing the output to the off level "OFF", an immediate off fixed request is received at timing t13, and then a PWM signal with a period T2 and a duty value T2 / 2 (duty ratio 50%) is output return request at timing t14. Is shown as an example of accepting.

CPU8は、図9のタイミングt13において上位層のアプリケーションから固定要求レベル「OFF」の即時固定要求を受付けると、図5のS105aにおいてエッジ極性切替部18によるエッジ極性を保持し、極性変更フラグをオフしたまま、S108において強制デューティマッチ生成レジスタ17にフラグをセットする。これにより、PWM出力回路19の出力を「OFF」に固定できる(図9のタイミングt13以降)。 When the CPU 8 receives an immediate fixed request of the fixed request level “OFF” from the application of the upper layer at the timing t13 of FIG. 9, the edge polarity is maintained by the edge polarity switching unit 18 in S105a of FIG. 5, and the polarity change flag is turned off. In S108, the flag is set in the forced duty match generation register 17. As a result, the output of the PWM output circuit 19 can be fixed to "OFF" (timing t13 or later in FIG. 9).

この後、CPU8が、図9のタイミングt14にて通常出力復帰要求を受け付けると、CPU8は、図8のS201においてエッジ極性変更フラグがオンされているか否かを判定する。そして、S201においてエッジ極性変更フラグがオフされていることを確認するとS201でNOと判定し、エッジ極性を変更することなく、S206において次回周期レジスタ11の周期レジスタ値、及び、次回デューティレジスタ13のデューティ値の更新処理を開始する。 After that, when the CPU 8 receives the normal output return request at the timing t14 of FIG. 9, the CPU 8 determines whether or not the edge polarity change flag is turned on in S201 of FIG. Then, when it is confirmed that the edge polarity change flag is turned off in S201, it is determined as NO in S201, and the cycle register value of the next cycle register 11 and the next duty register 13 in S206 without changing the edge polarity. The duty value update process is started.

すなわち、図9のタイミングt14において、CPU8は、次回周期レジスタ11に値T2を設定し、そのデューティ比50%に対応した値T2/2を次回デューティレジスタ13に設定し、その後の周期T1を経過したタイミングt15において、次回周期レジスタ11の値を現在周期レジスタ10にリロードすると共に、次回デューティレジスタ13の値を現在デューティレジスタ12にリロードする。これにより、現在周期レジスタ10の値T2及び現在デューティレジスタ12の値T2/2を更新でき、このタイミングt15以降、PWM出力回路19は、これらの現在周期レジスタ10の値T2及び現在デューティレジスタ12の値T2/2に応じたPWM信号を出力できる。周期の値T1とT2は互いに同一値でも異なっていても良い。
<即時オン固定要求「ON」を受け付けた後に通常出力復帰要求を受け付けた場合>
That is, at the timing t14 of FIG. 9, the CPU 8 sets the value T2 in the next cycle register 11, sets the value T2 / 2 corresponding to the duty ratio of 50% in the next duty register 13, and elapses the subsequent cycle T1. At the timing t15, the value of the next cycle register 11 is reloaded to the current cycle register 10, and the value of the next duty register 13 is reloaded to the current duty register 12. As a result, the value T2 of the current cycle register 10 and the value T2 / 2 of the current duty register 12 can be updated, and after this timing t15, the PWM output circuit 19 of these values T2 of the current cycle register 10 and the current duty register 12 A PWM signal corresponding to the value T2 / 2 can be output. The period values T1 and T2 may be the same or different from each other.
<When the normal output return request is received after receiving the immediate ON fixed request "ON">

図10は、即時オン固定要求を受け付けた後に通常出力復帰要求を受け付けたときのタイミングチャートを概略的に示している。この図10は、タイミングt11以降において周期T1且つデューティ値T1/2(デューティ比50%)のPWM信号をオンレベル「ON」から出力し、タイミングt12において現在デューティレジスタの値T1/2に応じて出力をオフレベル「OFF」に変化させた後に、タイミングt23において即時オン固定要求を受付けて出力をオンレベル「ON」に変更し、さらにその後、タイミングt24において周期T2且つデューティ値T2/2(デューティ比50%)のPWM信号を出力復帰要求を受け付けた場合の例を示している。 FIG. 10 schematically shows a timing chart when a normal output return request is received after receiving an immediate on-fixed request. In FIG. 10, a PWM signal having a period T1 and a duty value T1 / 2 (duty ratio 50%) is output from the on level “ON” after the timing t11, and at the timing t12, according to the current duty register value T1 / 2. After changing the output to the off level "OFF", the immediate on fixed request is received at the timing t23 to change the output to the on level "ON", and then at the timing t24, the period T2 and the duty value T2 / 2 (duty). An example is shown in the case where the output return request is received for the PWM signal (ratio 50%).

他方、CPU8は、図10のタイミングt23において上位層のアプリケーションから固定要求レベル「ON」の即時固定要求を受付けると、図5のS105aにおいてエッジ極性切替部18にエッジ極性変更指令し、S106aにおいてエッジ極性変更フラグをオンし、S107においてデューティ比が0%に対応した値(すなわち0)を次回デューティレジスタ13に設定し、S108において強制デューティマッチ生成レジスタ17にフラグをセットする。このため、エッジ極性切替部18によるエッジ極性をフォールエッジとしつつオンレベル「ON」を固定出力できる(図10のタイミングt23参照)。この後、PWM出力回路19はオンレベル「ON」を出力し続ける。 On the other hand, when the CPU 8 receives an immediate fixed request of the fixed request level “ON” from the application of the upper layer at the timing t23 of FIG. 10, it issues an edge polarity change command to the edge polarity switching unit 18 in S105a of FIG. The polarity change flag is turned on, the value corresponding to the duty ratio of 0% (that is, 0) is set in the next duty register 13 in S107, and the flag is set in the forced duty match generation register 17 in S108. Therefore, the on-level “ON” can be fixedly output while the edge polarity by the edge polarity switching unit 18 is set as the fall edge (see the timing t23 in FIG. 10). After this, the PWM output circuit 19 continues to output the on-level "ON".

その後、CPU8が、図10のタイミングt24において通常出力復帰要求を受付けると、CPU8は、周期マッチまでの時間が余裕時間以上確保されていることを条件として(図8のS202でYES)、エッジ極性を復元する(S203)。すなわちCPU8は、エッジ極性切替部18に極性復帰指令することでエッジ極性をライズエッジに復帰変更する。 After that, when the CPU 8 receives the normal output return request at the timing t24 of FIG. 10, the CPU 8 has an edge polarity on condition that the time until the periodic match is secured for a margin time or more (YES in S202 of FIG. 8). Is restored (S203). That is, the CPU 8 returns and changes the edge polarity to the rise edge by issuing a polarity return command to the edge polarity switching unit 18.

そしてCPU8は、S204においてデューティ比を100%に設定する。このS204の時点では現在周期レジスタ10の値がT1に設定されているため、デューティ比を100%に対応した値、すなわち現在周期レジスタ10の値と同一の値T1を次回デューティレジスタ13に設定する。そしてCPU8はS205においてエッジ極性変更フラグをオフに変更する(図10のタイミングt24参照)。 Then, the CPU 8 sets the duty ratio to 100% in S204. Since the value of the current cycle register 10 is set to T1 at the time of S204, the value corresponding to 100% of the duty ratio, that is, the same value T1 as the value of the current cycle register 10 is set in the next duty register 13. .. Then, the CPU 8 changes the edge polarity change flag to off in S205 (see timing t24 in FIG. 10).

ステップS204において、デューティ比を一旦100%に設定している理由は、エッジ極性を復元するためにエッジ極性フラグを変更した後にデューティを実際の値に更新するまでの間に、周期マッチを発生する場合を想定しているためである。この場合、例えばエッジ極性の変更後、固定オン要求に応じた「0」を次回デューティレジスタ13に設定したまま、周期マッチを生じるとデューティ0%のPWM信号を一周期分出力してしまうことになる。固定オン要求に応じた出力レベル「ON」と逆の出力レベル「OFF」が1周期分出力されることを防ぐため、一旦デューティ比を100%に設定してから、S205においてエッジ極性変更フラグをオフに設定している。 The reason why the duty ratio is once set to 100% in step S204 is that a periodic match occurs between changing the edge polarity flag to restore the edge polarity and updating the duty to the actual value. This is because the case is assumed. In this case, for example, after changing the edge polarity, if a cycle match occurs while "0" corresponding to the fixed on request is set in the duty register 13 next time, a PWM signal with a duty of 0% is output for one cycle. Become. In order to prevent the output level "OFF" opposite to the output level "ON" corresponding to the fixed on request from being output for one cycle, once the duty ratio is set to 100%, then the edge polarity change flag is set in S205. It is set to off.

そしてCPU8は、S206において現在周期レジスタ10及び現在デューティレジスタ12を共に更新する。例えば、周期T2、デューティ比50%の値T2/2を設定する場合には、CPU8は、次回周期レジスタ11に値T2を設定すると共にデューティ比50%に対応した設定値T2/2を次回デューティレジスタ13に設定する(図10のタイミングt24参照)。そしてCPU8は、タイマカウンタ14のカウントに応じて周期マッチを生じるタイミングt25において、次回周期レジスタ11の格納値T2を現在周期レジスタ10にリロードすると共に、次回デューティレジスタ13の格納値T2/2を現在デューティレジスタ12にリロードする。これにより、現在周期レジスタ10の値T2及び現在デューティレジスタの値T2/2を更新でき、このタイミングt25以降、PWM出力回路19は、これらの現在周期レジスタの値T2及び現在デューティレジスタの値T2/2に応じたPWM信号を出力することになる。
<本実施形態に係る概念的なまとめ>
Then, the CPU 8 updates both the current cycle register 10 and the current duty register 12 in S206. For example, when setting the value T2 / 2 having a cycle T2 and a duty ratio of 50%, the CPU 8 sets the value T2 in the next cycle register 11 and sets the set value T2 / 2 corresponding to the duty ratio 50% to the next duty. It is set in the register 13 (see timing t24 in FIG. 10). Then, the CPU 8 reloads the stored value T2 of the next cycle register 11 into the current cycle register 10 at the timing t25 that causes a cycle match according to the count of the timer counter 14, and sets the stored value T2 / 2 of the next duty register 13 to the current. Reload to duty register 12. As a result, the value T2 of the current cycle register 10 and the value T2 / 2 of the current duty register can be updated, and after this timing t25, the PWM output circuit 19 has these values T2 of the current cycle register and the value T2 / of the current duty register. The PWM signal corresponding to 2 will be output.
<Conceptual summary of the present embodiment>

要するに、本実施形態によれば、即時出力固定要求を受け付けたときに当該即時出力固定要求の指令固定レベル「ON」に応じてエッジ極性切替部18によりエッジ極性を変更したときには、即時オン出力固定要求を解除し通常出力に復帰するための通常出力復帰要求を受け付けたときにはエッジ極性を復元する(S203)ようにしている。このため、たとえ即時出力固定要求に応じてエッジ極性切替部18によりエッジ極性を変更した場合であっても、通常出力復帰要求を受け付けたときにはエッジ極性を復元するため、PWM信号を通常通り出力できるようになる。 In short, according to the present embodiment, when the edge polarity is changed by the edge polarity switching unit 18 in response to the command fixing level “ON” of the immediate output fixing request when the immediate output fixing request is received, the immediate on output is fixed. When the normal output return request for canceling the request and returning to the normal output is received, the edge polarity is restored (S203). Therefore, even if the edge polarity is changed by the edge polarity switching unit 18 in response to the immediate output fixing request, the edge polarity is restored when the normal output return request is received, so that the PWM signal can be output as usual. Will be.

(他の実施形態)
本発明は、前述実施形態に限定されるものではなく、例えば、以下に示す変形又は拡張が可能である。前述した複数の実施形態の構成、機能を組み合わせても良い。前述実施形態の一部を、課題を解決できる限りにおいて省略した態様も実施形態と見做すことが可能である。また、特許請求の範囲に記載した文言によって特定される発明の本質を逸脱しない限度において考え得るあらゆる態様も実施形態と見做すことが可能である。
(Other embodiments)
The present invention is not limited to the above-described embodiment, and for example, the following modifications or extensions are possible. The configurations and functions of the plurality of embodiments described above may be combined. An embodiment in which a part of the above-described embodiment is omitted as long as the problem can be solved can also be regarded as an embodiment. In addition, any conceivable embodiment can be regarded as an embodiment without departing from the essence of the invention specified by the wording described in the claims.

本開示は、前述した実施形態に準拠して記述したが、本開示は当該実施形態や構造に限定されるものではないと理解される。本開示は、様々な変形例や均等範囲内の変形をも包含する。加えて、様々な組み合わせや形態、さらには、それらに一要素、それ以上、あるいはそれ以下、を含む他の組み合わせや形態をも、本開示の範畴や思想範囲に入るものである。 Although the present disclosure has been described in accordance with the above-described embodiments, it is understood that the present disclosure is not limited to the embodiments and structures. The present disclosure also includes various modifications and modifications within a uniform range. In addition, various combinations and forms, as well as other combinations and forms, including one element, more, or less, are also within the scope and ideology of the present disclosure.

図面中、8はCPU(次回デューティ値設定部、強制デューティマッチ設定部、エッジ極性復元部)、10は現在周期レジスタ(指令周期記憶部)、12は現在デューティレジスタ(現在デューティ記憶部)、13は次回デューティレジスタ(次回デューティ記憶部)、14はタイマカウンタ(カウンタ)、17は強制デューティマッチ生成レジスタ(強制デューティマッチ指令記憶部)、18はエッジ極性切替部、19はPWM出力回路(出力部)、を示す。 In the drawing, 8 is a CPU (next duty value setting unit, forced duty match setting unit, edge polarity restoration unit), 10 is a current cycle register (command cycle storage unit), 12 is a current duty register (current duty storage unit), and 13 Is the next duty register (next duty storage unit), 14 is the timer counter (counter), 17 is the forced duty match generation register (forced duty match command storage unit), 18 is the edge polarity switching unit, and 19 is the PWM output circuit (output unit). ), Indicates.

Claims (7)

PWM信号の指令周期を記憶する指令周期記憶部(10)と、
現在のPWM信号の指令デューティ値を記憶する現在デューティ記憶部(12)と、
前記現在デューティ記憶部に記憶値を転送可能に構成され次回のPWM信号の指令デューティを記憶する次回デューティ記憶部(13)と、
前記指令周期記憶部に記憶された指令周期に対応した周期カウント値までカウントするカウンタ(14)と、
通常時、前記カウンタにより初期値からカウント開始した時に第1レベルとし前記カウンタのカウント値が前記現在デューティ記憶部の指令デューティに応じたデューティ値に達した時に第2レベルとし、前記カウンタのカウント値が前記指令周期記憶部の指令周期に応じた周期カウント値に達した時に再度第1レベルとする出力部(19)と、
前記指令周期記憶部に前記PWM信号の指令周期を保持したまま即時出力固定要求の指令固定レベルを受け付けたときに前記出力部の出力レベルを即時出力固定要求の指令固定レベルに設定する指令固定レベル設定部(8)と、
前記指令固定レベル設定部により設定された前記即時出力固定要求の指令固定レベルに応じて、前記出力部の出力レベルにライズ/フォールのエッジ極性の変更有無を切替えるエッジ極性切替部(18、S105a,S105b)と、
前記即時出力固定要求の指令固定レベルに応じた固定デューティ値を前記次回デューティ記憶部に設定するブロックであって、当該固定デューティ値を設定するときには前記エッジ極性切替部によるエッジ極性の変更有無に応じた固定デューティ値に設定する次回デューティ値設定部(8,S102,S107)と、
を備える電子制御装置。
A command cycle storage unit (10) that stores the command cycle of the PWM signal, and
The current duty storage unit (12) that stores the command duty value of the current PWM signal, and
The next duty storage unit (13), which is configured to be able to transfer the stored value to the current duty storage unit and stores the command duty of the next PWM signal,
A counter (14) that counts up to the cycle count value corresponding to the command cycle stored in the command cycle storage unit, and
Normally, when the counter starts counting from the initial value, the first level is set, and when the count value of the counter reaches the duty value corresponding to the command duty of the current duty storage unit, the second level is set, and the count value of the counter is set. When the cycle count value corresponding to the command cycle of the command cycle storage unit is reached, the output unit (19) is set to the first level again.
A command fixed level that sets the output level of the output unit to the command fixed level of the immediate output fixed request when the command fixed level of the immediate output fixed request is received while holding the command cycle of the PWM signal in the command cycle storage unit. Setting unit (8) and
The instruction fixed in response to a command fixed level of the set by the level setting section immediately output fixing request to switch the change whether the rise / fall of the edge polarity output level of the output edge polarity switching unit (18, S105a, S105b) and
It is a block that sets a fixed duty value according to the command fixed level of the immediate output fixed request in the next duty storage unit, and when the fixed duty value is set, it depends on whether or not the edge polarity is changed by the edge polarity switching unit. Next-time duty value setting unit (8, S102, S107) to set a fixed duty value,
An electronic control device comprising.
フラグ設定されると前記カウンタのカウント値を前記現在デューティ記憶部の指令デューティに強制的に見做しマッチさせる強制デューティマッチ指令記憶部(17)と、
前記エッジ極性切替部により極性を変更し(S105a)つつ、前記強制デューティマッチ指令記憶部にフラグ設定する(S108)強制デューティマッチ設定部(8)と、
をさらに備える請求項1記載の電子制御装置。
When the flag is set, the forced duty match command storage unit (17) forcibly regards and matches the count value of the counter with the command duty of the current duty storage unit, and
While changing the polarity by the edge polarity switching unit (S105a), a flag is set in the forced duty match command storage unit (S108), and the forced duty match setting unit (8)
The electronic control device according to claim 1, further comprising.
フラグ設定されると前記カウンタのカウント値を前記現在デューティ記憶部の指令デューティに強制的に見做しマッチさせる強制デューティマッチ指令記憶部(17)と、
前記エッジ極性切替部による極性を変更せずに保持し(S105b)つつ、前記強制デューティマッチ指令記憶部にフラグ設定する(S108)強制デューティマッチ設定部(8)と、
をさらに備える請求項1記載の電子制御装置。
When the flag is set, the forced duty match command storage unit (17) forcibly regards and matches the count value of the counter with the command duty of the current duty storage unit, and
The forced duty match setting unit (8), which sets a flag in the forced duty match command storage unit (S108) while maintaining the polarity of the edge polarity switching unit without changing it (S105b),
The electronic control device according to claim 1, further comprising.
前記即時出力固定要求の指令固定レベルがオンレベルであるときには、前記エッジ極性切替部により極性を変更し(S105a)つつ、前記次回デューティ記憶部に次回の指令デューティ値を0に設定し(S107)、その後、前記強制デューティマッチ設定部により前記強制デューティマッチ指令記憶部にフラグ設定する(S108)請求項2記載の電子制御装置。 When the command fixing level of the immediate output fixing request is on level, the next command duty value is set to 0 in the next duty storage unit while changing the polarity by the edge polarity switching unit (S105a) (S107). After that, the electronic control device according to claim 2 is set with a flag in the forced duty match command storage unit by the forced duty match setting unit (S108). 前記即時出力固定要求の指令固定レベルがオフレベルであるときには、前記エッジ極性切替部による極性を保持し(S105b)つつ、前記次回デューティ記憶部に次回の指令デューティ値を0に設定し(S102)、その後、前記強制デューティマッチ設定部により前記強制デューティマッチ指令記憶部にフラグ設定する(S108)請求項3記載の電子制御装置。 When the command fixing level of the immediate output fixing request is off level, the next command duty value is set to 0 in the next duty storage unit while maintaining the polarity by the edge polarity switching unit (S105b) (S102). After that, the electronic control device according to claim 3 is set with a flag in the forced duty match command storage unit by the forced duty match setting unit (S108). 前記次回デューティ値設定部(8)は、CPUにより構成され、
記現在デューティ記憶部は前記CPUから直接的に読取可能及び書換不能で、且つ前記次回デューティ記憶部が前記CPUから直接的に書換可能に構成され、
前記CPUが、即時出力固定要求の指令固定レベルに応じた固定デューティ値を前記次回デューティ記憶部に設定することで、前記次回デューティ記憶部の固定デューティ値が前記現在デューティ記憶部に転送される請求項1から5の何れか一項に記載の電子制御装置。
The next duty value setting unit (8) is composed of a CPU.
Before SL current duty storage portion is directly readable and rewritable from the CPU, and the next duty storage portion is directly rewritable constructed from the CPU,
A claim in which the fixed duty value of the next duty storage unit is transferred to the current duty storage unit by the CPU setting a fixed duty value corresponding to the command fixed level of the immediate output fixed request in the next duty storage unit. Item 5. The electronic control device according to any one of Items 1 to 5.
前記即時出力固定要求を受け付けたときに当該即時出力固定要求の指令固定レベルに応じて前記エッジ極性切替部によりエッジ極性を変更したときには、前記即時出力固定要求を解除し通常出力に復帰するための通常出力復帰要求を受け付けたときにはエッジ極性を復元するエッジ極性復元部(8,S203)をさらに備える請求項1から6の何れか一項に記載の電子制御装置。 When the edge polarity is changed by the edge polarity switching unit according to the command fixing level of the immediate output fixing request when the immediate output fixing request is received, the immediate output fixing request is canceled and the normal output is restored. The electronic control device according to any one of claims 1 to 6, further comprising an edge polarity restoration unit (8, S203) that restores the edge polarity when a normal output return request is received.
JP2017134558A 2017-07-10 2017-07-10 Electronic control device Active JP6935691B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017134558A JP6935691B2 (en) 2017-07-10 2017-07-10 Electronic control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017134558A JP6935691B2 (en) 2017-07-10 2017-07-10 Electronic control device

Publications (2)

Publication Number Publication Date
JP2019016974A JP2019016974A (en) 2019-01-31
JP6935691B2 true JP6935691B2 (en) 2021-09-15

Family

ID=65358105

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017134558A Active JP6935691B2 (en) 2017-07-10 2017-07-10 Electronic control device

Country Status (1)

Country Link
JP (1) JP6935691B2 (en)

Also Published As

Publication number Publication date
JP2019016974A (en) 2019-01-31

Similar Documents

Publication Publication Date Title
US20060200276A1 (en) Vehicle-mounted electronic control apparatus
US7496800B2 (en) Malfunction monitoring method and system
US7449926B2 (en) Circuit for asynchronously resetting synchronous circuit
US8151130B2 (en) Plural voltage level detection upon power drop for switching to standby mode with or without complete state saving interrupt processing
US20130067258A1 (en) Data processor and electronic control unit
US8001363B2 (en) System for speculative branch prediction optimization and method thereof
US20060254296A1 (en) Adaptive thermal-based frequency-bounds control
KR20070089460A (en) Apparatus and method for operating non-volatile memory according to priority
US9009714B2 (en) Method, medium and apparatus scheduling tasks in a real time operating system
CN110865822B (en) Boot architecture and method for Bootloader brush writing program for whole vehicle controller
US6487246B1 (en) Method and apparatus for programmable pulse width modulated signal generation with period and duty cycle values updated with controlled relative timing
US9513679B2 (en) Electronic control unit
CN105988400B (en) Microcontroller unit
JP6935691B2 (en) Electronic control device
KR100451777B1 (en) Operating vehicular processor-based systems
JP6183229B2 (en) Electronic control unit
JP3987277B2 (en) Pulse signal generator
JP4955417B2 (en) Memory check system for electronic control unit
CN110121688B (en) Method for judging loader and electronic system
JP6183251B2 (en) Electronic control unit
US20180341231A1 (en) Method for Operating a Cyclically Operating Automation Controller, Automation Controller and Engineering System
US7210029B2 (en) System and method for transferring rewrite programs to two computers in a processing system
KR101031417B1 (en) Micro Processor Unit with non-volatile memory register and control method therefor
JP6172040B2 (en) Electronic control unit
US20110238932A1 (en) Controller and method for operating a controller, computer program, computer program product

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200616

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210525

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210706

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210727

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210809

R151 Written notification of patent or utility model registration

Ref document number: 6935691

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151