[其它应用] 请教高手《SH88F2051 FLASH 写/读 结果不符 咋解决?》

[复制链接]
 楼主| SUNWENQI 发表于 2017-3-14 14:13 | 显示全部楼层 |阅读模式
#include <define51.H>
#include <FLASH-SH88F51.H>       
#include <INTRINS.H>
#include <SH88F2051A.H>
//#include <define.h>

unsigned char code Flash[2048] _at_ 0x8000;
//unsigned char code eeprom[2048] _at_ 0x3000;

uint flash_data;

void main()
{
        _nop_();
        _nop_();

        erase_eeprom((uint8) 0x80, (uint8) 0);                                   // 擦除eeprom/flash的指定页
       
        _nop_();
        _nop_();

        write_eeprom_u16((uint16) 0x0078,  (uint16) 0x8000, (uint8) 0);        // 将int型变量写入指定的eeprom/flash中

        _nop_();
        _nop_();

        flash_data = read_eeprom_u16((uint16) 0x8000, (uint8) 0); // 从指定的eeprom/flash地址中读出int型变量
       
        _nop_();
        _nop_();

        while(1)
        {
        _nop_();
        _nop_();
        }         
          
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部