|
|||||||||||
Technical Support On-Line Manuals µVision4 User's Guide (Japanese) ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
割り込みシグナル次のシグナル関数テンプレートを使用して、GPIO 割り込みシグナルを生成できます。 このコードを初期化ファイル <filename>.ini に追加します。 /*------------------------------------------------------------------*/ /* Generates a number of pulses on GPIO 0.14 */ /*------------------------------------------------------------------*/ signal void GPIO_0_14_Square (unsigned int pulses) { float frequency; // pulse frequency in Hz float takeTime; frequency = 1000; // 1 KHz takeTime = (1.0 / frequency); printf ("%d Square Pulses on GPIO 0.14\n", pulses); while (pulses--) { PORT0 |= (1 << 14); // set pin 0.14 PORT1 &= ~(1 << 24); // reset pin 1.24 PORT1 |= (1 << 24); // set pin 1.24 swatch (takeTime); PORT0 &= ~(1 << 14); // reset pin 0.14 swatch (takeTime); } } GPIO_0_14_Square (100); // 100 Pulses at debugger startup define button "EINT1 10 Pulses", "GPIO_0_14_Square (10)" define button "EINT1 100 Pulses", "GPIO_0_14_Square (100)" 上の設定では、PORT0 で次のシグナルが生成されます。次に示すロジックアナライザの出力は、www.keil.com/download から入手できるサンプルプロジェクト「Using Interrupt EINT1 on Keil MCB2100 Board」で生成されたものです。
| ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.