小弟刚刚接触PIC单片机,AD部分ADCON0寄存器中GO/DONE位在程序中要怎么定义?
答案:2 悬赏:60 手机版
解决时间 2021-11-19 01:04
- 提问者网友:斑駁影
- 2021-11-18 11:40
小弟刚刚接触PIC单片机,AD部分ADCON0寄存器中GO/DONE位在程序中要怎么定义?
最佳答案
- 五星知识达人网友:慢性怪人
- 2021-11-18 12:26
PICC里面定义的是GODONE,可以在PICC安装目录下找到include文件夹,在里面找pic16f685.h头文件就能看到定义了
#if defined(_16F677) || defined(_16F685) || defined(_16F687) || defined(_16F689) || defined(_16F690)
volatile bit ADON @ ((unsigned)&ADCON0*8)+0;
volatile bit GODONE @ ((unsigned)&ADCON0*8)+1;
volatile bit CHS0 @ ((unsigned)&ADCON0*8)+2;
volatile bit CHS1 @ ((unsigned)&ADCON0*8)+3;
volatile bit CHS2 @ ((unsigned)&ADCON0*8)+4;
volatile bit CHS3 @ ((unsigned)&ADCON0*8)+5;
volatile bit VCFG @ ((unsigned)&ADCON0*8)+6;
volatile bit ADFM @ ((unsigned)&ADCON0*8)+7;
#endif
#if defined(_16F677) || defined(_16F685) || defined(_16F687) || defined(_16F689) || defined(_16F690)
volatile bit ADON @ ((unsigned)&ADCON0*8)+0;
volatile bit GODONE @ ((unsigned)&ADCON0*8)+1;
volatile bit CHS0 @ ((unsigned)&ADCON0*8)+2;
volatile bit CHS1 @ ((unsigned)&ADCON0*8)+3;
volatile bit CHS2 @ ((unsigned)&ADCON0*8)+4;
volatile bit CHS3 @ ((unsigned)&ADCON0*8)+5;
volatile bit VCFG @ ((unsigned)&ADCON0*8)+6;
volatile bit ADFM @ ((unsigned)&ADCON0*8)+7;
#endif
全部回答
- 1楼网友:神鬼未生
- 2021-11-18 12:44
“用ADGO定义不对”?啥意思啊?追问就是如16f877用ADGO定义GO/DONE位,但是685就不可以追答PICC里面定义的是GODONE,可以在PICC安装目录下找到include文件夹,在里面找相关型号的头文件就能看到定义了
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯