欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3422|回復: 4
打印 上一主題 下一主題
收起左側

PIC16F877程序問題

[復制鏈接]
跳轉到指定樓層
樓主
ID:216579 發表于 2022-2-6 20:34 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
#include<pic.h>
#define uchar unsigned char
#define uint  unsigned int
__CONFIG(0x3B31);
void init();
uint intnum;
void main()
{       


        init();
        while(1)
        {
                if(intnum==5)
                {
                        intnum=0;
                        RD0=!RD0;
                }       
        }
}

void init()
{
        TRISD=0;
        PORTD=0;
        OPTION=0x07;   
        INTCON=0xa0;
        TMR0=61;
}

void interrupt time0()
{
        T0IF=0;
        TMR0=61;
        intnum++;
}



這是什么原因,程序寫的沒有問題啊



分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:216579 發表于 2022-2-7 09:51 | 只看該作者

清除已成功 (總時間: 6ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/50331/Desktop/pic10f200/16F877_TMR0.X'
make  -f nbproject/Makefile-default.mk dist/default/production/16F877_TMR0.X.production.hex
make[2]: Entering directory 'C:/Users/50331/Desktop/pic10f200/16F877_TMR0.X'
"C:\Program Files\Microchip\xc8\v2.32\bin\xc8-cc.exe"  -mcpu=16F877A -c   -mdfp="C:/Program Files/Microchip/MPLABX/v5.50/packs/Microchip/PIC16Fxxx_DFP/1.2.33/xc8"  -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default  -msummary=-psect,-class,+mem,-hex,-file  -ginhx32 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall   -std=c99 -gdwarf-3 -mstack=compiled:auto:auto     -o build/default/production/main.p1 main.c
::: advisory: (2049) C99 compliant libraries are currently not available for baseline or mid-range devices, or for enhanced mid-range devices using a reentrant stack; using C90 libraries
main.c:74:2: error: use of undeclared identifier 'OPTION'
        OPTION=0x07;
        ^
main.c:79:6: error: variable has incomplete type 'void'
void interrupt time0()
     ^
main.c:79:15: error: expected ';' after top level declarator
void interrupt time0()
              ^
              ;
3 errors generated.
(908) exit status = 1
nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/main.p1' failed
make[2]: Leaving directory 'C:/Users/50331/Desktop/pic10f200/16F877_TMR0.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/50331/Desktop/pic10f200/16F877_TMR0.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/main.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

編譯已失敗 (退出值2, 總時間: 3s)
回復

使用道具 舉報

板凳
ID:1004618 發表于 2022-2-10 12:03 | 只看該作者
你試一下OPTION_REG呢
回復

使用道具 舉報

地板
ID:216579 發表于 2022-2-14 15:38 | 只看該作者
帥氣男孩 發表于 2022-2-10 12:03
你試一下OPTION_REG呢

OPTION_REG可以,但中斷函數還是報錯什么問題
回復

使用道具 舉報

5#
ID:1019848 發表于 2022-12-27 13:53 | 只看該作者
XC8編譯器得用void __interrupt() ISR(void)
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表