历史上的今天
今天是:2024年11月08日(星期五)
2019年11月08日 | 学习pic单片机经验
2019-11-08 来源:51hei
刚接触pic单片机 使用的是MPLAB IDE 对于配置字的要求可以通过软件进行设置
也可以用__CONFIG();进行设置
但是发现官网上用的是MOLAB X IDE 对于配置字的格式要求
变成了#pragma 当然也可以通过软件的窗口>>pic存储器视图>>配置字
对配置字进行设置
XC8对于中断的格式也有了变化 __interrupt(优先级)
#pragma config FOSC = INTRC_CLKOUT// Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN)
#pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled and can be enabled by SWDTEN bit of the WDTCON register)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config MCLRE = ON // RE3/MCLR pin function select bit (RE3/MCLR pin function is MCLR)
#pragma config CP = OFF // Code Protection bit (Program memory code protection is disabled)
#pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
#pragma config BOREN = ON // Brown Out Reset Selection bits (BOR enabled)
#pragma config IESO = OFF // Internal External Switchover bit (Internal/External Switchover mode is disabled)
#pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is disabled)
#pragma config LVP = OFF // Low Voltage Programming Enable bit (RB3 pin has digital I/O, HV on MCLR must be used for programming)
// CONFIG2
#pragma config BOR4V = BOR40V // Brown-out Reset Selection bit (Brown-out Reset set to 4.0V)
#pragma config WRT = OFF // Flash Program Memory Self Write Enable bits (Write protection off)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
史海拾趣
|
尊敬的斑竹及各位大牛们好,小弟一直关注次论坛!现在想问个问题?我的wince5.0系统现在可以识别u盘了,但是如果是FAT32格式的u盘识别时间要1分半钟(有时候可能还长),如果是FAt格式的u盘很快就识别了时间大概是10秒左右,我已经测试了n遍都是这样 ...… 查看全部问答> |
|
我对汇编不是很熟悉,看论坛里面有几个DX搞过这个,所以想请教下: 情况是:用AXD调试,bios可以起来!烧写到nandflash中后,就不可以了,所以就是nand_boot_beg段有问题了, 没有将nandflash中的代码搬到ram中去! nand_boot_beg代码如下 nand ...… 查看全部问答> |
|
我的设备的物理地址基址是0x3800 0000,映射成虚拟地址是0x9000 0000 和0x B000 0000 我设计的流接口驱动程序使用VirtualAlloc()函数、VirtualCopy()以及MmMapIoSpace()函数应该怎么映射地址?… 查看全部问答> |
|
linux硬件环境搭建好,在开发板上交叉编译运行自己的程序,却显示/bin/sh:./hello not found. 小弟终于搭建好uboot+linux2.6+busybox的硬件环境,用nfs系统成功驱动。 我自己编了简单的c程序,测试运行情况。 我在linux主机用arm-linux-gcc编译后,复制到开发板根目录运行 却显示 /bin/sh: ./hello not found 请问是交叉编译 ...… 查看全部问答> |
|
Linux环境下的软件安装,并不是一件容易的事情;如果通过源代码编译后在安装,当然事情就更为复杂一些;现在安装各种软件的教程都非常普遍;但万变不离其中,对基础知识的扎实掌握,安装各种软件的问题就迎刃而解了。Configure脚本配置工具就是基础 ...… 查看全部问答> |
|
本人菜鸟,请高手指点。有个M3(lm3s8962)小系统,要高速进行AD采样搜集,>=600K 采样频率。AD本身采样频率大于100MSPS,再加上SDRAM做数据缓冲。请问用M3能否实现?采用什么接口接受AD数据。SDRAM那里有什么要注意的?谢谢!… 查看全部问答> |




