专家
公告
财富商城
电子网
旗下网站
首页
问题库
专栏
标签库
话题
专家
NEW
门户
发布
提问题
发文章
PIC单片机
PIC16F1824有什么C编译器能用?
2020-02-06 09:56
发布
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
站内问答
/
51单片机
12683
64
64
本帖最后由 1125526801 于 2013-6-15 09:24 编辑
PIC16F1824有什么C编译器能用?之前学习板上的单片机不一样是18F4520,用的MCC18。PIC16F1824是用PICC吗?
360截图20130615092316974.jpg
(177.04 KB, 下载次数: 0)
下载附件
2013-6-15 09:23 上传
友情提示:
此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
64条回答
1125526801
2020-02-08 06:51
本帖最后由 1125526801 于 2013-6-15 09:38 编辑
yklstudent 发表于 2013-6-14 23:10
config1 config2需要配置的
除了学习板上的18F4520我还没用过其它PIC单片机。装了XC8免费版后,才找到PIC16F1824.h头文件。发现照搬之前的时钟配置
config过来用不了。打开之前用的PIC.h和现在的PIC16F1824.h对比,差远了。。。。
时钟不知道怎么配置。在DEBUG状态LED是能亮了。拔了仿真,直接给电不会运行。
头文件的部分:
// Register: OSCCON
extern volatile unsigned char OSCCON @ 0x099;
#ifndef _LIB_BUILD
asm("OSCCON equ 099h");
#endif
// bitfield definitions
typedef union {
struct {
unsigned SCS0 :1;
unsigned SCS1 :1;
unsigned :1;
unsigned IRCF0 :1;
unsigned IRCF1 :1;
unsigned IRCF2 :1;
unsigned IRCF3 :1;
unsigned SPLLEN :1;
};
struct {
unsigned SCS :2;
unsigned :1;
unsigned IRCF :4;
};
} OSCCONbits_t;
extern volatile OSCCONbits_t OSCCONbits @ 0x099;
// bitfield macros
#define _OSCCON_SCS0_POSN 0x0
#define _OSCCON_SCS0_POSITION 0x0
#define _OSCCON_SCS0_SIZE 0x1
#define _OSCCON_SCS0_LENGTH 0x1
#define _OSCCON_SCS0_MASK 0x1
#define _OSCCON_SCS1_POSN 0x1
#define _OSCCON_SCS1_POSITION 0x1
#define _OSCCON_SCS1_SIZE 0x1
#define _OSCCON_SCS1_LENGTH 0x1
#define _OSCCON_SCS1_MASK 0x2
#define _OSCCON_IRCF0_POSN 0x3
#define _OSCCON_IRCF0_POSITION 0x3
#define _OSCCON_IRCF0_SIZE 0x1
#define _OSCCON_IRCF0_LENGTH 0x1
#define _OSCCON_IRCF0_MASK 0x8
#define _OSCCON_IRCF1_POSN 0x4
#define _OSCCON_IRCF1_POSITION 0x4
#define _OSCCON_IRCF1_SIZE 0x1
#define _OSCCON_IRCF1_LENGTH 0x1
#define _OSCCON_IRCF1_MASK 0x10
#define _OSCCON_IRCF2_POSN 0x5
#define _OSCCON_IRCF2_POSITION 0x5
#define _OSCCON_IRCF2_SIZE 0x1
#define _OSCCON_IRCF2_LENGTH 0x1
#define _OSCCON_IRCF2_MASK 0x20
#define _OSCCON_IRCF3_POSN 0x6
#define _OSCCON_IRCF3_POSITION 0x6
#define _OSCCON_IRCF3_SIZE 0x1
#define _OSCCON_IRCF3_LENGTH 0x1
#define _OSCCON_IRCF3_MASK 0x40
#define _OSCCON_SPLLEN_POSN 0x7
#define _OSCCON_SPLLEN_POSITION 0x7
#define _OSCCON_SPLLEN_SIZE 0x1
#define _OSCCON_SPLLEN_LENGTH 0x1
#define _OSCCON_SPLLEN_MASK 0x80
#define _OSCCON_SCS_POSN 0x0
#define _OSCCON_SCS_POSITION 0x0
#define _OSCCON_SCS_SIZE 0x2
#define _OSCCON_SCS_LENGTH 0x2
#define _OSCCON_SCS_MASK 0x3
#define _OSCCON_IRCF_POSN 0x3
#define _OSCCON_IRCF_POSITION 0x3
#define _OSCCON_IRCF_SIZE 0x4
#define _OSCCON_IRCF_LENGTH 0x4
#define _OSCCON_IRCF_MASK 0x78
// Register: OSCSTAT
extern volatile unsigned char OSCSTAT @ 0x09A;
#ifndef _LIB_BUILD
asm("OSCSTAT equ 09Ah");
#endif
// bitfield definitions
typedef union {
struct {
unsigned HFIOFS :1;
unsigned LFIOFR :1;
unsigned MFIOFR :1;
unsigned HFIOFL :1;
unsigned HFIOFR :1;
unsigned OSTS :1;
unsigned PLLR :1;
unsigned T1OSCR :1;
};
} OSCSTATbits_t;
extern volatile OSCSTATbits_t OSCSTATbits @ 0x09A;
// bitfield macros
#define _OSCSTAT_HFIOFS_POSN 0x0
#define _OSCSTAT_HFIOFS_POSITION 0x0
#define _OSCSTAT_HFIOFS_SIZE 0x1
#define _OSCSTAT_HFIOFS_LENGTH 0x1
#define _OSCSTAT_HFIOFS_MASK 0x1
#define _OSCSTAT_LFIOFR_POSN 0x1
#define _OSCSTAT_LFIOFR_POSITION 0x1
#define _OSCSTAT_LFIOFR_SIZE 0x1
#define _OSCSTAT_LFIOFR_LENGTH 0x1
#define _OSCSTAT_LFIOFR_MASK 0x2
#define _OSCSTAT_MFIOFR_POSN 0x2
#define _OSCSTAT_MFIOFR_POSITION 0x2
#define _OSCSTAT_MFIOFR_SIZE 0x1
#define _OSCSTAT_MFIOFR_LENGTH 0x1
#define _OSCSTAT_MFIOFR_MASK 0x4
#define _OSCSTAT_HFIOFL_POSN 0x3
#define _OSCSTAT_HFIOFL_POSITION 0x3
#define _OSCSTAT_HFIOFL_SIZE 0x1
#define _OSCSTAT_HFIOFL_LENGTH 0x1
#define _OSCSTAT_HFIOFL_MASK 0x8
#define _OSCSTAT_HFIOFR_POSN 0x4
#define _OSCSTAT_HFIOFR_POSITION 0x4
#define _OSCSTAT_HFIOFR_SIZE 0x1
#define _OSCSTAT_HFIOFR_LENGTH 0x1
#define _OSCSTAT_HFIOFR_MASK 0x10
#define _OSCSTAT_OSTS_POSN 0x5
#define _OSCSTAT_OSTS_POSITION 0x5
#define _OSCSTAT_OSTS_SIZE 0x1
#define _OSCSTAT_OSTS_LENGTH 0x1
#define _OSCSTAT_OSTS_MASK 0x20
#define _OSCSTAT_PLLR_POSN 0x6
#define _OSCSTAT_PLLR_POSITION 0x6
#define _OSCSTAT_PLLR_SIZE 0x1
#define _OSCSTAT_PLLR_LENGTH 0x1
#define _OSCSTAT_PLLR_MASK 0x40
#define _OSCSTAT_T1OSCR_POSN 0x7
#define _OSCSTAT_T1OSCR_POSITION 0x7
#define _OSCSTAT_T1OSCR_SIZE 0x1
#define _OSCSTAT_T1OSCR_LENGTH 0x1
#define _OSCSTAT_T1OSCR_MASK 0x80
复制代码
加载中...
查看其它64个回答
一周热门
更多
>
相关问题
PIC单片机不同的IO口驱动74HC573驱动共阴极的数码管,有的段不亮
1 个回答
一种简单精确的pic延时方法
21 个回答
谁熟悉PIC的产品发布时间的,帮看看PIC18F47K40啥版本IDE能开发
12 个回答
求AN1078对应的源代码下载地址
5 个回答
PIC单片机应用技巧
4 个回答
相关文章
一种用PIC单片机主时钟驱动的老式挂钟
0个评论
×
关闭
采纳回答
向帮助了您的知道网友说句感谢的话吧!
非常感谢!
确 认
×
关闭
编辑标签
最多设置5个标签!
PIC单片机
保存
关闭
×
关闭
举报内容
检举类型
检举内容
检举用户
检举原因
广告推广
恶意灌水
回答内容与提问无关
抄袭答案
其他
检举说明(必填)
提交
关闭
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
×
付费偷看金额在0.1-10元之间
确定
×
关闭
您已邀请
0
人回答
查看邀请
擅长该话题的人
回答过该话题的人
我关注的人
除了学习板上的18F4520我还没用过其它PIC单片机。装了XC8免费版后,才找到PIC16F1824.h头文件。发现照搬之前的时钟配置
config过来用不了。打开之前用的PIC.h和现在的PIC16F1824.h对比,差远了。。。。
时钟不知道怎么配置。在DEBUG状态LED是能亮了。拔了仿真,直接给电不会运行。
头文件的部分:
- // Register: OSCCON
- extern volatile unsigned char OSCCON @ 0x099;
- #ifndef _LIB_BUILD
- asm("OSCCON equ 099h");
- #endif
- // bitfield definitions
- typedef union {
- struct {
- unsigned SCS0 :1;
- unsigned SCS1 :1;
- unsigned :1;
- unsigned IRCF0 :1;
- unsigned IRCF1 :1;
- unsigned IRCF2 :1;
- unsigned IRCF3 :1;
- unsigned SPLLEN :1;
- };
- struct {
- unsigned SCS :2;
- unsigned :1;
- unsigned IRCF :4;
- };
- } OSCCONbits_t;
- extern volatile OSCCONbits_t OSCCONbits @ 0x099;
- // bitfield macros
- #define _OSCCON_SCS0_POSN 0x0
- #define _OSCCON_SCS0_POSITION 0x0
- #define _OSCCON_SCS0_SIZE 0x1
- #define _OSCCON_SCS0_LENGTH 0x1
- #define _OSCCON_SCS0_MASK 0x1
- #define _OSCCON_SCS1_POSN 0x1
- #define _OSCCON_SCS1_POSITION 0x1
- #define _OSCCON_SCS1_SIZE 0x1
- #define _OSCCON_SCS1_LENGTH 0x1
- #define _OSCCON_SCS1_MASK 0x2
- #define _OSCCON_IRCF0_POSN 0x3
- #define _OSCCON_IRCF0_POSITION 0x3
- #define _OSCCON_IRCF0_SIZE 0x1
- #define _OSCCON_IRCF0_LENGTH 0x1
- #define _OSCCON_IRCF0_MASK 0x8
- #define _OSCCON_IRCF1_POSN 0x4
- #define _OSCCON_IRCF1_POSITION 0x4
- #define _OSCCON_IRCF1_SIZE 0x1
- #define _OSCCON_IRCF1_LENGTH 0x1
- #define _OSCCON_IRCF1_MASK 0x10
- #define _OSCCON_IRCF2_POSN 0x5
- #define _OSCCON_IRCF2_POSITION 0x5
- #define _OSCCON_IRCF2_SIZE 0x1
- #define _OSCCON_IRCF2_LENGTH 0x1
- #define _OSCCON_IRCF2_MASK 0x20
- #define _OSCCON_IRCF3_POSN 0x6
- #define _OSCCON_IRCF3_POSITION 0x6
- #define _OSCCON_IRCF3_SIZE 0x1
- #define _OSCCON_IRCF3_LENGTH 0x1
- #define _OSCCON_IRCF3_MASK 0x40
- #define _OSCCON_SPLLEN_POSN 0x7
- #define _OSCCON_SPLLEN_POSITION 0x7
- #define _OSCCON_SPLLEN_SIZE 0x1
- #define _OSCCON_SPLLEN_LENGTH 0x1
- #define _OSCCON_SPLLEN_MASK 0x80
- #define _OSCCON_SCS_POSN 0x0
- #define _OSCCON_SCS_POSITION 0x0
- #define _OSCCON_SCS_SIZE 0x2
- #define _OSCCON_SCS_LENGTH 0x2
- #define _OSCCON_SCS_MASK 0x3
- #define _OSCCON_IRCF_POSN 0x3
- #define _OSCCON_IRCF_POSITION 0x3
- #define _OSCCON_IRCF_SIZE 0x4
- #define _OSCCON_IRCF_LENGTH 0x4
- #define _OSCCON_IRCF_MASK 0x78
- // Register: OSCSTAT
- extern volatile unsigned char OSCSTAT @ 0x09A;
- #ifndef _LIB_BUILD
- asm("OSCSTAT equ 09Ah");
- #endif
- // bitfield definitions
- typedef union {
- struct {
- unsigned HFIOFS :1;
- unsigned LFIOFR :1;
- unsigned MFIOFR :1;
- unsigned HFIOFL :1;
- unsigned HFIOFR :1;
- unsigned OSTS :1;
- unsigned PLLR :1;
- unsigned T1OSCR :1;
- };
- } OSCSTATbits_t;
- extern volatile OSCSTATbits_t OSCSTATbits @ 0x09A;
- // bitfield macros
- #define _OSCSTAT_HFIOFS_POSN 0x0
- #define _OSCSTAT_HFIOFS_POSITION 0x0
- #define _OSCSTAT_HFIOFS_SIZE 0x1
- #define _OSCSTAT_HFIOFS_LENGTH 0x1
- #define _OSCSTAT_HFIOFS_MASK 0x1
- #define _OSCSTAT_LFIOFR_POSN 0x1
- #define _OSCSTAT_LFIOFR_POSITION 0x1
- #define _OSCSTAT_LFIOFR_SIZE 0x1
- #define _OSCSTAT_LFIOFR_LENGTH 0x1
- #define _OSCSTAT_LFIOFR_MASK 0x2
- #define _OSCSTAT_MFIOFR_POSN 0x2
- #define _OSCSTAT_MFIOFR_POSITION 0x2
- #define _OSCSTAT_MFIOFR_SIZE 0x1
- #define _OSCSTAT_MFIOFR_LENGTH 0x1
- #define _OSCSTAT_MFIOFR_MASK 0x4
- #define _OSCSTAT_HFIOFL_POSN 0x3
- #define _OSCSTAT_HFIOFL_POSITION 0x3
- #define _OSCSTAT_HFIOFL_SIZE 0x1
- #define _OSCSTAT_HFIOFL_LENGTH 0x1
- #define _OSCSTAT_HFIOFL_MASK 0x8
- #define _OSCSTAT_HFIOFR_POSN 0x4
- #define _OSCSTAT_HFIOFR_POSITION 0x4
- #define _OSCSTAT_HFIOFR_SIZE 0x1
- #define _OSCSTAT_HFIOFR_LENGTH 0x1
- #define _OSCSTAT_HFIOFR_MASK 0x10
- #define _OSCSTAT_OSTS_POSN 0x5
- #define _OSCSTAT_OSTS_POSITION 0x5
- #define _OSCSTAT_OSTS_SIZE 0x1
- #define _OSCSTAT_OSTS_LENGTH 0x1
- #define _OSCSTAT_OSTS_MASK 0x20
- #define _OSCSTAT_PLLR_POSN 0x6
- #define _OSCSTAT_PLLR_POSITION 0x6
- #define _OSCSTAT_PLLR_SIZE 0x1
- #define _OSCSTAT_PLLR_LENGTH 0x1
- #define _OSCSTAT_PLLR_MASK 0x40
- #define _OSCSTAT_T1OSCR_POSN 0x7
- #define _OSCSTAT_T1OSCR_POSITION 0x7
- #define _OSCSTAT_T1OSCR_SIZE 0x1
- #define _OSCSTAT_T1OSCR_LENGTH 0x1
- #define _OSCSTAT_T1OSCR_MASK 0x80
复制代码一周热门 更多>