pic单片机怎么在MPLAB设定初始EEPROM
4个回答
展开全部
用DE伪指令
举例:
ORG 0x2100 ;这是PIC16F628A的EEPROM虚拟地址,当然
;不同的芯片是不同的
DE 0x00, 0x01, 0x02, 0x03 ;初始化EEPROM数据
picc编译器
EEPROM 数据
有些PIC单片机支持用外部编程器对内部的EEPROM进行编程。
__EEPROM_DATA()可以将用于初始化的数据放入HEX文件中,如:
__EEPROM_DATA(0, 1, 2, 3, 4, 5, 6, 7)
可将0-7八个数放入HEX文件中,在用外部的编程器进行编程时将 这八个数写入PIC单片机中。
__EEPROM_DATA不是用于运行时写入EEPROM数据的,在运行时请用 EEPROM_READ(), EEPROM_WRITE()。
举例:
ORG 0x2100 ;这是PIC16F628A的EEPROM虚拟地址,当然
;不同的芯片是不同的
DE 0x00, 0x01, 0x02, 0x03 ;初始化EEPROM数据
picc编译器
EEPROM 数据
有些PIC单片机支持用外部编程器对内部的EEPROM进行编程。
__EEPROM_DATA()可以将用于初始化的数据放入HEX文件中,如:
__EEPROM_DATA(0, 1, 2, 3, 4, 5, 6, 7)
可将0-7八个数放入HEX文件中,在用外部的编程器进行编程时将 这八个数写入PIC单片机中。
__EEPROM_DATA不是用于运行时写入EEPROM数据的,在运行时请用 EEPROM_READ(), EEPROM_WRITE()。
追问
EEPROM虚拟地址是什么?我在数据手册中怎么没看到?
追答
这个在数据手册没有,在宏汇编de指令时讲的,0X2100对应eeprom的起始地址,记住就行了
展开全部
//初始化EEPROM的数据,它们是8个一组合(如果不够8个将它补全8个字节,),
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xF2,0x7F,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xF2,0x7F,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x4F,0xFE,0x03,0x00);
__EEPROM_DATA(0xDD,0xDD,0x13,0x00,0xE0,0x4C,0x00,0x00);
__EEPROM_DATA(0x68,0x5B,0x00,0x00,0x18,0x60,0x00,0x00);
__EEPROM_DATA(0x55,0x5A,0xBE,0xFF,0x65,0xC8,0x21,0x00);
__EEPROM_DATA(0x03,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
__EEPROM_DATA(0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
__EEPROM_DATA(0xFF,0xFF,0xFF,0xFF,0x01,0xFF,0x00,0xFF);
__EEPROM_DATA(0x02,0xFF,0xC5,0xFF,0x06,0xFF,0x01,0xFF);
__EEPROM_DATA(0x0F,0xFF,0x14,0xFF,0xff,0xff,0xff,0xff);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xF2,0x7F,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xFF,0xFF,0xFF,0xFF,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0xF2,0x7F,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00);
__EEPROM_DATA(0x00,0x00,0x00,0x00,0x4F,0xFE,0x03,0x00);
__EEPROM_DATA(0xDD,0xDD,0x13,0x00,0xE0,0x4C,0x00,0x00);
__EEPROM_DATA(0x68,0x5B,0x00,0x00,0x18,0x60,0x00,0x00);
__EEPROM_DATA(0x55,0x5A,0xBE,0xFF,0x65,0xC8,0x21,0x00);
__EEPROM_DATA(0x03,0x50,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
__EEPROM_DATA(0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF);
__EEPROM_DATA(0xFF,0xFF,0xFF,0xFF,0x01,0xFF,0x00,0xFF);
__EEPROM_DATA(0x02,0xFF,0xC5,0xFF,0x06,0xFF,0x01,0xFF);
__EEPROM_DATA(0x0F,0xFF,0x14,0xFF,0xff,0xff,0xff,0xff);
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如果你用C语言编程的话,可以用如下的程序:
__EEPROM_DATA(0x1e,0x50,0x01,0x1d,0x01,0xb8,0x18,0xa6);
注意,前面是双下划线。它的意思是从EEPROM的单元0=7分别用0x1e,0x50,0x01,0x1d,0x01,0xb8,0x18,0xa6填充。如果还有数据,接着写这个语句。
这个可看北航的《PIC16系列单片机C程序设计与PROTEUS仿真》一书的P62。
__EEPROM_DATA(0x1e,0x50,0x01,0x1d,0x01,0xb8,0x18,0xa6);
注意,前面是双下划线。它的意思是从EEPROM的单元0=7分别用0x1e,0x50,0x01,0x1d,0x01,0xb8,0x18,0xa6填充。如果还有数据,接着写这个语句。
这个可看北航的《PIC16系列单片机C程序设计与PROTEUS仿真》一书的P62。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你是不是想烧写EEPROM的初始值上去?在烧写程序时先选择View-EEPORM.就可以修改烧进去的值了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询