このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
| exercise4_タイマー割り込みcmt [2015/04/12 19:39] – member | exercise4_タイマー割り込みcmt [2016/03/08 18:58] (現在) – member | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | Exercise4 タイマー割り込み | + | ======Exercise4 タイマー割り込み====== |
| 注意 | 注意 | ||
| 行 7: | 行 7: | ||
| <code c> | <code c> | ||
| void interrupt_cmt0(void); | void interrupt_cmt0(void); | ||
| - | #pragma interrupt | + | #pragma interrupt |
| void INT_CMT0_CMI0(void){ | void INT_CMT0_CMI0(void){ | ||
| interrupt_cmt0(); | interrupt_cmt0(); | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ただし、e2studioを使っている場合は、次のとおり書き換えてください。 | ||
| + | |||
| + | <code c> | ||
| + | void interrupt_cmt0(void); | ||
| + | void INT_CMT0_CMI0(void){ | ||
| + | interrupt_cmt0(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| また、**reset_program.c**の21行目のSR_Initの0x000000F0を0x00000000にしましょう。 | また、**reset_program.c**の21行目のSR_Initの0x000000F0を0x00000000にしましょう。 | ||
| 行 71: | 行 81: | ||
| void interrupt_cmt0(){// | void interrupt_cmt0(){// | ||
| - | CMT1.CMCSR.BIT.CMF = 0;// | + | CMT0.CMCSR.BIT.CMF = 0;// |
| //中身 | //中身 | ||
| } | } | ||