この前も質問して、とりあえずソフトウェアタイマーを使って
LEDを点滅させることはできたので回路自体はあっていたみたいなので
割り込みを使用してLEDを点滅させるプログラムを新しく
書いてみたんですけどそれがビルドできなくて良ければアドバイスください。
プログラム
lang
1#include<htc.h> 2 3#include<xc.h> 4 5// CONFIG 6#pragma config FOSC = INTOSCIO 7#pragma config WDTE = OFF 8#pragma config PWRTE = ON 9#pragma config MCLRE = OFF 10#pragma config CP = OFF 11#pragma config CPD = OFF 12#pragma config BOREN = OFF 13#pragma config IESO = OFF 14#pragma config FCMEN = OFF 15 16int a,b,c; 17 18void main(void){ 19 while(1){ 20 GIE = 1; 21 T0IE = 0; 22 T0CS = 0; 23 PSA = 0; 24 PS0 = 1; 25 PS1 = 1; 26 PS2 = 1; 27 TMR0 = 0x00; 28 TRISIO = 0xff; 29 T0IE = 1; 30 c++; 31 } 32} 33void interrupt hazime(void){ 34 if(T0IF = 1 && c == 1){ 35 T0IF = 0; 36 a++; 37 return; 38 } 39} 40void interrupt gp21(void){ 41 if(T0IF = 1 && a == 1){ 42 T0IF = 0; 43 GP2 = 1; 44 b++; 45 a--; 46 return ; 47 } 48} 49void interrupt gp20(void){ 50 if(T0IF = 1 && b == 1){ 51 T0IF = 0; 52 GP2 = 0; 53 a++; 54 b--; 55 return; 56 } 57}
エラー内容
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/CAT/MPLABXProjects/�^�C�}�[.X'
make -f nbproject/Makefile-default.mk dist/default/production/.X.production.hex
make[2]: Entering directory 'C:/Users/CAT/MPLABXProjects/�^�C�}�[.X'
"C:\Program Files (x86)\Microchip\xc8\v1.33\bin\xc8.exe" --pass1 --chip=12F683 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/�^�C�}�[.p1 �^�C�}�[.c
"C:\Program Files (x86)\Microchip\xc8\v1.33\bin\xc8.exe" --chip=12F683 -G -mdist/default/production/.X.production.map --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -odist/default/production/____.X.production.elf build/default/production/�^�C�}�[.p1 build/default/production/so-su.p1
Microchip MPLAB XC8 C Compiler (Free Mode) V1.33
Part Support Version: 1.33 (A)
Copyright (C) 2014 Microchip Technology Inc.
License type: Node Configuration
:: warning: (1273) Omniscient Code Generation not available in Free mode
(908) exit status = 1
�^�C�}�[.c:45: error: (1375) multiple interrupt functions (gp21 and hazime) defined for device with only one interrupt vector
make[2]: *** [dist/default/production/.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
�^�C�}�[.c:54: error: (1375) multiple interrupt functions (gp20 and gp21) defined for device with only one interrupt vector
nbproject/Makefile-default.mk:135: recipe for target 'dist/default/production/.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/CAT/MPLABXProjects/�^�C�}�[.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/CAT/MPLABXProjects/�^�C�}�[.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
?のところは□です。
環境
OS windows 8.1
開発環境 MPLAB X IDE 2.25
ターゲット PIC12F683
書き込み方 PIkit3とブレッドボードで
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/04/09 06:28
2015/04/09 08:44
2015/04/09 10:14